-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
2072 lines (2011 loc) · 155 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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
source("help.R", local=TRUE)
library(bsplus)
ui <- dashboardPage(
title="SCALA",
skin = "black",
#------------------------------------------------------------Header
dashboardHeader(
titleWidth = "285px",
title = tags$img(src='logo.png')
),
#------------------------------------------------------------Sidebar
dashboardSidebar(
width = "285px",
sidebarMenu(id = "sidebarMenu",
menuItem(text = "HOME", tabName = "home", icon = icon("home")),
tags$hr(),
menuItem(text = "DATA INPUT", tabName = "upload", icon = icon("upload")),
menuItem(text = "QUALITY CONTROL", tabName = "qc", icon = icon("check-circle")),
menuItem(tags$div("DATA NORMALIZATION",
tags$br(),
"& SCALING", class = "menu_item_div"), tabName = "normalize", icon = icon("balance-scale")),
tags$hr(),
menuItem(text = "PCA/LSI", tabName = "pca", icon = icon("chart-line")),
menuItem(text = "CLUSTERING", tabName = "clustering", icon = icon("project-diagram")),
menuItem(text = "UTILITY OPTIONS", tabName = "utilities", icon = icon("edit")),
menuItem(tags$div("ADDITIONAL DIMENSIONALITY",
tags$br(),
"REDUCTION METHODS", class = "menu_item_div"), tabName = "umap", icon = icon("draw-polygon")),
menuItem(text = "MARKERS' IDENTIFICATION", tabName = "findMarkers", icon = icon("map-marker-alt")),
menuItem(text = "FEATURE INSPECTION", tabName = "features", icon = icon("braille")),
menuItem(text = "DOUBLETS' DETECTION", tabName = "doubletDetection", icon = icon("check-double")),
menuItem(text = "CELL CYCLE PHASE ANALYSIS", tabName = "cellCycle", icon = icon("circle-notch")),
tags$hr(),
menuItem(tags$div("FUNCTIONAL/MOTIF",
tags$br(),
"ENRICHMENT ANALYSIS", class = "menu_item_div"), tabName = "gProfiler", icon=icon("chart-bar")),
menuItem(text = "CLUSTERS' ANNOTATION", tabName = "annotateClusters", icon = icon("id-card")),
menuItem(text = "TRAJECTORY ANALYSIS", tabName = "trajectory", icon = icon("route")),
menuItem(tags$div("LIGAND - RECEPTOR",
tags$br(),
"ANALYSIS", class = "menu_item_div"), tabName = "ligandReceptor", icon = icon("satellite-dish")), #icon("satellite-dish")),
menuItem(tags$div("GENE REGULATORY NETWORK",
tags$br(),
"ANALYSIS", class = "menu_item_div"), tabName = "grn", icon = icon("network-wired")),
menuItem(text = "TRACKS", tabName = "visualizeTracks", icon = icon("compact-disc")),
tags$hr(),
menuItem(text = "Help", tabName = "help", icon = icon("question")),
menuItem(text = "About", tabName = "about", icon = icon("info"))
)
),
#------------------------------------------------------------Body
dashboardBody(
tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "main.css")),
tags$head(tags$link(rel = "stylesheet", type = "text/css", href="loading-bar.css")), # loading bar CSS
tags$head(tags$script(src = "rshiny_handlers.js")), # R to JS
tags$head(tags$script(src = "loading-bar.js")), # loading bar JS
#tags$head(tags$script(src = "sliderfix.js")),
useShinyjs(),
extendShinyjs(text = js.enrich, functions = c("Enrich")),
tabItems(
#home tab
tabItem(tabName = "home",
div(id = "home_div", class = "div_container",
h1(class = "container_title", "Welcome to SCALA"),
HTML("<p class=container_text> SCALA is a web application and stand-alone toolkit, that handles the analysis of scRNA-seq and scATAC-seq datasets,
from quality control and normalization, to dimensionality reduction, differential expression/accessibility analysis, cell clustering, functional enrichment analysis,
trajectory inference, ligand – receptor analysis, gene regulatory network inference, and visualization. Try out our sample data and visit the Help pages for guidance. </p>"
),
)
),
#Upload tab
tabItem(tabName = "upload",
bsCollapse(id = 'countMatrixRNA_collapse', multiple = T,
bsCollapsePanel('Do you need help with the upload of count matrix?', ih_inputCountMatrix_rna, style = 'warning')
),
bsCollapse(id = '10xRNA_collapse', multiple = T,
bsCollapsePanel('Do you need help with the upload of 10x files?', ih_input10x_rna, style = 'warning')
),
bsCollapse(id = 'rdsRNA_collapse', multiple = T,
bsCollapsePanel('Do you need help with the upload of an RDS file?', ih_inputRDS_rna, style = 'warning')
),
bsCollapse(id = 'arrowATAC_collapse', multiple = T,
bsCollapsePanel('Do you need help with the upload of an arrow file?', ih_inputArrow_atac, style = 'warning')
),
fluidRow(
box(
width = 3, status = "info", solidHeader = TRUE,
title = "Upload your data",
tabsetPanel(type = "tabs",
tabPanel("Gene-count matrix (scRNA-seq)",
tags$h3("Load PBMC 10x dataset (example scRNA-seq)", class="h3-example"),
tags$hr(class="hr-example"),
actionButton(inputId = "upload10xExampleRNACountMatrixConfirm", label = "Load example", class="btn-example"),
tags$br(),
tags$h3("OR"),
tags$h3("Upload your file"),
tags$hr(),
textInput(inputId = "uploadCountMatrixprojectID", label = "Project name : ", value = "Project1"),
fileInput(inputId = "countMatrix", label = "1. Genes-Cells count matrix", accept = ".txt"),
sliderInput(inputId = "uploadCountMatrixminCells", label = "Include features detected in at least this many cells :", min = 1, max = 20, value = 3, step = 1),
sliderInput(inputId = "uploadCountMatrixminFeatures", label = "Include cells where at least this many features are detected :", min = 1, max = 1000, value = 200, step = 1),
radioButtons("uploadCountMatrixRadioSpecies", label = h3("Select organism : "),
choices = list("Mus musculus (Mouse)" = "mouse",
"Homo sapiens (Human)" = "human"
),
selected = "mouse"),
actionButton(inputId = "uploadCountMatrixConfirm", label = "Submit", class="btn-run", icon = icon("check-circle")),
tags$h3("Export working object as .RDS file"),
tags$hr(),
downloadButton(outputId = "utilitiesConfirmExport1", label = "Export .RDS"),
),
tabPanel("10x input files (scRNA-seq)",
tags$h3("Load PBMC 10x dataset (example scRNA-seq)", class="h3-example"),
tags$hr(class="hr-example"),
actionButton(inputId = "upload10xExampleRNA10xFilesConfirm", label = "Load example", class="btn-example"),
tags$br(),
tags$h3("OR"),
tags$h3("Upload your files"),
tags$hr(),
textInput(inputId = "upload10xRNAprojectID", label = "Project name : ", value = "Project1"),
fileInput(inputId = "barcodes", label = "1. Choose barcodes.tsv.gz file", accept = ".gz"),
fileInput(inputId = "genes", label = "2. Choose features.tsv.gz file", accept = ".gz"),
fileInput(inputId = "matrix", label = "3. Choose matrix.mtx.gz file", accept = ".gz"),
sliderInput(inputId = "upload10xRNAminCells", label = "Include features detected in at least this many cells :", min = 0, max = 20, value = 3, step = 1),
sliderInput(inputId = "upload10xRNAminFeatures", label = "Include cells where at least this many features are detected :", min = 0, max = 1000, value = 200, step = 1),
radioButtons("upload10xRNARadioSpecies", label = h3("Select organism : "),
choices = list("Mus musculus (Mouse)" = "mouse",
"Homo sapiens (Human)" = "human"
),
selected = "mouse"),
actionButton(inputId = "upload10xRNAConfirm", label = "Submit", class="btn-run", icon = icon("check-circle")),
tags$h3("Export working object as .RDS file"),
tags$hr(),
downloadButton(outputId = "utilitiesConfirmExport2", label = "Export .RDS"),
),
tabPanel("RDS Seurat object input (scRNA-seq)",
fileInput(inputId = "uploadRdsFile", label = "Choose a Seurat object saved in .RDS format", accept = ".RDS"),
radioButtons("uploadRdsRadioSpecies", label = h3("Select organism : "),
choices = list("Mus musculus (Mouse)" = "mouse",
"Homo sapiens (Human)" = "human"
),
selected = "mouse"),
actionButton(inputId = "uploadSeuratRdsConfirm", label = "Load Seurat object", class="btn-run", icon = icon("check-circle")),
tags$br(),
tags$br(),
tags$hr(),
tags$br(),
selectInput("utilitiesActiveAssay", "(Optional) Change active assay:",
c("Assay" = "RNA")),
actionButton(inputId = "utilitiesConfirmChangeAssay", label = "Change assay"),
tags$br(),
tags$h3("Export working object as .RDS file"),
tags$hr(),
downloadButton(outputId = "utilitiesConfirmExport", label = "Export .RDS")
),
tabPanel("Arrow input files (scATAC-seq)",
tags$h3("PBMC 10x dataset (example scATAC-seq)", class="h3-example"),
tags$hr(class="hr-example"),
actionButton(inputId = "upload10xExampleATACConfirm", label = "Load example", class="btn-example"),
tags$br(),
tags$h3("OR"),
tags$h3("Upload your file"),
tags$hr(),
textInput(inputId = "uploadATACprojectID", label = "Project name : ", value = "Project1"),
fileInput(inputId = "uploadATACArrow", label = "Please upload an .arrow file", accept = ".arrow"),
radioButtons("upload10xATACRadioSpecies", label = h3("Select organism and genome version: "),
choices = list("Mus musculus (Mouse) - mm10" = "mm10",
"Homo sapiens (Human) - hg19" = "hg19",
"Homo sapiens (Human) - hg38" = "hg38"
),
selected = "mm10"),
sliderInput(inputId = "upload10xATACThreads", label = "Threads to be used:", min = 1, max = 100, value = 2, step = 1), #max=2 in the online version
actionButton(inputId = "upload10xATACConfirm", label = "Submit", class="btn-run", icon = icon("check-circle"))
)
)
),
box(
width = 8, solidHeader = TRUE, status = "info",
title = "Metadata table",
tabsetPanel(type = "tabs", id = "uploadTabPanel",
tabPanel("scRNA-seq",
dataTableOutput("metadataTable"),
downloadButton(outputId = "uploadMetadataExportRNA", label = "Save table")
),
tabPanel("scATAC-seq",
dataTableOutput("metadataTableATAC"),
downloadButton(outputId = "uploadMetadataExport", label = "Save table")
)
)
)
),
),
#utilities tab
tabItem(tabName = "utilities",
fluidRow(
box(
width = 12, status = "info", solidHeader = TRUE,
title = "Edit/export working object",
tags$h3("Rename cluster"),
tags$hr(),
selectInput(inputId = "utilitiesRenameOldName", label = "Cluster to be renamed (old name):", choices = "-", multiple = F),
textInput(inputId = "utilitiesRenameNewName", label = "New name of the cluster:", value = "New_name_1"),
actionButton(inputId = "utilitiesConfirmRename", label = "Rename", class="btn-run", icon = icon("check-circle")),
tags$h3("Delete cluster"),
tags$hr(),
selectInput(inputId = "utilitiesDeleteCluster", label = "Cluster to be deleted:", choices = "-", multiple = F),
actionButton(inputId = "utilitiesConfirmDelete", label = "Delete", class="btn-run", icon = icon("check-circle")),
tags$h3("Active clusters"),
tags$hr(),
selectInput("utilitiesActiveClusters", "Set active clustering column:",
c("Cluster" = "seurat_clusters")),
actionButton(inputId = "utilitiesConfirmChangeCluster", label = "Change clustering column!", class="btn-run", icon = icon("check-circle")),
tags$h3("Command history"),
tags$hr(),
actionButton(inputId = "utilitiesPlotCommands", label = "View command history!", class="btn-run", icon = icon("check-circle")),
verbatimTextOutput(outputId = "history")
)
)
),
#QC tab
tabItem(tabName = "qc",
bsCollapse(id = 'qcRNA_collapse', multiple = T,
bsCollapsePanel('Do you need help with filtering your data?', ih_qc_rna, style = 'warning')
),
tabsetPanel(type = "tabs", id = "qcTabPanel",
tabPanel("scRNA-seq",
fluidRow(
box(
width = 3, status = "info", solidHeader = TRUE,
title = "Quality control",
tags$h3("1. Display quality control plots before filtering"),
actionButton(inputId = "qcDisplay", label = "Display plots", class="btn-run", icon = icon("check-circle")),
tags$hr(),
tags$h3("2. Filter out low quality cells"),
tags$hr(),
sliderInput(inputId = "minUniqueGenes", label = "Minimum features detected", min = 200, max = 2000, value = 500, step = 1)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Filter out cells that have unique feature counts less than:", placement = "left"
)
),
sliderInput(inputId = "maxUniqueGenes", label = "Maximum features detected", min = 2001, max = 7000, value = 4500, step = 1)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Filter out cells that have unique feature counts over than:", placement = "left"
)
),
sliderInput(inputId = "maxMtReads", label = "Mitochondrial %", min = 1, max = 100, value = 10, step = 1)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Filter out cells that their percentage of genes mapped to mitochondrial genome exceeds:", placement = "left"
)
),
selectInput("qcColorBy", "Color by:",
c("orig.ident" = "orig.ident")),
actionButton(inputId = "qcConfirm", label = "Perform filtering", class="btn-run", icon = icon("check-circle")),
),
box(
width = 9, status = "info", solidHeader = TRUE,
title = "Quality control plots",
tabsetPanel(type="tabs", id = "qc_tabs_rna",
tabPanel("Pre-filtering plots",
column(
div(id="nFeatureViolin_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "nFeatureViolin", height = "100%")
)
), width = 4),
column(
div(id="totalCountsViolin_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "totalCountsViolin", height = "100%")
)
), width = 4),
column(
div(id="mitoViolin_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "mitoViolin", height = "100%")
)
), width = 4),
column(
div(id="genesCounts_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "genesCounts", height= "100%")
)
), width = 6),
column(
div(id="mtCounts_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "mtCounts", height= "100%")
)
), width = 6),
column(verbatimTextOutput(outputId = "cellStats"), width = 4)
),
tabPanel("Post-filtering plots",
column(
div(id="filteredNFeatureViolin_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "filteredNFeatureViolin", height = "100%")
)
), width = 4),
column(
div(id="filteredTotalCountsViolin_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "filteredTotalCountsViolin", height = "100%")
)
), width = 4),
column(
div(id="filteredMitoViolin_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "filteredMitoViolin", height = "100%")
)
), width = 4),
column(
div(id="filteredGenesCounts_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "filteredGenesCounts", height= "100%")
)
), width = 6),
column(
div(id="filteredMtCounts_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "filteredMtCounts", height= "100%")
)
), width = 6),
column(verbatimTextOutput(outputId = "filteredCellStats"), width = 4)
)
)
)
)
),
tabPanel("scATAC-seq",
fluidRow(
box(
width = 3, status = "info", solidHeader = TRUE,
title = "Quality control",
tags$h3("Display soft filtered quality control plots"),
actionButton(inputId = "qcDisplayATAC", label = "Display plot!", class="btn-run", icon = icon("check-circle")),
),
box(
width = 9, status = "info", solidHeader = TRUE,
title = "Quality control plots",
div(
column(
div(id="TSS_plot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "TSS_plot", height = "100%")
)
), width = 4),
column(
div(id="nFrag_plot_loader",
shinycssloaders::withSpinner(
plotOutput(outputId = "nFrag_plot", height = "100%")
)
), width = 4),
column(
div(id="TSS_nFrag_plot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "TSS_nFrag_plot", height = "100%")
)
), width = 4),
column(verbatimTextOutput(outputId = "CellStatsATAC"), width = 5)
)
)
)
)
)
),
#Normalization tab
tabItem(tabName = "normalize",
bsCollapse(id = 'scalingRNA_collapse', multiple = T,
bsCollapsePanel('Do you need help with the regress out functionality?', ih_scaling_rna, style = 'warning')
),
tags$div("Normalization and scaling: estimated time in web server for a scRNA-seq dataset of 6,000 cells ~ 50sec", tags$br(),
"(The execution times were measured in the web version of the tool. However, improved performance can be achieved by using the
stand-alone version on PCs with appropriate CPU and RAM specifications.)",
class="execTimeMessage"),
tags$br(),
fluidRow(
box(
width = 4, status = "info", solidHeader = TRUE,
title = "Normalize and scale the data",
tags$h3("1. Log-normalization"),
tags$hr(),
sliderInput(inputId = "normScaleFactor", label = "Scale factor :", min = 1000, max = 1000000, value = 10000, step = 1000)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "It normalizes the count data per cell and transforms the result to log scale", placement = "left"
)
),
tags$h3("2. Identification of highly variable features"),
tags$hr(),
radioButtons("radioHVG", label = h3("Select one of the following methods : "),
choices = list("Variance Stabilizing Transformation method" = "vst",
"Mean-Variance method" = "mvp",
"Dispersion method" = "disp"),
selected = "vst")%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = paste0("- vst: First, fits a line to the relationship of log(variance) and log(mean) using local polynomial regression (loess). Then standardizes the feature values using the observed mean and expected variance (given by the fitted line). Feature variance is then calculated on the standardized values after clipping to a maximum (see clip.max parameter).\n\n",
"- mean.var.plot (mvp): First, uses a function to calculate average expression (mean.function) and dispersion (dispersion.function) for each feature. Next, divides features into num.bin (deafult 20) bins based on their average expression, and calculates z-scores for dispersion within each bin. The purpose of this is to identify variable features while controlling for the strong relationship between variability and average expression.\n\n",
"- dispersion (disp): selects the genes with the highest dispersion values"), placement = "left"
)
),
sliderInput(inputId = "nHVGs", label = "Number of genes to select as top variable genes (applicable only to the first and third option) :", min = 200, max = 8000, value = 2000, step = 100),
tags$h3("3. Scaling the data"),
tags$hr(),
radioButtons("normalizeScaleGenes", label = h3("Genes to be scaled : "),
choices = list("All genes" = "all_genes",
"Only most variable genes" = "mv_genes"),
selected = "mv_genes"),
tags$br(),
selectInput("normalizeRegressColumns", "Select variables to regress out", list(), selected = NULL, multiple = TRUE, selectize = TRUE, width = NULL, size = NULL)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Scales and centers features in the dataset. If variables are provided in this text input, they are individually regressed against each feature, and the resulting residuals are then scaled and centered. Variables stored in metadata are valid options.\nThis operation is slow when variables are provided in combination with the \"All genes\" option above.", placement = "left"
)
),
actionButton(inputId = "normalizeConfirm", label = "Run Normalization and Scaling process!", class="btn-run", icon = icon("check-circle")),
),
box(
width = 8, status = "info", solidHeader = TRUE,
title = "Highly variable genes",
div(id="hvgScatter_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "hvgScatter", height = "800px")
)
),
column(verbatimTextOutput(outputId = "hvgTop10Stats"), width = 8)
),
)
),
#PCA tab
tabItem(tabName = "pca",
tags$br(),
tags$div("PCA estimated time in web server for a scRNA-seq dataset of 6,000 cells ~ 8sec (quick version), ~25min (slow version)", tags$br(),
"LSI estimated time in web server for a scATAC-seq dataset of 6,000 cells ~ 38 sec", tags$br(),
"*For datasets containing more than 10,000 cells the slow version of PCA is not suggested", tags$br(),
"(The execution times were measured in the web version of the tool. However, improved performance can be achieved by using the
stand-alone version on PCs with appropriate CPU and RAM specifications.)",
class="execTimeMessage"),
tags$br(),
tabsetPanel(type = "tabs", id = "pcaTabPanel",
tabPanel("scRNA-seq: PCA",
fluidRow(
box(
width = 12, status = "info", solidHeader = TRUE,
title = "PCA results", height = "1200px",
tabsetPanel(type = "tabs",
tabPanel("PCA run",
column(radioButtons("pcaRadio", label = h3("Suggest optimal number of PCs Using 10-fold SVA-CV: "),
choices = list("Yes (slow operation)" = "yes",
"No" = "no"),
selected = "no"), width = 12),
column(actionButton(inputId = "PCrunPCA", label = "Run PCA!", class="btn-run", icon = icon("check-circle")), width = 12),
div(
column(
div(id="elbowPlotPCA_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "elbowPlotPCA", height = "750px")
)
), width = 6),
column(
div(id="PCAscatter_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "PCAscatter", height = "750px")
)
), width = 6)
)
),
tabPanel("PCA exploration",
selectInput("PCin", "Select a principal component :", choices=1:100, selected = 1, multiple = FALSE,selectize = TRUE, width = NULL, size = NULL),
column(actionButton(inputId = "PCconfirm", label = "Explore principal component!", class="btn-run", icon = icon("check-circle")),
width = 12),
div(
column(
tags$h3("PCA loading scores (top-30 genes for this PC)"),
div(id="PCAloadings_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "PCAloadings", height = "700px")
)
), width = 6),
column(
tags$h3("Heatmap of scaled expression (top-30 genes for this PC)"),
div(id="PCAheatmap_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "PCAheatmap", height = "700px")
)
), width = 6)
),
downloadButton(outputId = "pcaRNAExport", label = "Save table")
)
)
)
)
),
tabPanel("scATAC-seq: LSI",
fluidRow(
box(
width = 6, status = "info", solidHeader = TRUE,
title = "Latent Semantic Indexing", height = "1290px",
tags$h3("Input parameters"),
tags$hr(),
sliderInput(inputId = "lsiVarFeatures", label = "Number of variable feures: ", min = 5000, max = 100000, value = 25000, step = 1000),#varFeatures
sliderInput(inputId = "lsiDmensions", label = "Number of dimensions to use: ", min = 1, max = 100, value = 30, step = 1),#dimensions
sliderInput(inputId = "lsiResolution", label = "Resolution :", min = 0.1, max = 10, value = 1, step = 0.1),#resolution
sliderInput(inputId = "lsiIterations", label = "Number of iterations: ", min = 1, max = 10, value = 1, step = 1),#iterations
actionButton(inputId = "lsiConfirm", label = "Run LSI!", class="btn-run", icon = icon("check-circle")),
tags$hr(),
verbatimTextOutput(outputId = "lsiOutput")
)
)
)
)
),
#Clustering tab
tabItem(tabName = "clustering",
tags$br(),
tags$div("Clustering: estimated time in web server for a scRNA-seq dataset of 6,000 cells ~ 8sec", tags$br(),
"Clustering: estimated time in web server for a scATAC-seq dataset of 6,000 cells ~ 38sec", tags$br(),
"(The execution times were measured in the web version of the tool. However, improved performance can be achieved by using the
stand-alone version on PCs with appropriate CPU and RAM specifications.)",
class="execTimeMessage"),
tags$br(),
tabsetPanel(type = "tabs", id = "clusteringTabPanel",
tabPanel("scRNA-seq",
fluidRow(
box(
width = 4, status = "info", solidHeader = TRUE,
title = "Clustering options",
tags$h3("1. Construction of the shared nearest neighbour (SNN) graph"),
tags$hr(),
sliderInput(inputId = "snnK", label = "Number of neighbours for each cell [k]:", min = 1, max = 200, value = 20, step = 1),
sliderInput(inputId = "snnPCs", label = "Number of principal components to use :", min = 1, max = 100, value = 10, step = 1),
tags$h3("2. Communities' detection (Louvain algorithm)"),
tags$hr(),
sliderInput(inputId = "clusterRes", label = "Clustering resolution :", min = 0.1, max = 5, value = 0.5, step = 0.1),
actionButton(inputId = "snnConfirm", label = "Run clustering", class="btn-run", icon = icon("check-circle")),
),
box(
width = 8, status = "info", solidHeader = TRUE, title = "Clustering output",
tabsetPanel(type = "tabs",
tabPanel("Clustering results",
tabsetPanel(type = "tabs",
tabPanel("Cluster table",
dataTableOutput(outputId="clusterTable"),
downloadButton(outputId = "clusterTableRNAExport", label = "Save table")
),
tabPanel("Cluster barplot",
selectInput("clusterGroupBy", "Grouping variable:",
c("orig.ident" = "orig.ident")),
actionButton(inputId = "clusterBarplotConfirm", label = "Display barchart!", class="btn-run", icon = icon("check-circle")),
div(id="clusterBarplot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "clusterBarplot", height = "700px")
)
)
)
)
),
tabPanel("Shared Nearest Neighbour (SNN) Graph",
actionButton(inputId = "snnDisplayConfirm", label = "Display SNN graph!", class="btn-run", icon = icon("check-circle")),
div(id="snnSNN_loader",
shinycssloaders::withSpinner(
visNetworkOutput(outputId="snnSNN", height = "1300px")
)
)
)
),
),
)
),
tabPanel("scATAC-seq",
fluidRow(
box(
width = 4, status = "info", solidHeader = TRUE,
title = "Clustering options",
sliderInput(inputId = "clusterDimensionsATAC", label = "Number of dimensions to use: ", min = 1, max = 100, value = 30, step = 1),
sliderInput(inputId = "clusterResATAC", label = "Clustering resolution :", min = 0.1, max = 60, value = 0.6, step = 0.1),
actionButton(inputId = "clusterConfirmATAC", label = "Perform clustering!", class="btn-run", icon = icon("check-circle")),
),
box(
width = 8, status = "info", solidHeader = TRUE, title = "Clustering output",
tabsetPanel(type = "tabs",
tabPanel("Clustering results",
tabsetPanel(type = "tabs",
tabPanel("Cluster table",
dataTableOutput(outputId="clusterTableATAC"),
downloadButton(outputId = "clusterTableExportATAC", label = "Save table")
),
tabPanel("Cluster barplot",
div(id="clusterBarplotATAC_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "clusterBarplotATAC", height = "700")
)
)
)
)
)
),
),
)
)
)
),
#UMAP tab
tabItem(tabName = "umap",
tags$br(),
tags$div("UMAP and tSNE: estimated time in web server for a scRNA-seq dataset of 6,000 cells ~ 47sec", tags$br(),
"UMAP and tSNE: estimated time in web server for a scATAC-seq dataset of 6,000 cells ~ 1min 20sec", tags$br(),
"(The execution times were measured in the web version of the tool. However, improved performance can be achieved by using the
stand-alone version on PCs with appropriate CPU and RAM specifications.)",
class="execTimeMessage"),
tags$br(),
tabsetPanel(type = "tabs", id = "umapTabPanel",
tabPanel("scRNA-seq",
fluidRow(
box(width = 3, status = "info", solidHeader = TRUE,
title = "Cells visualization options in reduced space",
sliderInput(inputId = "umapSeed", label = "Set seed :", min = 1, max = 500, value = 42, step = 1),
sliderInput(inputId = "umapPCs", label = "Number of principal components to use :", min = 1, max = 100, value = 10, step = 1),
sliderInput(inputId = "umapOutComponents", label = "Number of dimensions to fit output:", min = 2, max = 100, value = 3, step = 1)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "If PHATE is selected, the runtime increases when a value > 3 is used.\nPlease note that tSNE doesn't return more than 3 dimensions.", placement = "bottom"
)
),
actionButton(inputId = "umapRunUmap", label = "Run UMAP!", class="btn-run", icon = icon("check-circle")),
actionButton(inputId = "umapRunTsne", label = "Run tSNE!", class="btn-run", icon = icon("check-circle")),
actionButton(inputId = "umapRunDFM", label = "Run Diffusion Map!", class="btn-run", icon = icon("check-circle")),
actionButton(inputId = "umapRunPhate", label = "Run PHATE!", class="btn-run", icon = icon("check-circle")),
tags$h3("Display settings"),
tags$hr(),
selectInput("umapType", "Plot type:",
c("-" = "-")
),
selectInput("umapDimensions", "Dimensions:",
c("2D" = "2",
"3D" = "3")),
selectInput("umapColorBy", "Color by:",
c("Cluster" = "seurat_clusters")),
sliderInput("umapDotSize", "Size:", min = 1, max = 20, value = 5, step = 0.5),
sliderInput("umapDotOpacity", "Opacity:", min = 0, max = 1, value = 1, step = 0.1),
sliderInput("umapDotBorder", "Border width:", min = 0, max = 10, value = 0.5, step = 0.1),
actionButton(inputId = "umapConfirm", label = "Update plot!", class="btn-run", icon = icon("check-circle"))
),
box(width = 9, status = "info", solidHeader = TRUE, title = "Plot", height = "1200px",
div(id="umapPlot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "umapPlot", height = "1100px")
)
)
)
)
),
tabPanel("scATAC-seq",
fluidRow(
box(width = 3, status = "info", solidHeader = TRUE,
title = "Cells visualization options in reduced space",
sliderInput(inputId = "umapDimensionsATAC", label = "Number of input dimensions to use :", min = 1, max = 100, value = 30, step = 1),
sliderInput(inputId = "umapOutComponentsATAC", label = "Number of dimensions to fit output:", min = 2, max = 100, value = 3, step = 1)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Please note that tSNE doesn't return more than 2 dimensions.", placement = "bottom"
)
),
actionButton(inputId = "umapRunUmapTsneATAC", label = "Run UMAP and tSNE!", class="btn-run", icon = icon("check-circle")),
tags$h3("Display settings"),
tags$hr(),
selectInput("umapTypeATAC", "Plot type:",
c("UMAP" = "umap",
"tSNE" = "tsne")
),
selectInput("umapDimensionsPlotATAC", "Dimensions:",
c("2D" = "2",
"3D" = "3")),
selectInput("umapColorByATAC", "Color by:",
c("Clusters" = "Clusters")),
sliderInput("umapDotSizeATAC", "Size:", min = 1, max = 20, value = 5, step = 0.5),
sliderInput("umapDotOpacityATAC", "Opacity:", min = 0, max = 1, value = 1, step = 0.1),
sliderInput("umapDotBorderATAC", "Border width:", min = 0, max = 10, value = 0.5, step = 0.1),
actionButton(inputId = "umapConfirmATAC", label = "Display plot!", class="btn-run", icon = icon("check-circle"))
),
box(width = 9, status = "info", solidHeader = TRUE, title = "Plot", height = "1200px",
div(id="umapPlotATAC_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "umapPlotATAC", height = "1100px")
)
)
)
)
)
)
),
#Feature inspection
tabItem(tabName = "features",
bsCollapse(id = 'signature_collapse', multiple = T,
bsCollapsePanel('Do you need help with adding a new signature?', ih_signatureFP_rna, style = 'warning')
),
tags$div("Signature scoring: estimated time in web server for a scRNA-seq dataset of 6,000 cells ~ 33sec", tags$br(),
"(The execution times were measured in the web version of the tool. However, improved performance can be
achieved by using the stand-alone version on PCs with appropriate CPU and RAM specifications.)",
class="execTimeMessage"),
tags$br(),
tabsetPanel(type = "tabs", id = "featuresTabPanel",
tabPanel("scRNA-seq",
fluidRow(
tabsetPanel(type = "tabs",
tabPanel("Feature plot", fluidRow(
box(width = 3, status = "info", solidHeader = TRUE, title = "Options",
selectizeInput(inputId = 'findMarkersGeneSelect',
label = 'Type the name of a gene, gene signature or numeric metadata column:
(e.g. "Ccl2" or "Signature1_Ucell", or "nCount_RNA")',
choices = NULL,
selected = NULL,
multiple = FALSE),
selectInput("findMarkersReductionType", "Plot type:",
c("-" = "-")
),
radioButtons("findMarkersLabels", label = "Show cluster labels: ",
choices = list("Yes" = TRUE,
"No" = FALSE)
),
radioButtons("findMarkersOrder", label = "Prioritize expressing cells: ",
choices = list("Yes" = TRUE,
"No" = FALSE)
),
sliderInput("findMarkersMaxCutoff", "Set max expression value: (quantile)", min = 0, max = 99, value = 99, step = 1),
sliderInput("findMarkersMinCutoff", "Set minimum expression value: (quantile)", min = 0, max = 99, value = 0, step = 1),
actionButton(inputId = "findMarkersFPConfirm", label = "Display plot!", class="btn-run", icon = icon("check-circle")),
tags$hr(),
tags$h3("Add a new signature"),
textInput(inputId = "findMarkersSignatureName", label = "Gene signature name :", value = "Signature1"),
textAreaInput(inputId = "findMarkersSignatureMembers", label = "Paste a list of genes", cols = 80, rows = 15, placeholder = "Prg4\nTspan15\nCol22a1\nHtra4"),
actionButton(inputId = "findMarkersSignatureAdd", label = "Calculate signature score!", class="btn-run", icon = icon("check-circle"))
),
box(width = 9, status = "info", solidHeader = TRUE, title = "Plot",
div(id="findMarkersFeaturePlot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "findMarkersFeaturePlot", height = "1300px")
)
)
)
)),
tabPanel("Multi-feature vizualization", fluidRow(
box(width=3, status="info", solidHeader=T, title="Options",
selectizeInput(inputId = 'findMarkersFeaturePair1',
label = 'Select 1st feature:',
choices = NULL,
selected = NULL,
multiple = FALSE),
selectizeInput(inputId = 'findMarkersFeaturePair2',
label = 'Select 2nd Feature:',
choices = NULL,
selected = NULL,
multiple = FALSE),
sliderInput("findMarkersBlendThreshold", "Select threshold for blending:", min = 0, max = 1, value = 0.5, step = 0.1),
selectInput("findMarkersFeaturePairReductionType", "Plot type:",
c("-" = "-")
),
radioButtons("findMarkersFeaturePairLabels", label = "Show cluster labels: ",
choices = list("Yes" = TRUE,
"No" = FALSE)
),
radioButtons("findMarkersFeaturePairOrder", label = "Prioritize expressing cells: ",
choices = list("Yes" = TRUE,
"No" = FALSE)
),
sliderInput("findMarkersFeaturePairMaxCutoff", "Set max expression value: (quantile)", min = 0, max = 99, value = 99, step = 1),
sliderInput("findMarkersFeaturePairMinCutoff", "Set minimum expression value: (quantile)", min = 0, max = 99, value = 0, step = 1),
actionButton(inputId = "findMarkersFeaturePairConfirm", label = "Display plot!", class="btn-run", icon = icon("check-circle"))
),
box(width=9, status="info", solidHeader=TRUE, title="Plot",
div(
column(
div(id="findMarkersFPfeature1_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId="findMarkersFPfeature1", height = "650px")
)
), width = 6),
column(
div(id="findMarkersFPfeature2_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId="findMarkersFPfeature2", height = "650px")
)
), width = 6),
column(
div(id="findMarkersFPfeature1_2_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId="findMarkersFPfeature1_2", height = "650px")
)
), width = 6),
column(
div(id="findMarkersFPcolorbox_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId="findMarkersFPcolorbox", height = "650px")
)
), width = 6),
)
)
)
),
tabPanel("Violin plot", fluidRow(
box(width = 3, status = "info", solidHeader = TRUE, title = "Options",
selectizeInput(inputId = 'findMarkersGeneSelect2',
label = 'Type the name of a gene, gene signature or numeric metadata column:
(e.g. "Ccl2" or "Signature1_Ucell", or "nCount_RNA")',
choices = NULL,
selected = NULL,
multiple = FALSE), # allow for multiple inputs
actionButton(inputId = "findMarkersViolinConfirm", label = "Display plot!", class="btn-run", icon = icon("check-circle"))
),
box(width = 9, status = "info", solidHeader = TRUE, title = "Plot",
div(id="findMarkersViolinPlot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "findMarkersViolinPlot", height = "800px")
)
)
)
)
)
)
)
),
tabPanel("scATAC-seq",
fluidRow(
box(width = 3, status = "info", solidHeader = TRUE, title = "Options",
selectizeInput(inputId = 'findMarkersGeneSelectATAC',
label = 'Select a gene:',
choices = NULL,
selected = NULL,
multiple = FALSE),
selectInput("findMarkersReductionTypeATAC", "Plot type:",
c("UMAP" = "umap",
"tSNE" = "tsne")
),
actionButton(inputId = "findMarkersFPConfirmATAC", label = "Display plot!", class="btn-run", icon = icon("check-circle")),
),
box(width = 9, status = "info", solidHeader = TRUE, title = "Plot",
div(id="findMarkersFeaturePlotATAC_loader",
shinycssloaders::withSpinner(
plotOutput(outputId = "findMarkersFeaturePlotATAC", height = "1100px")
)
)
)
)
)
)
),
#ATAC
#DEA tab
tabItem(tabName = "findMarkers",
tags$br(),
tags$div("Marker genes: estimated time in web server for a scRNA-seq dataset of 6,000 cells ~ 1min 36sec", tags$br(),
"Marker genes: estimated time in web server for a scATAC-seq dataset of 6,000 cells ~ 1min 15sec", tags$br(),
"Marker peaks: estimated time in web server for a scATAC-seq dataset of 6,000 cells ~ 8min 30sec", tags$br(),
"(The execution times were measured in the web version of the tool. However, improved performance can be achieved by using the
stand-alone version on PCs with appropriate CPU and RAM specifications.)",
class="execTimeMessage"),
tags$br(),
tabsetPanel(type = "tabs", id = "findMarkersTabPanel",
tabPanel("scRNA-seq",
fluidRow(
box(width = 3, status = "info", solidHeader = TRUE,
title = "Differential Expression Analysis options",
selectInput("findMarkersTest", "Test used:",
c("Wilcoxon rank sum test" = "wilcox",
"Likelihood-ratio test for single cell feature expression" = "bimod",
"Standard AUC classifier" = "roc",
"Student's t-test" = "t",
"MAST" = "MAST",
"DESeq2" = "DESeq2"
)),
radioButtons("findMarkersLogBase", label = "Base used for average logFC calculation: ",
choices = list("log(e)" = "avg_logFC",
"log(2)" = "avg_log2FC"
),
selected = "avg_logFC"),
sliderInput(inputId = "findMarkersMinPct", label = "Minimum % of expression", min = 0, max = 1, value = 0.25, step = 0.05)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Only test genes that are detected in a minimum fraction of cells in either of the two populations:", placement = "bottom"
)
),
sliderInput(inputId = "findMarkersLogFC", label = "Avg Log FC threshold", min = 0, max = 3, value = 0.25, step = 0.05)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells:", placement = "bottom"
)
),
sliderInput(inputId = "findMarkersPval", label = "P-value threshold", min = 0, max = 1, value = 0.01, step = 0.01)%>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Only return markers that have a p-value < slected threshold, or a power > selected threshold (if the test is ROC) :", placement = "bottom"
)
),
actionButton(inputId = "findMarkersConfirm", label = "Find Marker genes!", class="btn-run", icon = icon("check-circle"))
),
box(
width = 9, status = "info", solidHeader = TRUE, title = "DEA results",
tabsetPanel(type = "tabs",
tabPanel("Marker genes",
dataTableOutput(outputId="findMarkersTable"),
downloadButton(outputId = "findMarkersRNAExport", label = "Save table")),
tabPanel("Heatmap",
actionButton(inputId = "findMarkersTop10HeatmapConfirm", label = "Display top-10 marker genes heatmap!", class="btn-run", icon = icon("check-circle")),
div(id="findMarkersHeatmap_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "findMarkersHeatmap", height = "1300px")
)
)
),
tabPanel("Dotplot",
actionButton(inputId = "findMarkersTop10DotplotConfirm", label = "Display top-10 marker genes dotplot!", class="btn-run", icon = icon("check-circle")),
div(id="findMarkersDotplot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "findMarkersDotplot", height = "1300px")
)
)
),
tabPanel("VolcanoPlot", fluidRow(
box(width = 3, status = "info", solidHeader = TRUE, title = "Cluster selection",
selectInput("findMarkersClusterSelect", "Cluster:", choices=c("-"="-"), multiple = F, selectize = F),
actionButton(inputId = "findMarkersVolcanoConfirm", "Display volcano plot!", class="btn-run", icon = icon("check-circle"))
),
box(width = 9, status = "info", solidHeader = TRUE, title = "Volcano plot",
div(id="findMarkersVolcanoPlot_loader",
shinycssloaders::withSpinner(
plotlyOutput(outputId = "findMarkersVolcanoPlot", height = "800px")
)
)
)
)
)
)
)
)
),
tabPanel("scATAC-seq",
fluidRow(
box(width = 3, status = "info", solidHeader = TRUE,
title = "Marker genes/peaks detection options (scATAC-seq)",
tags$h3("Marker genes"),
tags$hr(),
selectInput("findMarkersTestATAC", "Test used:",
c("Wilcoxon" = "wilcoxon",
"Binomial" = "binomial",
"T-test" = "ttest"
)),
selectInput("findMarkersGroupByATAC", "Cells group by:",
c("Clusters" = "Clusters",
"Integration predicted clusters" = "predictedGroup_Co"
)),
sliderInput(inputId = "findMarkersLogFCATAC", label = "Log2FC threshold:", min = 0, max = 3, value = 0.25, step = 0.01),
sliderInput(inputId = "findMarkersFDRATAC", label = "FDR threshold:", min = 0, max = 1, value = 0.01, step = 0.01),
actionButton(inputId = "findMarkersConfirmATAC", label = "Run analysis!", class="btn-run", icon = icon("check-circle")),
tags$h3("Marker peaks"),