Browse code

Minor fixes

Yichen Wang authored on 13/04/2021 07:25:29
Showing 4 changed files

... ...
@@ -14,7 +14,7 @@
14 14
 #' @param prefix Prefix to use for the name of the output file. Default \code{"sample"}.
15 15
 #' @param overwrite Boolean. Default \code{TRUE}.
16 16
 #' @param compression If output file compression is required, this variable accepts
17
-#' 'gzip', 'lzf' or "None" as inputs. Default \code{gzip"}.
17
+#' 'gzip', 'lzf' or "None" as inputs. Default \code{"gzip"}.
18 18
 #' @param compressionOpts Integer. Sets the compression level
19 19
 #' @param forceDense Default \code{False} Write sparse data as a dense matrix.
20 20
 #' Refer \code{anndata.write_h5ad} documentation for details. Default \code{NULL}.
... ...
@@ -8022,16 +8022,26 @@ shinyServer(function(input, output, session) {
8022 8022
     } else if (input$exportChoice == "textfile") {
8023 8023
       extName <- ".txt"
8024 8024
     }
8025
-    tags$div(
8026
-      div(style = "display: inline-block;vertical-align:top; width: 160px;",
8027
-          textInput("exportPrefix", label = NULL,
8028
-                    value = defaultName, placeholder = "Required!",
8029
-                    width = '160px')),
8030
-      div(
8031
-        style = "display: inline-block;vertical-align:top; width: 50px;",
8032
-        p(extName, style = "margin-top: 8px; margin-left: 2px; font-size: 16px;")
8025
+    if (input$exportChoice != "textfile") {
8026
+      tags$div(
8027
+        div(style = "display: inline-block;vertical-align:top; width: 160px;",
8028
+            textInput("exportPrefix", label = NULL,
8029
+                      value = defaultName, placeholder = "Required!",
8030
+                      width = '160px')),
8031
+        div(
8032
+          style = "display: inline-block;vertical-align:top; width: 50px;",
8033
+          p(extName, style = "margin-top: 8px; margin-left: 2px; font-size: 16px;")
8034
+        )
8033 8035
       )
8034
-    )
8036
+    } else {
8037
+      tags$div(
8038
+        div(style = "display: inline-block;vertical-align:top; width: 160px;",
8039
+            textInput("exportPrefix", label = NULL,
8040
+                      value = defaultName, placeholder = "Required!",
8041
+                      width = '160px')),
8042
+      )
8043
+    }
8044
+
8035 8045
   })
8036 8046
 
8037 8047
   addPopover(session, 'exportAssayLabel', '', "The name of assay of interests that will be set as the primary matrix of the output AnnData.", 'right')
... ...
@@ -23,30 +23,36 @@ shinyPanelExport <- fluidPage(
23 23
           "Flat text files" = "textfile"
24 24
         )
25 25
       ),
26
-      tags$label(id="exportFileNameLabel", "File Name"),
26
+      conditionalPanel(
27
+        condition = "input.exportChoice == 'annData' || input.exportChoice == 'rds'",
28
+        tags$label(id="exportFileNameLabel", "File Name"),
29
+      ),
30
+      conditionalPanel(
31
+        condition = "input.exportChoice == 'textfile'",
32
+        tags$label(id="exportFileNameLabel", "File prefix"),
33
+      ),
27 34
       uiOutput("exportFileName"),
28 35
       actionButton("exportData", "Download")
29 36
     ),
30 37
     column(
31 38
       6,
32 39
       conditionalPanel(
33
-        condition = "input.exportChoice === 'textfile'",
40
+        condition = "input.exportChoice == 'textfile'",
34 41
         tags$h5(style = "font-weight: bold; margin-bottom: 15px", "Set export specifications"),
35 42
         checkboxInput("exportFlatGzip", "Gzip Compress", value = TRUE)
36 43
       ),
37 44
       conditionalPanel(
38
-        condition = "input.exportChoice === 'annData'",
45
+        condition = "input.exportChoice == 'annData'",
39 46
         tags$h5(style = "font-weight: bold; margin-bottom: 15px", "Set export specifications"),
40
-        tags$label(id="exportAssayLabel", "Assay"),
41 47
         uiOutput("exportAssay"),
42
-        tags$label(id="compressionLabel", "Compression"),
48
+        # tags$label(id="compressionLabel", "Compression"),
43 49
         # selectInput("compression", label = NULL, c("None", "lzf", "gzip"), width='140px'),
44 50
         tags$label(id="compressionOptsLabel", "Compression Opts"),
45 51
         numericInput("compressionOpts", label = NULL, 1, min = 1, max = 100, width='140px'),
46 52
         checkboxInput("forceDense", "Force Dense", value = FALSE)
47 53
       ),
48 54
       conditionalPanel(
49
-        condition = "input.exportChoice === 'textfile' || input.exportChoice === 'annData'",
55
+        condition = "input.exportChoice == 'textfile' || input.exportChoice == 'annData'",
50 56
         checkboxInput("exportOverwrite", "Overwrite", value = TRUE)
51 57
       )
52 58
     )
... ...
@@ -31,7 +31,7 @@ Default \code{"counts"}.}
31 31
 \item{overwrite}{Boolean. Default \code{TRUE}.}
32 32
 
33 33
 \item{compression}{If output file compression is required, this variable accepts
34
-'gzip', 'lzf' or "None" as inputs. Default \code{gzip"}.}
34
+'gzip', 'lzf' or "None" as inputs. Default \code{"gzip"}.}
35 35
 
36 36
 \item{compressionOpts}{Integer. Sets the compression level}
37 37