-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathui.R
263 lines (219 loc) · 8.43 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
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This is the user-interface definition for a Shiny web application.
#
library(shiny)
library(shinyjs) # http://deanattali.com/shinyjs/
library(shinyBS) # for tooltips
library(shinycssloaders) # for loader animations
shinyUI(fluidPage(
# Include shinyjs
useShinyjs(),
# Application title
title = "Timecourse Inspector",
sidebarLayout(
sidebarPanel(width = 3,
#Selector for file upload
fileInput(
'inFileLoadNuc',
"Select data file and click Load Data",
accept = c("text/csv",
"text/comma-separated-values,text/plain",
"application/gzip",
"application/bz2"),
),
radioButtons("inRbutLongWide", actionLink("alDataFormat", "Data Format:"), c("Long" = 0, "Wide" = 1), inline = T),
bsAlert("alertAnchorSidePanelDataFormat"),
actionButton("inButLoadNuc", "Load Data"),
actionButton("butReset", "Reset file input"),
actionButton('inDataGen1', 'Synthetic data'),
bsTooltip('inDataGen1', helpText.server[["inDataGen1"]], placement = "top", trigger = "hover", options = NULL),
tags$hr(),
checkboxInput('chBtrajRem', 'Upload tracks to remove'),
bsTooltip('chBtrajRem', helpText.server[["chBtrajRem"]], placement = "top", trigger = "hover", options = NULL),
conditionalPanel(
condition = "input.chBtrajRem",
fileInput(
'inFileLoadTrajRem',
"Select file and click Load Data",
accept = c("text/csv",
"text/comma-separated-values,text/plain",
"application/gzip",
"application/bz2"),
),
actionButton("inButLoadTrajRem", "Load Data")
),
checkboxInput('chBstim', 'Upload stimulation pattern'),
bsTooltip('chBstim', helpText.server[["chBstim"]], placement = "top", trigger = "hover", options = NULL),
conditionalPanel(
condition = "input.chBtrajRem",
fileInput(
'inFileLoadStim',
"Select file and click Load Data",
accept = c("text/csv",
"text/comma-separated-values,text/plain",
"application/gzip",
"application/bz2"),
),
actionButton("inButLoadStim", "Load Data")
),
tags$hr(),
uiOutput('varSelTrackLabel'),
checkboxInput('chBtrackUni', 'Create unique track ID', F),
bsTooltip('chBtrackUni', helpText.server[["chBtrackUni"]], placement = "top", trigger = "hover", options = NULL),
uiOutput('varSelSite'),
checkboxInput('chBgroup', 'Group data', F),
bsTooltip('chBgroup', helpText.server[["chBgroup"]], placement = "top", trigger = "hover", options = NULL),
uiOutput('varSelGroup'),
uiOutput('varSelTime'),
uiOutput('varSelMeas1'),
radioButtons(
'inSelMath', width = '50%',
'Math on 1st and 2nd meas.',
c(
'None' = '',
'Divide' = " / ",
'Sum' = " + ",
'Multiply' = " * ",
'Subtract' = ' - ',
'1 / X' = '1 / '
)
),
bsTooltip('inSelMath', helpText.server[["inSelMath"]], placement = "top", trigger = "hover", options = NULL),
uiOutput('varSelMeas2'),
tags$hr(),
checkboxInput('chBtimeTrim', 'Trim X-axis', FALSE),
bsTooltip('chBtimeTrim', helpText.server[["chBtimeTrim"]], placement = "top", trigger = "hover", options = NULL),
conditionalPanel(
condition = "input.chBtimeTrim",
uiOutput('uiSlTimeTrim')
),
checkboxInput('chBtrajInter', 'Interpolate NAs and missing data', value = F),
bsAlert("alertAnchorSidePanelNAsPresent"),
bsTooltip('chBtrajInter', helpText.server[["chBtrajInter"]], placement = "top", trigger = "hover", options = NULL),
conditionalPanel(
condition = "input.chBtrajInter",
numericInput(
'inSelTimeFreq',
'Interval between 2 time points',
min = 0,
step = 1,
width = '100%',
value = 1
)
),
checkboxInput('chBnorm', 'Normalization', FALSE),
bsTooltip('chBnorm', helpText.server[["chBnorm"]], placement = "top", trigger = "hover", options = NULL),
conditionalPanel(
condition = "input.chBnorm",
# select normalisation method
# - fold-change calculates fold change with respect to the mean
# - z-score calculates z-score of the selected region of the time series
radioButtons(
'rBnormMeth',
label = 'Method',
choices = list('fold-change' = 'mean', 'z-score' = 'z.score'),
width = "40%"
),
bsTooltip('rBnormMeth', helpText.server[["rBnormMeth"]], placement = "top", trigger = "hover", options = NULL),
# slider for selecting normalisation range
uiOutput('uiSlNorm'),
# use robust stats (median instead of mean, mad instead of sd)
checkboxInput('chBnormRobust',
label = 'Robust stats',
FALSE,
width = "40%"),
bsTooltip('chBnormRobust', helpText.server[["chBnormRobust"]], placement = "top", trigger = "hover", options = NULL),
# choose whether normalisation should be calculated for the entire dataset, group, or trajectory
radioButtons('chBnormGroup',
label = 'Grouping',
choices = list('Entire dataset' = 'none', 'Per group' = 'group', 'Per trajectory' = 'id'),
width = "40%"),
bsTooltip('chBnormGroup', helpText.server[["chBnormGroup"]], placement = "top", trigger = "hover", options = NULL)
),
uiOutput('uiChBnormRobust'),
uiOutput('uiChBnormGroup'),
tags$hr(),
downloadButton('downloadDataClean', 'Download processed data'),
bsTooltip('downloadDataClean', helpText.server[["downloadDataClean"]], placement = "top", trigger = "hover", options = NULL)
),
mainPanel(
tabsetPanel(
tabPanel(
"Time series",
h4(
"Plot time series: averages per group or individual"
),
br(),
modSelTrackNoDuplUI('returnTracksNoDupl'),
modSelTrackLenUI('returnTracksLen'),
modSelOutliersUI('returnOutlierIDs'),
tabsetPanel(
tabPanel("Averages",
br(),
selectInput(
"selColPal",
label = "Colour palette",
choices = l.col.pal.dend.2,
selected = 'Tableau 20'
),
modTrajRibbonPlotUI('modTrajRibbon')
),
tabPanel(
"Individual",
br(),
checkboxInput('chBhighlightTraj', 'Highlight trajectories', FALSE),
conditionalPanel(
condition = "input.chBhighlightTraj",
uiOutput('varSelHighlight')
),
br(),
modTrajPlotUI('modTrajPlot')
),
tabPanel(
"Heatmap",
br(),
modPlotHMUI('modPlotHM')
),
tabPanel(
"Power Spectral Density",
br(),
modPSDPlotUI('modPSDPlot')
)
)
),
# scatter plot
tabPanel(
'Scatter',
tabScatterPlotUI('tabScatter')
),
# area under the curve
tabPanel(
"AUC",
tabAUCplotUI('tabAUC')
),
# distributions at time points
tabPanel(
"Distributions",
tabDistPlotUI('tabDistPlot')
),
# hierarchical clustering
tabPanel(
'Hierarchical',
tabClHierUI('tabClHier')
),
# sparse hierarchical clustering package sparcl temporarily unavailable from CRAN
tabPanel(
'Hier. Sparse',
tabClHierSparUI('tabClHierSpar')
),
# cluster validation
tabPanel(
'Validation',
tabClValidUI('tabClValid')
)
))
)
))