Skip to content

Commit

Permalink
Package release for review
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAlcazer authored Mar 21, 2023
1 parent febe0f3 commit 8de6498
Show file tree
Hide file tree
Showing 34 changed files with 2,208 additions and 21 deletions.
21 changes: 21 additions & 0 deletions AIPAL.Rproj
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
35 changes: 35 additions & 0 deletions DESCRIPTION
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
23 changes: 2 additions & 21 deletions LICENSE
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
21 changes: 21 additions & 0 deletions LICENSE.md
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.
26 changes: 26 additions & 0 deletions NAMESPACE
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)
3 changes: 3 additions & 0 deletions R/_disable_autoload.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Disabling shiny autoload

# See ?shiny::loadSupport for more information
44 changes: 44 additions & 0 deletions R/app_config.R
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
)
}
58 changes: 58 additions & 0 deletions R/app_server.R
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)
}
Loading

0 comments on commit 8de6498

Please sign in to comment.