-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
299 lines (263 loc) · 13.7 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
library(arrow)
library(bslib)
library(DT)
library(dplyr)
library(ggplot2)
library(ggpubr)
library(gridExtra)
library(IsoformSwitchAnalyzeR)
library(patchwork)
library(plotly)
library(purrr)
library(reshape2)
library(shiny)
library(shinycssloaders)
library(shinydashboard)
library(shinyjs)
library(shinyWidgets)
library(stringr)
library(summaryBox)
library(tidyr)
# Bootstrap 4
theme <- bslib::bs_theme(version = 4)
# Set directory to the src directory of the app so that the path
# is correctly resolved later (otherwise they won't be found)
setwd(getSrcDirectory(function(){})[1])
# Source all modules
source("./module_search.R")
source("./module_boxplot.R")
source("./module_barplot.R")
source("./module_filters.R")
source("./module_volcano.R")
source("./module_statbox.R")
source("./module_switchplot.R")
# Ui
ui <- page_navbar(
# Set up shinyjs to use its functions
# (e.g. hide, show, toggle)
useShinyjs(),
id = "navbar",
title = "Resist Portal",
bg = "#70b684",
inverse = TRUE,
nav_panel(title = "Summary",
p(
HTML(
paste(
"Resist Portal is an R shiny application developed to visualize data from the lncRNA Resist Project. Samples, coming from 4 cancers, have been analysed by long-read sequencing (nanopore technology). Resist Portal provides an overview of lncRNA resist analysis in terms of expression (tpm) and differential analysis at gene and transcript levels for a specific gene.<br><br>",
"Conditions are the following:",
gsub("- ", "<br>- ", "- 4 cell lines: Melanoma, Glioblastoma, Lung Cancer, Prostate Cancer - 2 condtions: resistant and sensitive to treatment - triplicates - cdna and drna protocoles (only cdna results shown)"),
sep = ""
)
)
),
# Image of experimental design
HTML('<center><img(src = "experimental_design.png", alt = "Experimental Design", width = "50%", height = "auto"></center>'),
# Search bar
searchBarUI("searchBar1", "submit_btn", "reset_btn"),
# Main summary table
DTOutput(outputId = "SummaryTable") %>% withSpinner(), # withSpinner() display a loading spinner while the dataframe is not on screen
# download table
downloadButton("downloadSummary", "Download Summary Table"),
# UCSC link
uiOutput("UCSClink")
),
nav_panel(title = "Count",
p(""),
# Write which gene is currently selected at the top of the page
uiOutput("SelectedGeneTextCount"),
# Search bar
searchBarUI("searchBar2", "submit_btn", "reset_btn"),
p("Expressions are normalized based on TPM (transcripts per million)."),
tabsetPanel(id = "TabsetCount",
tabPanel(title = "All",
# Count table
DTOutput(outputId = "CountTableFull") %>% withSpinner()
),
tabPanel(title = "Query Gene Level",
# Count table
DTOutput(outputId = "CountTable") %>% withSpinner(),
# Boxplot
boxplotUI(id = "boxplotGene")),
tabPanel(title = "Query Transcript Level",
# Count table + Barplot
DTOutput(outputId = "CountTableTx") %>% withSpinner(),
barplotUI(id = "barplotTX") %>% withSpinner(),
# Boxplot
boxplotUI(id = "boxplotTX")
)
)
),
nav_panel(title = "DGE",
p(""),
# Write which gene is currently selected at the top of the page
uiOutput("SelectedGeneTextDGE"),
tabsetPanel(id= "TabsetDGE",
tabPanel(title = "All",
p(""),
# Search bar + Filter box
fluidRow(
column(width = 6, align = "center",
filtersBoxUI("filtersDGE", Dtype = "DE")
),
column(width = 6, align = "center",
searchBarUI("searchBar3", "submit_btn", "reset_btn"),
# Box test
statboxUI("statboxDGEAll")
)
),
# DGE table All
DTOutput(outputId = "DGETableAll") %>% withSpinner(),
# download table
downloadButton("downloadDGEall", "Download all DGE Table")
),
tabPanel(title = "Query",
p(""),
# Search bar + a slider for padj threshold
fluidRow(
column(6, align = "right",
sliderTextInput(inputId = "padj_threshold_DGEQuery",
label = "padj Threshold:",
choices = c(0.01, 0.05, "NONE"),
selected = "NONE",
grid = TRUE)
),
column(6, align = "left",
searchBarUI("searchBar4", "submit_btn", "reset_btn"))
),
# Box test
statboxUI("statboxDGEQuery"),
# DGE table Query
DTOutput(outputId = "DGETableQuery") %>% withSpinner(),
# Volcano plot
volcanoUI("volcanoDGE"),
# Text to explain that volcano plot points are stopped when they are above a certain limit
uiOutput("volcanoTextDGE"),
# barplot of count data for DGE to see difference in expression
boxplotUI(id = "boxplotDGE")
)
)
),
nav_panel(title = "DTE",
p(""),
# Write which gene is currently selected at the top of the page
uiOutput("SelectedGeneTextDTE"),
tabsetPanel(id = "TabsetDTE",
tabPanel(title = "All",
# Search bar + Filter box
fluidRow(
column(width = 6, align = "center",
filtersBoxUI("filtersDTE", Dtype = "DE")
),
column(width = 6, align = "center",
searchBarUI("searchBar5", "submit_btn", "reset_btn"))
),
# DTE table
DTOutput(outputId = "DTETableAll") %>% withSpinner(),
# download table
downloadButton("downloadDTEall", "Download all DTE Table")
),
tabPanel(title = "Query",
p(""),
# Search bar + a slider for padj threshold
fluidRow(
column(6, align = "right",
sliderTextInput(inputId = "padj_threshold_DTEQuery",
label = "padj Threshold:",
choices = c(0.01, 0.05, "NONE"),
selected = "NONE",
grid = TRUE)
),
column(6, align = "left",
searchBarUI("searchBar6", "submit_btn", "reset_btn"))
),
# Box test
#statboxUI("statboxDTEQuery"),
# DGE table Query
DTOutput(outputId = "DTETableQuery") %>% withSpinner(),
# download table
downloadButton("downloadDTEquery", "Download query DTE Table"),
# Volcano plot
volcanoUI("volcanoDTE"),
# Text to explain that volcano plot points are stopped when they are above a certain limit
uiOutput("volcanoTextDTE")
)
)
),
nav_panel(title = "DTU",
p(""),
# Write which gene is currently selected at the top of the page
uiOutput("SelectedGeneTextDTU"),
tabsetPanel(id= "TabsetDTU",
tabPanel(title = "All",
# Search bar + Filter box
fluidRow(
column(width = 6, align = "center",
filtersBoxUI("filtersDTU", Dtype = "DU")
),
column(width = 6, align = "center",
searchBarUI("searchBar7", "submit_btn", "reset_btn"))
),
# DTU table
DTOutput(outputId = "DTUTableAll") %>% withSpinner(),
# download table
downloadButton("downloadDTUall", "Download all DTU Table")
),
tabPanel(title = "Query",
p(""),
fluidRow(
column(width = 12, align = "center",
searchBarUI("searchBar8", "submit_btn", "reset_btn"))
),
# DTU table
DTOutput(outputId = "DTUTableQuery") %>% withSpinner(),
# download table
downloadButton("downloadDTUquery", "Download query DTU Table"),
# switch plot
switchPlotUI(id = "switchplot") %>% withSpinner()
)
)
),
#Create glowing effect
tags$head(
tags$style(HTML(
"@keyframes glowing {
0% { background-color: #EA7D36; box-shadow: 0 0 0 #FEE2CF; color: #FFFFFF}
10% { background-color: #EA7D36; box-shadow: 0 0 0 #FEE2CF; color: #FFFFFF}
20% { background-color: #EA7D36; box-shadow: 0 0 0 #FEE2CF; color: #FFFFFF}
30% { background-color: #EA7D36; box-shadow: 0 0 0 #FEE2CF; color: #FFFFFF}
40% { background-color: #EA7D36; box-shadow: 0 0 10px #FEE2CF; color: #FFFFFF}
50% { background-color: #EA7D36; box-shadow: 0 0 25px #FEE2CF; color: #FFFFFF}
60% { background-color: #EA7D36; box-shadow: 0 0 40px #FEE2CF; color: #FFFFFF}
70% { background-color: #EA7D36; box-shadow: 0 0 25px #FEE2CF; color: #FFFFFF}
80% { background-color: #EA7D36; box-shadow: 0 0 10px #FEE2CF; color: #FFFFFF}
90% { background-color: #EA7D36; box-shadow: 0 0 0 #FEE2CF; color: #FFFFFF}
100% { background-color: #EA7D36; box-shadow: 0 0 0 #FEE2CF; color: #FFFFFF}
}"
))),
nav_spacer(),
nav_item(
actionButton(
inputId = "dRNAButton",
label = "dRNA",
icon = icon("fas fa-dna"),
style = "animation: glowing 2000ms infinite;"
)
),
nav_item(
actionButton(
inputId = "infoButton",
label = "Info",
icon = icon("info-circle"),
style = "background-color: white; color: #70b684; border: none;"
)
),
nav_menu(
title = "Links",
align = "right",
nav_item(tags$a("GitHub", href = "https://github.com/IGDRion/Resist_Portal", target = "_blank")),
nav_item(tags$a("Shiny", href = "https://shiny.posit.co", target = "_blank")),
nav_item(tags$a("DESeq2", href = "https://www.bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html", target = "_blank")),
nav_item(tags$a("ISA", href = "https://bioconductor.org/packages/devel/bioc/vignettes/IsoformSwitchAnalyzeR/inst/doc/IsoformSwitchAnalyzeR.html", target = "_blank"))
)
)