forked from apratap/PCBC_DataExplorer_ShinyApp
-
Notifications
You must be signed in to change notification settings - Fork 5
/
ui.R
executable file
·201 lines (161 loc) · 9.02 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
meth_data_notes <- '<pre>Data Processing Notes:<br>Methylation probes with variation > .01 across all samples were choosen from the normalized data matrix(<a href="https://www.synapse.org/#!Synapse:syn2233188" target="_blank">syn223318</a>). The probes were selected based on genes using a mapping file.(<a href="https://www.synapse.org/#!Synapse:syn2324928" target="_blank">syn2324928</span></a>). Hierarchical clustering was used to cluster rows and columns.</pre>'
#2. mRNA data notes
mRNA_data_notes <- 'Data Processing Notes:<br>Using mRNA normalized data matrix from <a href="https://www.synapse.org/#!Synapse:syn2701943" target="_blank">syn2701943</a> and metadata from <a href="https://www.synapse.org/#!Synapse:syn2731147" target="_blank">syn2731147</a>. Hierarchical clustering was used to cluster rows and columns.'
#3. miRNA data notes
miRNA_data_notes <- 'Data Processing Notes:<br>Using miRNA normalized data matrix from <a href="https://www.synapse.org/#!Synapse:syn2701942" target="_blank">syn2701942</a> and metadata from <a href="https://www.synapse.org/#!Synapse:syn2731149" target="_blank">syn2731149</a>. The miRNAs were selected based on target genes using a mapping file <a href="https://www.synapse.org/#!Synapse:syn2246991" target="_blank">syn2246991</a>. Hierarchical clustering was used to cluster rows and columns.'
#main UI code
# 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(shinydashboard)
library(DT)
myHeader <- dashboardHeader(title="PCBC Data Explorer", disable=TRUE)
mySidebar <- dashboardSidebar(disable=TRUE)
myBody <-dashboardBody(
tags$head(
singleton(
includeScript("www/readCookie.js")
)
),
fluidRow(
column(width = 9,
# Sample filtering
fluidRow(height=3,
column(width = 9,
box(width=NULL, solidHeader=TRUE, status="primary",
title = tagList(shiny::icon("filter", lib = "glyphicon"), "Filter samples"),
uiOutput("filters")
)
),
column(width = 3,
# Choose sample labels
box(width=NULL, status='primary', collapsible=TRUE,
collapsed=FALSE, solidHeader=TRUE,
title = tagList(shiny::icon("th-list", lib="glyphicon"),
"Label samples"),
uiOutput('heatmapannotation')
),
# Information on number of features/samples selected
infoBoxOutput("featxsamples", width=NULL)
)
),
# Main plot area
box(width = NULL, solidHeader = TRUE,
conditionalPanel("input.show_dt",
DT::dataTableOutput('infotbl')),
conditionalPanel("!input.show_dt",
plotOutput("heatmap", height = 650))
)
),
column(width = 3,
# Plot selection box
box(width = NULL, status = "primary", solidHeader=TRUE,
title="Select features to display",
selectInput("custom_search",
label="Select feature type", #h6(""),
choices=c("Gene", "Pathway", "miRNA", "Methylation"),
selectize=T, multiple=F, selected="mRNA"),
htmlOutput('datasourceui'),
hr(),
uiOutput("featureui"),
hr(),
uiOutput("plotdisplayui"),
hr(),
checkboxInput('show_dt', 'Show data values instead of heatmap', value = FALSE)
#uiOutput("plotHelp")
),
# Correlation box
box(width = NULL, status = "warning", solidHeader=TRUE,
collapsible=TRUE, collapsed=FALSE,
title = tagList(shiny::icon("plus-sign", lib="glyphicon"), "Add correlated features"),
conditionalPanel('input.plotdisplay != "mRNA"',
"Not available."),
conditionalPanel('input.plotdisplay == "mRNA"',
checkboxInput('incl_corr_genes',
'also include correlated genes',
value = FALSE),
conditionalPanel(
condition="input.incl_corr_genes",
p(class = "text-info",
br(),
"Add features with expression pattern correlated with selected features."),
sliderInput('corr_threshold', label=h6('Correlation Threshold'),
min=0.5, max=1.0, value=0.9, step=0.05),
# correlation direction
selectInput("correlation_direction",
label=h6("Correlation Direction"),
choices=c("both", "positive", "negative"),
selectize=T, multiple=F, selected="both")
)
)
),
# Clustering box
box(width = NULL, status = "warning", solidHeader=TRUE,
collapsible=TRUE, collapsed=TRUE,
title = tagList(shiny::icon("wrench", lib="glyphicon"), "Change cluster options"),
#distance metric
selectInput("clustering_distance", "Distance Calculation",
choices=c("correlation", "euclidean", "maximum",
"manhattan", "canberra", "binary", "minkowski"),
selectize=T, multiple=F, selected="euclidean"),
# set the clustering method
selectInput("clustering_method", "Clustering Method",
choices=c("ward", "single", "complete", "average",
"mcquitty", "median", "centroid"),
selectize=T, multiple=F, selected="average"),
checkboxInput('cluster_cols', 'Cluster the columns', value = TRUE),
checkboxInput('cluster_rows', 'Cluster the rows', value = TRUE)
),
# Download box
box(width=NULL, status = 'info', solidHeader=TRUE,
collapsible=TRUE, collapsed=FALSE,
title = tagList(shiny::icon("save", lib = "glyphicon"), "Download data"),
selectInput("savetype",
label=h6("Save as:"),
choices=c("comma separated (CSV)", "tab separated (TSV)"),
selectize=F, multiple=F, selected="comma separated (CSV)"),
downloadButton(outputId='download_data', label='Download')
),
box(width=NULL, status = 'info',
solidHeader=FALSE,
# collapsible=TRUE, collapsed=TRUE,
# title = tagList(shiny::icon("send", lib = "glyphicon"), "ToppGene"),
htmlOutput("toppgene_linkOut")
)
)
)
)
dashboardPage(header=myHeader, sidebar=mySidebar, body=myBody,
skin = "blue")
# tags$textarea(id="custom_gene_list",
# rows=8, cols=50,
# paste0(sample_gene_list, collapse=', ')),
#
#
# h5('1.b. Add miRNA Targets (mirbase ids):'),
# tags$textarea(id="custom_miRNA_list",rows=4,cols=50),
#
# actionButton("custom_search", h4("Update")),
# value='custom_gene_list'
#
# # TAB PANEL 2 : select a pathway
# selectInput("selected_pathways",
# h5("1.a. Select Pathway/s"),
# choices = names(pathways_list),
# selectize=T, multiple=T, width='400px',
# selected = names(pathways_list)[c(1:2)])
#
# #Main shiny panel
# plotOutput("mRNA_heatMap",height="700px",width="auto",hoverId=NULL),
# htmlOutput("topgene_linkOut"),
# downloadButton('download_mRNAData','Download mRNA expression data'),
# HTML(mRNA_data_notes)
# plotOutput("microRNA_heatMap",height="700px",width="auto",hoverId=NULL),
# downloadButton('download_miRNAData','Download microRNA expression data'),
# HTML(miRNA_data_notes)
#
# plotOutput("methylation_heatMap",height="700px",width="auto",hoverId=NULL),
# downloadButton('download_methylationData','Download methylation data'),
# HTML(meth_data_notes)