-
Notifications
You must be signed in to change notification settings - Fork 4
/
ui.R
139 lines (122 loc) · 3.78 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(shiny)
library(shinydashboard)
library(shinyBS)
library(plotly)
library(shinythemes)
library(ggplot2)
library(DT)
library(edgeR)
library(pheatmap)
library(threejs)
library(shinyTree)
library(shinycssloaders)
# this is where the general tabs are defined:
if (file.exists("defaultValues.R")) {
source("defaultValues.R")
}
# input, cell/gene selection tabs
# source('tabs.R', local = TRUE)
source("tabs.R", local = FALSE)
# general tabs
allTabs <- list(
inputTab,
geneSelectionTab,
cellSelectionTab,
generalParametersTab
)
# parameters tab, includes basic normalization
source("parameters.R", local = TRUE)
# Basic menu Items
allMenus <- list(
menuItem("input",
# id="inputID",
tabName = "input", icon = icon("dashboard")),
menuItem("Parametes",
# id="parametersID",
tabName = "parameters", icon = icon("dashboard"), parameterItems),
menuItem("Cell selection",
# id="cellSelectionID",
tabName = "cellSelection", icon = icon("dashboard")),
menuItem("Gene selection",
# id="geneSelectionID",
tabName = "geneSelection", icon = icon("dashboard"))
)
# parse all ui.R files under contributions to include in application
uiFiles <- dir(path = "contributions", pattern = "ui.R", full.names = TRUE, recursive = TRUE)
for (fp in uiFiles) {
menuList <- list()
tabList <- list()
source(fp, local = TRUE)
for (li in menuList) {
if (length(li) > 0) {
# if(DEBUG)cat(file=stderr(), paste("menuList:", length(allMenus)," ", li$children, "\n"))
allMenus[[length(allMenus) + 1 ]] <- li
}
}
for (li in tabList) {
if (length(li) > 0) {
# if(DEBUG)cat(file=stderr(), paste(li$children[[1]], "\n"))
allTabs[[length(allTabs) + 1]] <- li
}
}
}
# todo
# parse all parameters.R files under contributions to include in application
# allTabs holds all tabs regardsless of their location in the GUI
parFiles <- dir(path = "contributions", pattern = "parameters.R", full.names = TRUE, recursive = TRUE)
for (fp in parFiles) {
tabList <- list()
source(fp, local = TRUE)
for (li in tabList) {
if (length(li) > 0) {
# if(DEBUG)cat(file=stderr(), paste(li$children[[1]], "\n"))
allTabs[[length(allTabs) + 1]] <- li
}
}
}
# search for parameter contribution submenu items (menuSubItem)
# parameterContributions = ""
shinyUI(
dashboardPage(
dashboardHeader(title = "scShinyHub"),
dashboardSidebar(
sidebarMenu(
id="sideBarID",
allMenus
),
tipify(
checkboxInput("noStats", "don't display stats", FALSE),
"check this if you are working on the cell/gene selection to avoid certain calculations"
),
tipify(
htmlOutput("summaryStatsSideBar"),
"<h3>Data summary</h3> <ul><li>medium UMI: shows how many genes are expressed in log2 space of normalized data</li> </ul> ", "right"
),
downloadButton("report", "Generate report"),
actionButton("goCalc", "Force Calculations"),
# bookmarkButton(id = "bookmark1"),
tipify(
downloadButton("countscsv", "Download counts.csv"),
"<h3>download current normalized count data as CSV file</h3>"
),
tipify(
downloadButton("RDSsave", "Download Rds"),
"<h3>download current cell/gene configuration for reimport to this app</h3>"
),
checkboxInput("DEBUGSAVE", "Save for DEBUG", FALSE),
verbatimTextOutput("DEBUGSAVEstring")
), # dashboard side bar
dashboardBody(
bsAlert("alert"),
tags$div(
allTabs,
class = "tab-content"
)
) # dashboard body
) # main dashboard
)