Skip to content

Commit

Permalink
tmp_data_selected as global variable was not needed anyways, as res_t…
Browse files Browse the repository at this point in the history
…mp[[session$token]]$data was assigned the exact same value anyways (#217)
  • Loading branch information
PaulJonasJost authored Jul 4, 2024
1 parent c48d06e commit 91d85a0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions program/shinyApp/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})

Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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
)
Expand Down

0 comments on commit 91d85a0

Please sign in to comment.