-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathui.R
563 lines (482 loc) · 22.3 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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
###########################################################
# This file contain UI widgets. ##
###########################################################
###########################################################
# Umap plotting ##
###########################################################
umap_panel <- tabPanel(id="umap_panel",
titlePanel(h5("scClusters")),
sidebarPanel(
titlePanel(h5('UMAP Name', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
selectizeInput(
'UMAP1_forComparison',
label = 'UMAP 1',
choices = c("Sample","Clusters","Unconstrained","Constrained","Constrained remap"),
selected = "Clusters"
),
selectizeInput(
'UMAP2_forComparison',
label = 'UMAP 2',
choices = c("Clusters","Sample","Unconstrained","Constrained","Constrained remap"),
selected = "Sample"
),
hr(style = "border-color: grey"),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("UMAP1_plot_width", "Width", min = 0, max = 250, value = 8),
numericInput("UMAP1_plot_height", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_download_UMAP1',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "download_UMAP1", label = "Download UMAP 1"),
hr(style = "border-color: grey"),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("UMAP2_plot_width", "Width", min = 0, max = 250, value = 8),
numericInput("UMAP2_plot_height", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_download_UMAP2',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "download_UMAP2", label = "Download UMAP 2"),
),
mainPanel(
fluidRow(h5("Dimension Reduction scClusters UMAPs"
)),
fluidRow(helpText("Users can view and compare side-by-side UMAPs' representing identified scATAC-seq clusters,
origin of sample, unconstrained and constrained integration with scRNA-seq datasets, and integrated remapped clusters.", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
fluidRow(
column(6,plotOutput("UMAP_plot_1")), ##%>% withSpinner(color="#0dc5c1")
column(6,plotOutput("UMAP_plot_2"))
)
)
)
###########################################################
# Plot Browser:scATAC Clusters ##
###########################################################
scATACbrowser_panel <- tabPanel(
titlePanel(h5("scATAC-seq peak browser")),
sidebarPanel(
titlePanel(h5('Gene Name', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
actionButton(inputId = "restartButton", label = "Plot Track", icon = icon("play-circle")),
selectizeInput(
'gene_name',
label = 'Gene Name',
choices = sort(gene_names),
selected = sort(sort(gene_names))[1]
),
selectizeInput(
'group_by',
label = 'Group By',
choices = c('Clusters','Sample'),
selected = 'Clusters'
),
sliderInput("range", "Distance From Center (kb):", min = -250, max = 250, value = c(-50,50)),
splitLayout(cellWidths = c("50%","50%"),
numericInput("range_min", "Distance (-kb):", min = -250, max = 250, value = -50),
numericInput("range_max", "Distance (+kb):", min = -250, max = 250, value = 50)
),
splitLayout(cellWidths = c("50%","50%"),
numericInput("tile_size", "TileSize:", min = 10, max = 5000, value = 250),
numericInput("ymax", "Y-Max (0,1):", min = 0, max = 1, value = 0.99)
),
hr(style = "border-color: grey"),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("plot_width", "Width", min = 0, max = 250, value = 8),
numericInput("plot_height", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_download_peakBrowser',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "down", label = "Download"),
),
mainPanel(fluidRow(h5("Peak browser of scATAC-seq clusters"
)),
fluidRow(helpText("Users can view and compare the single-cell chromatin accessibility data in scalable peak browser view along with co-accessibility of peaks on scATAC-seq modality.", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
plotOutput("browser_atacClusters")
)
)
###########################################################
# Peak2GeneLinks:BrowserView ##
###########################################################
peak2gl_panel <- tabPanel(
titlePanel(h5("Peak2GeneLinks")),
sidebarPanel(
titlePanel(h5('Gene Name', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
actionButton(inputId = "restartButton_1", label = "Plot Track", icon = icon("play-circle")),
selectizeInput(
'gene_name_1',
label = 'Gene Name',
choices = sort(gene_names),
selected = sort(gene_names)[1]
),
sliderInput("range_1", "Distance From Center (kb):", min = -250, max = 250, value = c(-50,50)),
splitLayout(cellWidths = c("50%","50%"),
numericInput("range_min_1", "Distance (-kb):", min = -250, max = 250, value = -50),
numericInput("range_max_1", "Distance (+kb):", min = -250, max = 250, value = 50)
),
splitLayout(cellWidths = c("50%","50%"),
numericInput("tile_size_1", "TileSize:", min = 10, max = 5000, value = 250),
numericInput("ymax_1", "Y-Max (0,1):", min = 0, max = 1, value = 0.99)
),
hr(style = "border-color: grey"),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("plot_width_1", "Width", min = 0, max = 250, value = 8),
numericInput("plot_height_1", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_download_peak2GeneLink',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "down_1", label = "Download"),
),
mainPanel
(fluidRow(h5("Browser view of Peak2GeneLinks"
)),
fluidRow(helpText("User can visualize genome accessibility tracks of marker genes with peak co-accessibility", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
plotOutput("co_access_peaks")
)
)
###########################################################
# Feature comparison:UMAP plot ##
###########################################################
feature_comparison_panel <- tabPanel(
titlePanel(h5("Feature of interest UMAPs")),
sidebarPanel(
titlePanel(h5('Feature Name', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
actionButton(inputId = "gene_to_gene_restartButton", label = "Plot", icon = icon("play-circle")),
selectizeInput(
'matrix_forComparison',
label = 'Matrix Type',
choices = c("GeneScoreMatrix","GeneIntegrationMatrix","MotifMatrix"),
selected = "GeneScoreMatrix"
),
selectizeInput(
'gene_forComparison_1',
label = 'Feature Name 1',
choices = "",
selected = NULL
),
selectizeInput(
'gene_forComparison_2',
label = 'Feature Name 2',
choices = "",
selected = NULL
),
hr(style = "border-color: grey"),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("gene_Comparison_plot_width", "Width", min = 0, max = 250, value = 8),
numericInput("gene_Comparison_plot_height", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_download_feature_comparison',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "download_feature_comparison", label = "Download"),
hr(style = "border-color: grey"),
selectizeInput(
'motif_for_motifPos',
label = 'Download Motif Position',
choices = sort(motifMatrix_dropdown),
selected = sort(motifMatrix_dropdown)[1]
),
downloadButton(outputId = "download_motifPos", label = "Download"),
),
mainPanel
(
fluidRow(h5("Feature of interest : Dimensionality Reduction UMAPs"
)),
fluidRow(helpText("Users can view and compare side-by-side UMAPs representing features of interest in GeneScoreMatrix, GeneIntegrationMatrix or MotifMatrix with a representative sequence logo. Download list of Motif Positions. ", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
plotOutput("feature_comparison"))
)
##########################################################
# Motif footprinting plot ##
##########################################################
motif_Footprinting_panel<- tabPanel(
titlePanel(h5("TF Footprinting")),
sidebarPanel(
titlePanel(h5('Gene ', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
actionButton(inputId = "plotFootprints_button", label = "Plot Footprints", icon = icon("play-circle")),
selectizeInput(
'motifName_input',
label = 'Motif Name',
choices = sort(names(motifPositions)),
selected = NULL,
options = list(maxItems = 1)
),
selectizeInput(
'normMethod_Input',
label = 'Normalization Method',
choices = c('None','Divide',"Subtract"),
selected = 'Subtract'
),
splitLayout(cellWidths = c("30%","30%","40"),
numericInput("motif_plot_width_1", "Width", min = 0, max = 250, value = 8),
numericInput("motif_plot_height_1", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_download_motif_down_1',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
hr(style = "border-color: grey"),
downloadButton(outputId = "motif_down_1", label = "Download"),
),
mainPanel(
fluidRow(h5("TF Footprinting"
)),
fluidRow(helpText("Users can view Tn5 bias-adjusted TF footprints for identified transcription factor motifs of interest.", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
plotOutput("motifPlot")
)
)
###########################################################
# Trajectory Heatmap plot ##
###########################################################
traj_heatmap_panel <- tabPanel(
titlePanel(h5("Pseudotime trajectories")),
sidebarPanel(
titlePanel(h5('Pseudotime heatmaps ', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
actionButton(inputId = "plotheat_traj_button", label = "Plot Heatmaps", icon = icon("play-circle")),
selectizeInput(
'matrix_forTraj1',
label = 'Matrix Type',
choices = c("GeneScoreMatrix","GeneIntegrationMatrix","MotifMatrix","PeakMatrix"),
selected = "GeneScoreMatrix"
),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("matrix_forTraj_width", "Width", min = 0, max = 250, value = 8),
numericInput("matrix_forTraj_height", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_down_heatmap_traj1',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "down_heatmap_traj1", label = "Download"),
hr(style = "border-color: grey"),
selectizeInput(
'matrix_forTraj2',
label = 'Matrix Type',
choices = c("GeneScoreMatrix","GeneIntegrationMatrix","MotifMatrix","PeakMatrix"),
selected = "GeneIntegrationMatrix"
),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("matrix_forTraj_width2", "Width", min = 0, max = 250, value = 8),
numericInput("matrix_forTraj_height2", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_down_heatmap_traj2',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "down_heatmap_traj2", label = "Download"),
#downloadButton(outputId = "download_UMAP11", label = "Download UMAP 1"),
),
mainPanel(
fluidRow(h5("ArchR defined trajectory heatmaps"
)),
fluidRow(helpText("Users can visualize heatmaps from ArchR defined trajectory analysis on four different computed matrices. ", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
fluidRow(
column(5,
plotOutput("traj_heatmap1")),
column(2,offset=0),
column(5,
plotOutput("traj_heatmap2")),
)
)
)
###########################################################
# peak2genelink Heatmap plot ##
###########################################################
peak2GLheatmap_panel <- tabPanel(
titlePanel(h5("Peak2GeneLink heatmaps")),
sidebarPanel(
titlePanel(h5('Peak2GeneLink heatmaps', align = 'center')),
width = 3,
h4(''),
hr(style = "border-color: grey"),
actionButton(inputId = "heatmap_peak2gl", label = "Plot Heatmap", icon = icon("play-circle")),
hr(style = "border-color: grey"),
splitLayout(cellWidths = c("30%","30%","40%"),
numericInput("p2g_plot_width_1", "Width", min = 0, max = 250, value = 8),
numericInput("p2g_plot_height_1", "Height", min = 0, max = 250, value = 12),
selectizeInput(
'plot_choice_down_heatmap_p2g',
label = "Format",
choices = c(".pdf",".png",".tiff"),
selected = ".pdf"),
tags$head(tags$style(HTML("
.shiny-split-layout > div {
overflow: visible;}")))
),
downloadButton(outputId = "heatmap_p2g", label = "Download"),
),
mainPanel(
fluidRow(h5("Peak2GeneLinks heatmaps"
)),
fluidRow(helpText("Users can view Peak2GeneLinks identified across the dataset with ArchR. ", style = "font-family: 'Helvetica Now Display Bold'; font-si20pt"),
),
fluidRow(
column(1,offset=2),
column(10,
plotOutput("heatmap_peak_to_gene")),
)
)
)
#Users can view and compare putative cis-regulatory elements based on correlated peak
#accessibility and gene expression heatmaps
###########################################################
# about ##
###########################################################
about_panel <- tabPanel(
titlePanel(h5("About")),
# Various tabs.
tabsetPanel(
# General info.
tabPanel(
"Overview",
tags$h3("Scope"),
tags$p(HTML("ShinyArchR.UiO is a user-friendly, integrative open-source Shiny-based web app using R programming for visualization of massive single-cell chromatin accessibility data (scATAC-seq) based on <a href=\"https://www.archrproject.com\" target=\"_blank\">ArchR</a> (Corces et al., 2021).")),
tags$h3("Approach"),
tags$p(HTML(" The ArchR objects saved in folders along with HDF5 formatted Arrow files are used for input in ShinyArchR.UiO.")),
tags$h5("Data Visualization of ShinyArchR.UiO:"),
tags$ul(
tags$li(HTML("scATAC-seq clusters, unconstrained and constrained clusters on integrated reduced dimensions UMAP from ArchR objects")),
tags$li(HTML("Peaks using plot browser tracks on clusters on scATAC-seq modality")),
tags$li(HTML("Peaks2Genelinks tracks on single-cell RNA sequencing (scRNA-seq) integrated data with scATAC-seq using plot browser tracks. The co-accessibility among the genes can be visualized in the bottom panel")),
tags$li(HTML("Heatmaps of pseudo time trajectory")),
tags$li(HTML("Heatmaps of top 50 markers Peak2Genelinks in scATAC-seq and scRNA-seq")),
)
),
# About us .
tabPanel(
"About us ",
tags$h3("Contributions and Citation info"),
tags$p(HTML("ShinyArchR.UiO software is developed at <a href=\"https://www.med.uio.no/cancell/english/groups/chromatin-biology\" target=\"_blank\">Chromatin Biology</a> Lab at <a href=\"https://www.uio.no\" target=\"_blank\">University of Oslo</a>, as an open-source project mainly under the GPL license version 3 (see source code for details).")),
tags$p(HTML("If ShinyArchR.UiO in any way help you in visualizing and sharing your research work such that it warrants a citation, please cite the ShinyArchR.UiO preprint in BioRXiv or the final publication.")),
),
# Contact
tabPanel(
"Contact",
br(),br(),
sidebarPanel(tags$h3("Prof. Dr. Ragnhild Eskeland"),
fluidRow(
column(1,img(src='re.jpeg', align = "left")),
column(3),
column(8,
tags$h4(HTML("Associate Professor")),
tags$h5(HTML("<a href=\"https://www.med.uio.no/imb/personer/vit/ragnhesk/index.html\" target=\"_blank\">Chromatin Biology Group</a>")),
tags$h5(HTML("<a href=\"https://www.uio.no\" target=\"_blank\">University of Oslo</a>")),
tags$h5(HTML("Email : <a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a>")),
)
),
width = 6),
sidebarPanel(tags$h3("Dr. Ankush Sharma"),
fluidRow(
column(1,img(src='as.jpg', align = "left",
height="200px",style="object-fit:contain")),
column(3),
column(7,
tags$h4(HTML("Researcher (Bioinformatics)")),
tags$h5(HTML("Chromatin Biology Group")),
tags$h5(HTML("<a href=\"https://www.uio.no\" target=\"_blank\">University of Oslo</a>")),
tags$h5(HTML("Email : <a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a>")),
)
),
width = 6),
sidebarPanel(tags$h3("Akshay Suhag"),
fluidRow(
column(1,img(src='aa.png', align = "left",
width="150px",style="object-fit:contain")),
column(3),
column(7,
tags$h4(HTML("Doctoral Researcher (Bioinformatics)")),
tags$h5(HTML("<a href=\"https://www.urofun.ch\" target=\"_blank\">Functional Urology Group</a>")),
tags$h5(HTML("<a href=\"https://www.dbmr.unibe.ch/about_us/staff/personenpool_index/akshay_akshay/index_eng.html\" target=\"_blank\">University of Bern</a>")),
tags$h5(HTML("Email : <a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a>")),
)
),
width = 6))
)
)
ui <- shinyUI(fluidPage(
# Use this function somewhere in UI
#add_busy_spinner(spin = "cube-grid", color = "#CCCCCC", onstart = TRUE, height = "65px", width = "65px"),
add_busy_spinner(spin = "radar", color = "#CCCCCC", onstart = TRUE, height = "55px", width = "55px"),
navbarPage(
umap_panel,
scATACbrowser_panel,
peak2gl_panel,
feature_comparison_panel,
#motif_Footprinting_panel,
traj_heatmap_panel,
peak2GLheatmap_panel,
about_panel,
# Application title.
title ="ShinyArchR.UiO",
tags$head(tags$style(".shiny-output-error{color: grey;}"))###showing error in grey color
),
tags$footer(HTML("<p><i>Webpage generated with</i> <a href='https://github.com/EskelandLab/ShinyArchRUiO' target=\"_blank\">ShinyArchr.UiO</a>.</p>"),
align = "left", style = "
position:relative;
bottom:0;
color: black;
padding: 10px;
z-index: 1000;")
)
)