From 91d85a0d08e8d59931484fd34c3c6d521e785656 Mon Sep 17 00:00:00 2001 From: Paul Jonas Jost <70631928+PaulJonasJost@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:13:28 +0200 Subject: [PATCH] tmp_data_selected as global variable was not needed anyways, as res_tmp[[session$token]]$data was assigned the exact same value anyways (#217) --- program/shinyApp/server.R | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/program/shinyApp/server.R b/program/shinyApp/server.R index 3435c4c7..3a2a7daf 100644 --- a/program/shinyApp/server.R +++ b/program/shinyApp/server.R @@ -798,7 +798,6 @@ server <- function(input,output,session){ } # Data set selection res_tmp[[session$token]]$data <<- res_tmp[[session$token]]$data_original[selected,samples_selected] - tmp_data_selected <<- res_tmp[[session$token]]$data_original[selected,samples_selected] return("Selection Success") }) @@ -832,7 +831,7 @@ server <- function(input,output,session){ "Choose main factor for desing formula in DESeq pipeline ", "(App might crash if your factor as only 1 sample per level)" ), - choices = c(colnames(colData(tmp_data_selected))), + choices = c(colnames(colData(res_tmp[[session$token]]$data))), multiple = F, selected = "condition" ) %>% helper(type = "markdown", content = "PreProcessing_DESeqMain") @@ -846,7 +845,7 @@ server <- function(input,output,session){ "Choose other factors to account for", "(App might crash if your factor as only 1 sample per level)" ), - choices = c(colnames(colData(tmp_data_selected))), + choices = c(colnames(colData(res_tmp[[session$token]]$data))), multiple = T, selected = "condition" ) %>% helper(type = "markdown", content = "PreProcessing_DESeqSub") @@ -862,7 +861,7 @@ server <- function(input,output,session){ par_tmp[[session$token]]['PreProcessing_Procedure'] <<- input$PreProcessing_Procedure print("Remove all entities which are constant over all samples") - res_tmp[[session$token]]$data <<- tmp_data_selected[rownames(tmp_data_selected[which(apply(assay(tmp_data_selected),1,sd) != 0),]),] + res_tmp[[session$token]]$data <<- res_tmp[[session$token]]$data[rownames(res_tmp[[session$token]]$data[which(apply(assay(res_tmp[[session$token]]$data),1,sd) != 0),]),] print(dim(res_tmp[[session$token]]$data)) # explicitly set rownames to avoid any errors. @@ -917,7 +916,7 @@ server <- function(input,output,session){ tryCatch({ if(input$PreProcessing_Procedure == "vst_DESeq"){ res_tmp[[session$token]]$data <<- deseq_processing( - data = tmp_data_selected, + data = res_tmp[[session$token]]$data, omic_type = par_tmp[[session$token]]$omic_type, formula_main = input$DESeq_formula_main, formula_sub = input$DESeq_formula_sub, @@ -926,7 +925,7 @@ server <- function(input,output,session){ ) } else { res_tmp[[session$token]]$data <<- preprocessing( - data = tmp_data_selected, + data = res_tmp[[session$token]]$data, omic_type = par_tmp[[session$token]]$omic_type, procedure = input$PreProcessing_Procedure )