Browse code

method in x label, args change with method

pablo-rodr-bio2 authored on 29/04/2021 17:41:04
Showing3 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: GSVA
2
-Version: 1.39.25
2
+Version: 1.39.26
3 3
 Title: Gene Set Variation Analysis for microarray and RNA-seq data
4 4
 Authors@R: c(person("Justin", "Guinney", role=c("aut", "cre"), email="justin.guinney@sagebase.org"),
5 5
              person("Robert", "Castelo", role="aut", email="robert.castelo@upf.edu"),
... ...
@@ -920,11 +920,6 @@ zscore <- function(X, geneSets, parallel.sz, verbose=TRUE,
920 920
   rownames(es) <- names(geneSets)
921 921
   colnames(es) <- colnames(X)
922 922
 
923
-  if (verbose && length(geneSets) > n) {
924
-    setTxtProgressBar(get("progressBar", envir=globalenv()), 1)
925
-    close(get("progressBar", envir=globalenv()))
926
-  }
927
-
928 923
   es
929 924
 }
930 925
 
... ...
@@ -18,21 +18,15 @@ argumentsDataUI <- function(id) {
18 18
           radioButtons(ns("absRanking"), "abs.ranking:",
19 19
                        c("False" = FALSE,
20 20
                          "True" = TRUE)),
21
-          numericInput(ns("minSz"),"min.sz:",value = 1),
22
-          numericInput(ns("maxSz"),"max.sz (Write 0 for infinite):",value = 0),
21
+          numericInput(ns("minSz"),"min.sz:", value = 1),
22
+          numericInput(ns("maxSz"),"max.sz (Write 0 for infinite):", value = 0),
23 23
           radioButtons(ns("mxDiff"), "mx.diff:",
24 24
                        c("True" = TRUE,
25 25
                          "False" = FALSE)),
26
-          conditionalPanel(
27
-            condition = "input.method == 'gsva'", ns = ns, 
28
-            numericInput(ns("tau1"),"tau:",value = 1)
29
-          ),
30
-          conditionalPanel(
31
-            condition = "input.method == 'ssgsea'", ns = ns, 
32
-            numericInput(ns("tau2"),"tau:",value = 0.25),
33
-            radioButtons(ns("ssgseaNorm"), "ssgsea.norm:",
34
-                         c("True" = TRUE,
35
-                           "False" = FALSE)))
26
+          numericInput(ns("tau"),"tau:", value = 1),
27
+          radioButtons(ns("ssgseaNorm"), "ssgsea.norm:",
28
+                       c("True" = TRUE,
29
+                         "False" = FALSE))
36 30
         )))
37 31
     )
38 32
   )
... ...
@@ -40,6 +34,27 @@ argumentsDataUI <- function(id) {
40 34
 
41 35
 argumentsDataServer <- function(id){
42 36
   moduleServer(id, function(input, output, session){
37
+    
38
+    observeEvent(input$method, {
39
+      toggleElement("kcdf", condition = input$method %in% c("gsva", "ssgsea"))
40
+      toggleElement("absRanking", condition = input$method %in% c("gsva", "ssgsea"))
41
+      toggleElement("ssgseaNorm", condition = input$method %in% "ssgsea")
42
+      toggleElement("mxDiff", condition = input$method %in% "gsva")
43
+      toggleElement("tau", condition = input$method %in% c("gsva", "ssgsea"))
44
+      
45
+      if(input$method == "gsva"){
46
+        updateNumericInput(inputId = "tau", value = 1)
47
+      } else {
48
+        updateNumericInput(inputId = "tau", value = 0.25)
49
+      }
50
+      
51
+      if(input$method %in% c("zscore", "plage")){
52
+        updateSelectInput(inputId = "kcdf", selected = "Gaussian")
53
+      }
54
+      
55
+    })
56
+    
57
+    #"absRanking", "ssgseaNorm", "mxDiff", "tau"
43 58
     varMinsz <-  reactive({
44 59
       validate(need(!is.na(input$minSz), "Value 'min.sz' cannot be empty and must be an integer value"))
45 60
       input$minSz })
... ...
@@ -47,16 +62,11 @@ argumentsDataServer <- function(id){
47 62
       validate(need(!is.na(input$maxSz), "Value 'max.sz' cannot be empty and must be an integer value"))
48 63
       ifelse(input$maxSz==0, Inf, input$maxSz) })
49 64
     selectedTau <-  reactive({
50
-      if(input$method == "gsva"){
51
-        validate(need(!is.na(input$tau1), "Value 'tau' cannot be empty and must be an integer value"))
52
-        input$tau1
65
+      if(input$method %in% c("gsva", "ssgsea")){
66
+        validate(need(!is.na(input$tau), "Value 'tau' cannot be empty and must be an integer value"))
67
+        input$tau
53 68
       } else {
54
-        if(input$method == "ssgsea"){
55
-          validate(need(!is.na(input$tau2), "Value 'tau' cannot be empty and must be an integer value"))
56
-          input$tau2
57
-        } else {
58
-          NULL
59
-        }
69
+        NULL
60 70
       }
61 71
     })
62 72
     method <-  reactive({ input$method })