-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathui.R
More file actions
executable file
·246 lines (210 loc) · 7.59 KB
/
ui.R
File metadata and controls
executable file
·246 lines (210 loc) · 7.59 KB
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# Created 3/6/2013 by Daniel Beck
# User interface file for shiny
library(shiny)
plotHeight="600px"
heatmapPlotHeight="1000px"
shinyUI(
pageWithSidebar(
# Application title
headerPanel("Seed"),
tabsetPanel(
tabPanel("Data",
sidebarPanel(
fileInput("metaFilename", "Select metadata file", accept=c('text/csv', 'text/comma-separated-values,text/plain')),
checkboxInput("metaOptions", "Show file options"),
conditionalPanel(
condition = "input.metaOptions == true",
checkboxInput('metaHeader', 'Header', TRUE),
radioButtons('metaSep', 'Separator', c(Comma=',', Semicolon=';', Tab='\t'), ','),
radioButtons('metaQuote', 'Quote', c(None='', 'Double Quote'='"', 'Single Quote'="'"), '"')
),
HTML('<hr>'),
fileInput("microbeFilename", "Select taxa file", accept=c('text/csv', 'text/comma-separated-values,text/plain')),
checkboxInput("microbeOptions", "Show file options"),
conditionalPanel(
condition = "input.microbeOptions == true",
checkboxInput('microbeHeader', 'Header', TRUE),
radioButtons('microbeSep', 'Separator', c(Comma=',', Semicolon=';', Tab='\t'), ','),
radioButtons('microbeQuote', 'Quote', c(None='', 'Double Quote'='"', 'Single Quote'="'"), '"')
),
HTML('<br>'),
selectInput("dataTransform", "Transform data:",
list("None"="none",
"Relative abundance" = "total",
"Presence/absence" = "pa",
"Hellinger" = "hellinger"
)
),
checkboxInput("advancedOptions", "Show advanced options", value=FALSE),
conditionalPanel(
condition = "input.advancedOptions == true",
radioButtons("saveType", "Save plots as:",
list("PDF" = "pdf",
"PNG" = "png")
),
downloadLink('downloadMetaData', 'Download metadata'),
HTML('<br>'),
downloadLink('downloadAbundanceData', 'Download abundance data')
),
HTML('<hr>'),
helpText("Input data must be in two files. The metadata file should include sample information.
The taxa file should include the abundances of the taxa in each sample.
Samples must be in rows."
),
helpText("Note: Diversity indices are calculated using a relative abundance transformation of the original data."),
checkboxInput("loadDemo", "Load a demonstration dataset (Ravel, et al. 2011)", value=FALSE)
),
mainPanel(
tableOutput("viewMetaData"),
tableOutput("viewMicrobeData"),
HTML("<br>"),
helpText("This Venn diagram shows the number of samples in each file.
Only the overlapping samples are retained for use by Seed."
),
plotOutput("vennPlot", height="300px"),
textOutput("dimRawMeta"),
textOutput("dimRawMicrobe"),
textOutput("dimPostMeta"),
textOutput("dimPostMicrobe")
)
),
# histogram
tabPanel("Histogram",
uiOutput("histVariableSelection"),
mainPanel(
plotOutput("histPlot", height=plotHeight)
)
),
# scatterplot
tabPanel("Scatter",
uiOutput("scatterVariableSelection"),
mainPanel(
plotOutput("scatterPlot", height=plotHeight)
)
),
# bar charts
tabPanel("Bar plot",
uiOutput("barVariableSelection"),
mainPanel(
plotOutput("barPlot", height=plotHeight)
)
),
# stacked bar plot
tabPanel("Stacked bar plot",
uiOutput("stackedbarVariableSelection"),
mainPanel(
plotOutput("stackedBarPlot", height=plotHeight)
)
),
# PCoA tab
tabPanel("PCoA",
uiOutput("pcoaVariableSelection"),
mainPanel(
plotOutput("pcoaPlot", height=plotHeight)
)
),
# cluster dendrogram
tabPanel("Cluster",
uiOutput("clusterVariableSelection"),
mainPanel(
tabsetPanel(
id = "clusterTab",
tabPanel("Complete", value="complete",
plotOutput("clusterPlot", height=plotHeight)
),
tabPanel("Subtrees", value="subtree",
plotOutput("clusterGroupPlot", height=plotHeight)
),
tabPanel("Silhouette", value="silhouette",
plotOutput("silhouettePlot", height=plotHeight)
)
)
)
),
# heatmap
tabPanel("Heatmap",
uiOutput("heatmapVariableSelection"),
mainPanel(
plotOutput("heatmapPlot", height=heatmapPlotHeight)
)
),
# wgcna
tabPanel("WGCNA",
uiOutput("wgcnaVariableSelection"),
mainPanel(
tabsetPanel(
id="wgcnaTab",
tabPanel("Dendrogram",
value="ndendrogram",
# textOutput("wgcnaErrorOut"),
plotOutput("dendroPlot", height=plotHeight)
),
tabPanel("Heatmap",
value="nheatmap",
plotOutput("htmpPlot", height=plotHeight)
),
tabPanel("Correlations",
value="ncorrelations",
plotOutput("corPlot", height=plotHeight)
)
)
)
),
# help
tabPanel("Help",
sidebarPanel(
height = 12,
selectInput(
"helpTopic",
"Help topic",
choices=c("About", "Data", "Histogram", "Scatter",
"Bar plot", "Stacked bar plot", "PCoA", "Cluster",
"Heatmap", "WGCNA")
)
),
mainPanel(
conditionalPanel(
condition = "input.helpTopic == 'About'",
includeHTML("./www/help_about.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Data'",
includeHTML("./www/help_data.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Histogram'",
includeHTML("./www/help_histogram.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Scatter'",
includeHTML("./www/help_scatter.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Bar plot'",
includeHTML("./www/help_barplot.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Stacked bar plot'",
includeHTML("./www/help_stackedbarplot.html")
),
conditionalPanel(
condition = "input.helpTopic == 'PCoA'",
includeHTML("./www/help_pcoa.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Cluster'",
includeHTML("./www/help_cluster.html")
),
conditionalPanel(
condition = "input.helpTopic == 'Heatmap'",
includeHTML("./www/help_heatmap.html")
),
conditionalPanel(
condition = "input.helpTopic == 'WGCNA'",
includeHTML("./www/help_wgcna.html")
)
)
)
),
mainPanel()
))