-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
febe0f3
commit 8de6498
Showing
34 changed files
with
2,208 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: No | ||
SaveWorkspace: No | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
AutoAppendNewline: Yes | ||
StripTrailingWhitespace: Yes | ||
LineEndingConversion: Posix | ||
|
||
BuildType: Package | ||
PackageUseDevtools: Yes | ||
PackageInstallArgs: --no-multiarch --with-keep.source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Package: AIPAL | ||
Title: Artificial Intelligence-based Prediction of Acute Leukemia type | ||
Version: 0.0.0.9000 | ||
Authors@R: | ||
person("Vincent", "Alcazer", , "[email protected]", role = c("cre", "aut")) | ||
Description: Prediction of Acute leukemia types (promyelocytic (APL), | ||
non-APL myeloblastic (AML) or lymphoblastic (ALL). | ||
License: MIT + file LICENSE | ||
URL: https://github.com/VincentAlcazer/AIPAL | ||
BugReports: https://github.com/VincentAlcazer/AIPAL/issues | ||
Imports: | ||
caret, | ||
config (>= 0.3.1), | ||
dplyr, | ||
DT, | ||
factoextra, | ||
ggplot2, | ||
ggrepel, | ||
golem (>= 0.3.2), | ||
MetBrewer, | ||
pkgload, | ||
rmarkdown, | ||
shiny (>= 1.7.1), | ||
shinycssloaders, | ||
shinydashboard, | ||
shinyWidgets, | ||
tibble, | ||
tidyr, | ||
xgboost | ||
Suggests: | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,2 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Vincent Alcazer | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
YEAR: 2022 | ||
COPYRIGHT HOLDER: Vincent Alcazer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) 2022 Vincent Alcazer | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(run_app) | ||
import(MetBrewer) | ||
import(caret) | ||
import(dplyr) | ||
import(ggplot2) | ||
import(ggrepel) | ||
import(rmarkdown) | ||
import(shiny) | ||
import(shinydashboard) | ||
import(tibble) | ||
import(tidyr) | ||
import(xgboost) | ||
importFrom(golem,activate_js) | ||
importFrom(golem,add_resource_path) | ||
importFrom(golem,bundle_resources) | ||
importFrom(golem,favicon) | ||
importFrom(golem,with_golem_options) | ||
importFrom(shiny,HTML) | ||
importFrom(shiny,NS) | ||
importFrom(shiny,column) | ||
importFrom(shiny,shinyApp) | ||
importFrom(shiny,tagAppendAttributes) | ||
importFrom(shiny,tagList) | ||
importFrom(shiny,tags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Disabling shiny autoload | ||
|
||
# See ?shiny::loadSupport for more information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#' Access files in the current app | ||
#' | ||
#' NOTE: If you manually change your package name in the DESCRIPTION, | ||
#' don't forget to change it here too, and in the config file. | ||
#' For a safer name change mechanism, use the `golem::set_golem_name()` function. | ||
#' | ||
#' @param ... character vectors, specifying subdirectory and file(s) | ||
#' within your package. The default, none, returns the root of the app. | ||
#' | ||
#' @noRd | ||
app_sys <- function(...) { | ||
system.file(..., package = "AIPAL") | ||
} | ||
|
||
|
||
#' Read App Config | ||
#' | ||
#' @param value Value to retrieve from the config file. | ||
#' @param config GOLEM_CONFIG_ACTIVE value. If unset, R_CONFIG_ACTIVE. | ||
#' If unset, "default". | ||
#' @param use_parent Logical, scan the parent directory for config file. | ||
#' @param file Location of the config file | ||
#' | ||
#' @noRd | ||
get_golem_config <- function( | ||
value, | ||
config = Sys.getenv( | ||
"GOLEM_CONFIG_ACTIVE", | ||
Sys.getenv( | ||
"R_CONFIG_ACTIVE", | ||
"default" | ||
) | ||
), | ||
use_parent = TRUE, | ||
# Modify this if your config file is somewhere else | ||
file = app_sys("golem-config.yml") | ||
) { | ||
config::get( | ||
value = value, | ||
config = config, | ||
file = file, | ||
use_parent = use_parent | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#' The application server-side | ||
#' | ||
#' @param input,output,session Internal parameters for {shiny}. | ||
#' DO NOT REMOVE. | ||
#' @import shiny | ||
#' @noRd | ||
app_server <- function(input, output, session) { | ||
|
||
#################### ==================== Data loading ==================== #################### | ||
r <- reactiveValues( | ||
test = reactiveValues() | ||
) | ||
|
||
|
||
##### ===== New data | ||
|
||
newdata <- reactive({ | ||
|
||
req(input$run >= 1) | ||
input$run | ||
isolate({ | ||
|
||
dat <- data.frame( | ||
"MCV_fL" = if_else(input$MCV_na == F, as.numeric(input$MCV), as.numeric(NA)), | ||
"PT_percent" = if_else(input$PT_na == F, as.numeric(input$PT), as.numeric(NA)), | ||
"LDH_UI_L" = if_else(input$LDH_na == F, as.numeric(input$LDH), as.numeric(NA)), | ||
"MCHC_g_L" = if_else(input$MCHC_na == F, as.numeric(input$MCHC), as.numeric(NA)), | ||
"WBC_G_L" = if_else(input$WBC_na == F, as.numeric(input$WBC), as.numeric(NA)), | ||
"Fibrinogen_g_L" = if_else(input$fibri_na == F, as.numeric(input$fibri), as.numeric(NA)), | ||
"age" = if_else(input$age_na == F, as.numeric(input$age), as.numeric(NA)), | ||
#"Phosphorus_mmol_L" = input$phospho, | ||
#"ANC_G_L" = input$ANC, | ||
"Monocytes_G_L" = if_else(input$mono_na == F, as.numeric(input$mono), as.numeric(NA)), | ||
"Platelets_G_L" = if_else(input$platelets_na == F, as.numeric(input$platelets), as.numeric(NA)), | ||
"Lymphocytes_G_L" = if_else(input$ALC_na == F, as.numeric(input$ALC), as.numeric(NA)) | ||
) %>% | ||
mutate(Monocytes_percent = Monocytes_G_L*100 / WBC_G_L) | ||
|
||
|
||
return(dat) | ||
|
||
}) | ||
}) | ||
|
||
|
||
##### ===== R list | ||
|
||
observe({ | ||
r$test$newdata <- newdata() | ||
}) | ||
|
||
|
||
|
||
|
||
#################### ==================== App modules ==================== #################### | ||
|
||
mod_prediction_server("prediction_1", r=r) | ||
} |
Oops, something went wrong.