-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
230 lines (216 loc) · 10.5 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
library(shiny)
library(plotly)
library(DT)
library(dplyr)
library(tidyr)
library(tibble)
library(magrittr)
library(ggrepel)
library(scales)
library(stringr)
library(shinycssloaders)
options(dplyr.summarise.inform = FALSE)
load("shiny_input.RData")
# Define UI for random distribution app ----
shinyUI(fluidPage(
# App title ----
div(
titlePanel("MetaboExtract"),
style = "
position:fixed;
width:100%;
"
),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
style = "
overflow-y: scroll;
max-height: 90%;
position: fixed;
width: 23%;
margin-top: 60px;
",
# Inlcude help text
checkboxInput(inputId = "help",
label = HTML("<b>Show help text</b>")),
# Input: Select data set
radioButtons("data_set",
label = h3("Select data set"),
choiceNames = list(HTML("Andresen <i>et al.</i>"),
HTML("Gegner <i>et al.</i>")),
choiceValues = list("cells", "organisms"),
selected = c("cells")),
br(),
# Input: Select tissues
uiOutput("tissuesInput"),
br(),
# Input: Select methods
uiOutput("methodsInput"),
uiOutput("bestSelection"),
br(),
# Input: Select metabolite class
selectizeInput("class",
label = h3("Select class"),
choices = unique(input_df_cells$Class),
selected = unique(input_df_cells$Class),
multiple = TRUE,
options = NULL),
actionButton(inputId = "kit_overview",
label = "View classes",
width = "100%",
style = "color: #333333;
background-color: #E2E3E5;
border-color: #CCCBCD"),
br(),
# Select CV
uiOutput("selectCV"),
br(),
# Select LOD
uiOutput("selectLOD"),
# Activation button
br(),
uiOutput("calcInput"),
width = 3
),
# Main panel for displaying outputs ----
mainPanel(
style = "
overflow-y: scroll;
max-height: 90%;
position: fixed;
width: 75%;
margin-left: 25%;
margin-top: 60px;
",
h5("This is a resource to compare different
extraction methods among four tissues for
intracellular metabolic measurements."),
HTML("<h5>Reference: Andresen <i>et al.</i> (2021) Comparison of
extraction methods for intracellular
metabolomics</h5>"),
br(),
HTML("<b>Click \"Show help text\" for more information.</b><br>"),
br(),
# Output: Tabset w/ plot, summary, and table ----
tabsetPanel(type = "tabs",
id = "tabs",
# Tab: Statistics ----
tabPanel("Statistics",
br(),
uiOutput("help.text_met"),
h2("Number of detectable metabolites"),
h4("Number of metabolites across extraction
methods and stratified by class"),
uiOutput("help.text_stat_1"),
plotlyOutput("detec_metabo") %>%
withSpinner(color="#428bca"), # loading spinner
h4("Number of metabolites across extraction
methods and stratified by tissue"),
uiOutput("help.text_stat_2"),
plotlyOutput("sum_detec_metabo", width = "70%") %>%
withSpinner(color="#428bca"),
h2("Coefficient of Variation (CV)"),
h4("Distribution of CVs from technical
triplicates."),
plotlyOutput("CV_dist", width = "70%",
height = "120%") %>%
withSpinner(color="#428bca"),
h4("Variability of CVs"),
plotlyOutput("var_CV", width = "70%") %>%
withSpinner(color="#428bca")),
# Tab: Concentration ----
tabPanel("Concentration",
br(),
h2("Concentration comparison between methods"),
uiOutput("help.text_conc"),
br(),
column(width = 12, tabsetPanel(
type = "tabs",
id = "sub_tabs",
tabPanel("Overview", fluidRow(
h4("Number of metabolites with the highest yield
across extraction methods and stratified
by class."),
plotlyOutput("bar_high_yield") %>%
withSpinner(color="#428bca")
)),
tabPanel("Single view", fluidRow(
h4("Concentrations of single metabolites
measured across extraction methods."),
column(
width = 3,
style = "margin-top: 10px;",
actionButton(inputId = "previous6",
label = tags$strong("Previous 6"),
width = "100%",
style = "color: #fff;
background-color: #337ab7;
border-color: #2e6da4")
),
column(
width = 3,
style = "margin-top: 10px;",
actionButton(inputId = "next6",
label = tags$strong("Next 6"),
width = "100%",
style = "color: #fff;
background-color: #337ab7;
border-color: #2e6da4")
),
column(
width = 6,
uiOutput("plot_numbers")
),
column(
width = 12,
br()
),
column(
width = 12,
uiOutput("box_plots_UI")
)
))
))),
# Tab: Spectra ----
tabPanel("Spectra",
h2("Spectra of concentrations"),
h4("Concentrations measured across tissue types
and methods"),
uiOutput("help.text_spec_1"),
plotOutput("spectra", height = "1000px") %>%
withSpinner(color="#428bca")),
# Tab: Replicates ----
tabPanel("Replicates",
h2("Comparison of Replicates"),
h4("Sum of concentrations show global differences
between replicates"),
uiOutput("help.text_rep_1"),
plotOutput("bar_replicates", width = "60%") %>%
withSpinner(color="#428bca"),
h2("Table"),
dataTableOutput("rep_table") %>%
withSpinner(color="#428bca")),
# Tab: Table ----
tabPanel("Table",
uiOutput("table_title"),
uiOutput("help.text_table_1"),
br(),
dataTableOutput("data_sum_table") %>%
withSpinner(color="#428bca")),
# Tab: Kit Overview ----
tabPanel("Kit Overview",
h2("Classes of Metabolites in Kit"),
h4("The Biocrates MxP 500 Quant Kit can quantify
up to 630 metabolites of different classes."),
plotOutput("pie_chart") %>%
withSpinner(color="#428bca"),
h2("Table"),
h4("List of all metabolites covered."),
dataTableOutput("metabolite_classes") %>%
withSpinner(color="#428bca"))
)
)
)
))