Browse code

Merge branch 'shinyDashboard' of https://github.com/pablo-rodr-bio2/GSVA into pablo-rodr-bio2-shinyDashboard

Robert Castelo authored on 11/05/2021 11:20:49
Showing6 changed files

... ...
@@ -3,33 +3,36 @@ argumentsDataUI <- function(id) {
3 3
   ns <- NS(id)
4 4
   
5 5
   #UI Definition
6
-  column(
7
-    width=3,
8
-    conditionalPanel(
9
-      condition = "input.arg == 'yes'",
10
-      h3("Parameters"),
11
-      wellPanel(fluidRow(
12
-        column(
13
-          12,
14
-          selectInput(ns("method"), "Choose method:",
15
-                      choices = methodChoices),
16
-          selectInput(ns("kcdf"), "Choose kcdf:",
17
-                      c("Gaussian","Poisson","none")),
18
-          radioButtons(ns("absRanking"), "abs.ranking:",
19
-                       c("False" = FALSE,
20
-                         "True" = TRUE)),
21
-          numericInput(ns("minSz"),"min.sz:", value = 1),
22
-          numericInput(ns("maxSz"),"max.sz (Write 0 for infinite):", value = 0),
23
-          radioButtons(ns("mxDiff"), "mx.diff:",
24
-                       c("True" = TRUE,
25
-                         "False" = FALSE)),
26
-          numericInput(ns("tau"),"tau:", value = 1),
27
-          radioButtons(ns("ssgseaNorm"), "ssgsea.norm:",
28
-                       c("True" = TRUE,
29
-                         "False" = FALSE))
30
-        )))
6
+  conditionalPanel(
7
+    condition = "input.arg == 'yes'",
8
+    fluidRow(
9
+      column(
10
+        width = 12,
11
+        align = "center",
12
+        h3("Parameters", style="font-weight: bold")
13
+      )
14
+    ),
15
+    wellPanel(
16
+      
17
+      selectInput(ns("method"), "Choose method:",
18
+                  choices = methodChoices),
19
+      selectInput(ns("kcdf"), "Choose kcdf:",
20
+                  c("Gaussian","Poisson","none")),
21
+      radioButtons(ns("absRanking"), "abs.ranking:",
22
+                   c("False" = FALSE,
23
+                     "True" = TRUE)),
24
+      numericInput(ns("minSz"),"min.sz:", value = 1),
25
+      numericInput(ns("maxSz"),"max.sz (Write 0 for infinite):", value = 0),
26
+      radioButtons(ns("mxDiff"), "mx.diff:",
27
+                   c("True" = TRUE,
28
+                     "False" = FALSE)),
29
+      numericInput(ns("tau"),"tau:", value = 1),
30
+      radioButtons(ns("ssgseaNorm"), "ssgsea.norm:",
31
+                   c("True" = TRUE,
32
+                     "False" = FALSE))
31 33
     )
32 34
   )
35
+  
33 36
 }
34 37
 
35 38
 argumentsDataServer <- function(id){
... ...
@@ -37,7 +40,7 @@ argumentsDataServer <- function(id){
37 40
     
38 41
     observeEvent(input$method, {
39 42
       toggleElement("kcdf", condition = input$method %in% c("gsva", "ssgsea"))
40
-      toggleElement("absRanking", condition = input$method %in% c("gsva", "ssgsea"))
43
+      toggleElement("absRanking", condition = input$method %in% "gsva")
41 44
       toggleElement("ssgseaNorm", condition = input$method %in% "ssgsea")
42 45
       toggleElement("mxDiff", condition = input$method %in% "gsva")
43 46
       toggleElement("tau", condition = input$method %in% c("gsva", "ssgsea"))
... ...
@@ -1,6 +1,12 @@
1 1
 closeBtnUI <- function(id){
2 2
   ns <- NS(id)
3
-  hidden(actionButton(ns("closeSave"), "Save & Close"))
3
+  hidden(actionButton(ns("closeSave"), "Save & Close", style = "color: #fff;
4
+  font-weight: bold;
5
+  background-color: red;
6
+  border-color: #fff;
7
+  width:130;
8
+  padding: 5px 5px 5px 5px;
9
+  margin: 5px 5px 5px 5px; "))
4 10
 }
5 11
 
6 12
 closeBtnServer <- function(id, gs){
... ...
@@ -1,6 +1,11 @@
1 1
 downloadUI <- function(id) {
2 2
   ns <- NS(id)
3
-  hidden(downloadButton(ns('downloadData'), 'Download'))
3
+  hidden(downloadButton(ns('downloadData'), 'Download', style = "color: #fff;
4
+  font-weight: bold;
5
+  background-color: #27ae60;
6
+  border-color: #fff;
7
+  padding: 5px 14px 5px 14px;
8
+  margin: 5px 5px 5px 5px;" ))
4 9
 }
5 10
 
6 11
 downloadServer <- function(id, gs){
... ...
@@ -10,6 +10,7 @@ library(future)
10 10
 library(promises)
11 11
 library(shinyjs)
12 12
 library(shinybusy)
13
+library(shinydashboard)
13 14
 plan(multisession)
14 15
 source("argumentsDataModule.R")
15 16
 source("modalGSVAModule.R")
... ...
@@ -1,64 +1,69 @@
1
-fluidPage( 
2
-  theme = shinytheme("spacelab"),
3
-  shinyjs::useShinyjs(),
4
-  add_busy_spinner(spin = "double-bounce", position = "bottom-right",
5
-                   height = "100px", width = "100px"),
6
-  tags$head(
7
-    tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
1
+dashboardPage(
2
+  title = "GSVA Shiny Application",
3
+  
4
+  dashboardHeader(
5
+    tags$li(class = "dropdown",
6
+            tags$div(id = "app_title", "GSVA Shiny Application")
7
+    ),
8
+    title = tags$img(src="GSVA.png", height=75, width=75)
8 9
   ),
9
-  titlePanel( 
10
-    fluidRow(id = "title_gsva",
11
-      column(6,
12
-             h2(id="app_title", "GSVA SHINY APP", align="left")),
13
-      column(6,
14
-             h2(tags$img(src="GSVA.png", align="right", height=75, width=75)))
15
-    ), windowTitle="GSVA"),
16 10
   
17
-  fluidRow(
18
-    column(
19
-      width=3,
20
-      h3("Data input"),
21
-      #Select data source
22
-      wellPanel(fluidRow(
23
-        column(
24
-          12,
25
-          matrixUI("matrix1"),
26
-          fluidRow(column(12,
27
-                          HTML("<br>"))),
28
-          geneSetsUI("genes1"),
29
-          HTML("<br>"),
30
-          radioButtons("arg", "Change default settings:",
31
-                       c("No" = "no",
32
-                         "Yes" = "yes")),
33
-          actionButton("button", "Run"),
34
-          fluidRow(
35
-            column(12,
36
-                   HTML("<br>"),
37
-                   downloadUI("download"),
38
-                   closeBtnUI("close")
39
-                   )
40
-            )
41
-          )
42
-      ))
11
+  dashboardSidebar(
12
+    tags$head(
13
+      tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
43 14
     ),
44
-    mainPanel(width=6,
45
-              tabsetPanel(id = "Panels", type="tabs",
46
-                          tabPanel("Samples",
47
-                                   textOutput("errorsGsva"),
48
-                                   htmlOutput("text1"),
49
-                                   plot1_UI("plot1"),
50
-                                   tableOutput("result")
51
-                                   ),
52
-                          tabPanel("GeneSets",
53
-                                   uiOutput("text2"),
54
-                                   htmlOutput("text3"),
55
-                                   plot2_UI("plot2"),
56
-                                   plot3_UI("plot3")
57
-                          ),
58
-                          tabPanel("Session Info",
59
-                                   verbatimTextOutput("sessionInfo"))
60
-              )
15
+    fluidRow(
16
+      column(
17
+        width = 12,
18
+        align = "center",
19
+        h3("Data Input", style="font-weight: bold")
20
+      )
61 21
     ),
62
-    argumentsDataUI("argumentsInput")
22
+    # h3("Data input"),
23
+    matrixUI("matrix1"),
24
+    br(),
25
+    geneSetsUI("genes1"),
26
+    br(),
27
+    radioButtons("arg", "Change default settings:",
28
+                 c("No" = "no",
29
+                   "Yes" = "yes")),
30
+    br(),
31
+    fluidRow(
32
+      actionButton("button", "Run"),
33
+      downloadUI("download"),
34
+      closeBtnUI("close"),
35
+    )
36
+  ),
37
+  
38
+  dashboardBody(
39
+    shinyjs::useShinyjs(),
40
+    add_busy_spinner(spin = "double-bounce", position = "bottom-right",
41
+                     height = "100px", width = "100px"),
42
+    fluidRow(
43
+      box(
44
+        width = 9,
45
+        tabsetPanel(id = "Panels", type="tabs",
46
+                    tabPanel("Samples",
47
+                             textOutput("errorsGsva"),
48
+                             htmlOutput("text1"),
49
+                             plot1_UI("plot1"),
50
+                             tableOutput("result")
51
+                    ),
52
+                    tabPanel("GeneSets",
53
+                             uiOutput("text2"),
54
+                             htmlOutput("text3"),
55
+                             plot2_UI("plot2"),
56
+                             plot3_UI("plot3")
57
+                    ),
58
+                    tabPanel("Session Info",
59
+                             verbatimTextOutput("sessionInfo"))
60
+        )
61
+      ),
62
+      box(
63
+        width = 3,
64
+        argumentsDataUI("argumentsInput")
65
+      )
66
+    )
63 67
   )
68
+  
64 69
 )
... ...
@@ -10,4 +10,29 @@ font-weight: bold;
10 10
 #app_title {
11 11
   color: white;
12 12
   font-weight: bold;
13
-}
14 13
\ No newline at end of file
14
+  font-size: 30px;
15
+}
16
+
17
+.left-side, .main-sidebar {
18
+  padding-top: 75px;
19
+}
20
+
21
+.main-header {
22
+  max-height: 75px;
23
+  }
24
+
25
+.main-header .logo {
26
+  height: 75px;
27
+  
28
+}
29
+
30
+
31
+/**
32
+.main-header {
33
+  max-height: 75px;
34
+}
35
+
36
+.main-header .logo {
37
+  max-height: 75px;
38
+}
39
+**/
15 40
\ No newline at end of file