-
Notifications
You must be signed in to change notification settings - Fork 0
/
shinyAppUI.R
216 lines (178 loc) · 8.84 KB
/
shinyAppUI.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
getShinyUI <- function(myDFo, kColNames, sumData, myFeatures) {
all.treats <- (unique(myDFo$treatment))
ids <- colnames(myDFo)
facLevels <- c("treatment","plateID", "dose_uM", "timeID",
"controlID", "replID", "locationID", "control",
"cell_line", "imageID", "plateWellID", "timeAfterExposure", kColNames$parentObjectNumberCN)
sumLevels <- colnames(myDFo)
shinyUI <- shinyUI(
fluidPage(
titlePanel("CellProfiler h5 GUI"),
sidebarLayout(
sidebarPanel(
shiny::tags$style(HTML("
.exit-button {
background-color: #EC644B;
}
")),
shiny::tags$button(
id = 'stopButtonTop',
type = "button",
class = "btn action-button exit-button",
onclick = "setTimeout(function(){window.close();},500);",
'Exit'
),
helpText("Create summary statistics and make
interactive plots of CP generated hdf5 data."),
selectInput("idsChoice",
label = "Choose variables for analysis",
choices = c(colnames(myDFo), colnames(sumData)),
selected = myFeatures[1],
width = "auto",
multiple = TRUE
),
selectInput("summFunChoice",
label = "Summary Function:",
choices = c("mean", "sd", "sum", "median", "q10", "q90","min","max"),
),
selectInput("by.what",
label = "Summary by what:",
choices = sumLevels, #facLevels This is confusing for user as facLevels need not be in data
multiple = TRUE,
selected = c("treatment", "timeID", "dose_uM", "plateID")
),
actionButton("goButton", "Calculate summary"),
selectInput("normalization",
label = "plate normalization method, by display variable:",
choices = c("MinMax", "Median", "Z-Score")
),
textInput("negativeControl",
label= "negative control string for z-score:",
value = ""),
actionButton("goButton9", "normalize plates"),
selectInput("nomiCol",
label = "nominator column:",
choices = colnames(myDFo),
width = "auto"
),
selectInput("denomiCol",
label = "denominator column:",
choices = colnames(myDFo),
width = "auto"
),
sliderInput("kAddDenom",
label = "denominator addition by mean multiplier:",
value = 0,
min = 0,
max = 0.05,
step = 0.001
),
actionButton("goButton3", "Calculate division"),
selectInput("rmCol",
label = "remove column:",
choices = colnames(myDFo),
width = "auto"),
actionButton("goButton2", "remove column!"),
selectInput("filtCol",
label = "column to filter, count or select:",
choices = colnames(myDFo),
width = "auto"),
textInput("opera",
label = "> or < (keep/count):"),
textInput("filtVal",
label = "filter value"),
actionButton("goButton6", "filter column"),
actionButton("goButton8", "count data"),
actionButton("goButton11", "select data"),
checkboxInput("naIsZero", "count NA is zero", value = TRUE),
textInput("ncolName",
label = "new column name",
value = ""
),
textInput("path",
label = "path to Rdata file"),
actionButton("goButton4", "table preview"),
actionButton("goButton5", "update variables"),
actionButton("goButton7", "reload Data"),
actionButton("button10", "show barD"),
#actionButton("goButton9", "NA is zero convert"),
selectInput("dataset", "Choose a dataset:",
choices = c("Single Cell", "Summary Data"),
selected = "Summary Data"),
downloadButton('downloadData', 'Download'),
shiny::tags$button(
id = 'stopButtonBottom',
type = "button",
class = "btn action-button exit-button",
onclick = "setTimeout(function(){window.close();},500);",
'Exit'
)
),
mainPanel(
#SummaryData
tabsetPanel(
tabPanel("Calculate Summary", tableOutput("SummaryData"),
"Normalization (use by what)", tableOutput("tempData")),
# this panel is for very basic choosing a treatment and plotting & serves as template for further functionality
tabPanel("plot", ggvisOutput("gv"),
selectInput("currTreat",
label = "Choose treatment to plot:",
choices = all.treats),
selectInput("xVar",
label = "Choose x-axis variable:",
choices = colnames(sumData),
selected = "timeID"
),
selectInput("yVar",
label = "Choose y-axis variable from summaryData:",
choices = colnames(sumData)
),
selectInput("mapCol",
label = "color mapping:",
choices = colnames(sumData))
),
#This panel is for plotting all treatments in a single pdf.
tabPanel("plotAll",
checkboxGroupInput("plotType", label = "Choose plot type, for multiple variables make sure to map \"variable\\",
choices = c("line plot", "bar plot"),
selected ="line plot"),
selectInput("collapse", label = "AUC collapse (barplot only):",
choices = colnames(sumData)),
selectInput("onXaxis", label = "display on x axis:",
choices = colnames(sumData)),
selectInput("facets", label = "choose facetting variable(s)",
choices = c(" ", "variable", colnames(sumData)),
multiple = TRUE),
selectInput("Color", label ="color mapping",
choices = c( " " ,colnames(sumData),"variable"),
selected = "plateID"
),
selectInput("fill", label ="fill mapping",
choices = c( " " ,colnames(sumData),"variable")
),
selectInput("Shape", label ="shape mapping(only line-plot)",
choices = c( " " , colnames(sumData), "variable")),
selectInput("pointSize", label ="dot size",
choices = c(1:10, colnames(sumData),"variable")),
selectInput("connectDots", label ="connect dots group",
choices = c(" " , colnames(sumData),"variable")),
selectInput("xScales", label ="X-scale",
choices = c("free_x", "fixed"),
selected = "fixed"),
selectInput("yScales", label ="y-scale",
choices = c("free_y", "fixed"),
selected ="fixed"),
textInput("yMin", label = "y min", value = " "),
textInput("yMax", label = "y max", value = " "),
textInput("resX","choose pdf width realistic: between 4 and 50", value = 24),
textInput("resY", "choose pdf height", value = 20),
textInput("textSize", "choose text size", value = 15),
actionButton("goButton12", "make dose levels"),
downloadButton('downloadPlot', 'downloadPlot')
),
tabPanel("myTable preview", tableOutput("myTable"),tableOutput("barD"))
) ##TODO more panels will be included: AUC/bar plots. Binning plots. Tracking plots - add some usefull plots from older code.
)
)
))
}