From d7911c3ec10d3632cdba92d8b99264aeaef85890 Mon Sep 17 00:00:00 2001 From: Jens Preussner Date: Mon, 14 Oct 2019 13:02:08 +0200 Subject: [PATCH] Add possibility to remove example; bump version --- wilson-basic/.Renviron.j2 | 3 +++ wilson-basic/app.R | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/wilson-basic/.Renviron.j2 b/wilson-basic/.Renviron.j2 index 8740f67..0bb19a6 100644 --- a/wilson-basic/.Renviron.j2 +++ b/wilson-basic/.Renviron.j2 @@ -6,3 +6,6 @@ WILSON_SIDEPANELWIDTH={{ "WILSON_SIDEPANELWIDTH"|env("2") }} # Define with of the main panel WILSON_MAINPANELWIDTH={{ "WILSON_MAINPANELWIDTH"|env("10") }} + +# Remove examples from data source +WILSON_BLACKLIST_EXAMPLES={{ "WILSON_BLACKLIST_EXAMPLES"|env("false") }} diff --git a/wilson-basic/app.R b/wilson-basic/app.R index ba37a02..18b56d6 100755 --- a/wilson-basic/app.R +++ b/wilson-basic/app.R @@ -11,7 +11,7 @@ if(!requireNamespace("shinyBS", quietly = TRUE)) { stop("The package shinyBS nee if(!requireNamespace("htmltools", quietly = TRUE)) { stop("The package htmltools needs to be installed in order to use this app.")} # Set versions -wilson_app_version <- "WIlsON basic 2.1.0" +wilson_app_version <- "WIlsON basic 2.1.1" wilson_package_version <- as.character(packageVersion("wilson")) # @@ -52,12 +52,16 @@ wilson_auto_reload_pattern <- ".*\\.(r|se|R|clarion)$" wilson_auto_reload_interval <- 3000 # Sets the max file upload size in mb -# This value only changes upload size of the shiny-server preceeding services (e.g. reverse proxy) must be altered aswell. +# This value only changes upload size of the shiny-server. Other services (e.g. a reverse proxy) must be configured properly as well. wilson_max_upload_size <- 100 # Allow logging of uploaded files for debugging purposes wilson_log_upload <- TRUE +# Remove example files from data selection +example_files <- c("A_RNAseq_Zhang_2015.se", "B_Methylation_Hautefort_Oncot_2017.se", "C_Proteomics_Worzfeld_MCP_2017.se") +wilson_blacklist_examples <- as.logical(Sys.getenv("WILSON_BLACKLIST_EXAMPLES", unset = FALSE)) + # # WIlsON application logic # @@ -142,7 +146,7 @@ ui <- dashboardPage(header = dashboardHeader(disable = TRUE), sidebar = dashboar tags$h6("Highlighted Features"), verbatimTextOutput("filter_h1"), tags$h3("Global Parameters"), - radioButtons(inputId = "data_origin", label = "Choose data origin:", choices = c("Examples", "Upload")), + radioButtons(inputId = "data_origin", label = "Choose data source:", choices = c("Select from list", "Upload file")), uiOutput(outputId = "fileLoader"), bsButton("filter_log_b", label = "Toggle log", style = "default", size = "small"), hidden(verbatimTextOutput("filter_log")) @@ -536,6 +540,11 @@ server <- function(session, input, output) { # Use all .se and .clarion files specified in data load <- sapply(list.files(path = "data", pattern = "\\.se$|\\.clarion$"), function(x){ file.path("data", x)}) + # Remove example files if requested + if (wilson_blacklist_examples) { + load <- load[setdiff(names(load), example_files)] + } + # check for additional data if (dir.exists("external_data")) { # use all .se and .clarion files specified in external_data