-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathui.R
More file actions
1385 lines (1165 loc) · 70.1 KB
/
Copy pathui.R
File metadata and controls
1385 lines (1165 loc) · 70.1 KB
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
# BEAVR: A Browser-based tool for the Exploration And Visualization of RNA-seq data
# Developed by Pirunthan Perampalam @ https://github.com/developerpiru/
# See Github for documentation & ReadMe: https://github.com/developerpiru/BEAVR
app_version = "1.0.11"
# added:
# +1 to all reads; avoid 0 read count errors
# multiple comparisons
# show >2 conditions on PCA plot
# adjust results based on different conditions
# options for plots to show labels
# select either sample names or replicate names for labels
# boxplot or jitter plot option for read count plot
# use ggrepel for plot labels so labels don't overlap
# automatically install required packages if not already installed
# toggle for biocmanager packages
# fixed volcano plot
# ability to customize font sizes and point sizes for all graphs/plots
# ability to plot multiple read count plots at once
# customize legend positions on multiple read count plots
# drag to customize the area of all plots
# option to show y-axis title only on first plot per row
# option to show log10 scale y-axis
# dropped single read plot feature - use multi version with 1x1 grid for a single plot
# ability to pick human or mouse reference genomes to map ENSEMBL IDs
# ability to filter results table based on any/all columns
# ability to turn filtering on/off
# ability to download filtered results table
# volcano plot now shows filtered results if filtering is enabled
# updated UI colours and other aesthetics
# fixed legend positions for multi read count plots
# sample clustering plot (pearson correlation, euclidean, etc)
# count matrix heatmap to show most significant genes with highest variance between condition and treatment groups
# sample clustering heatmap colors
# fixed colors for all heatmaps
# specify distance and clustering type for count matrix heatmap
# fix variance transformations for small nsubs (small sample sets)
# volcano plot colors
# enter gene names for heatmap
# fixed color selection for boxplot and jitter plots
# calculate statistics in read count plots
# fixed statistics placements on read count plots
# updated count matrix heatmap function to use ComplexHeatmap
# fixed annoations for count matrix heatmap
# ability to customize colors of count matrix heatmap annotations
# full customization of count matrix heatmap now working
# improve dynamic colorbox rendering
# global num_conditions and num_replicates values added
# fixed heatmap annotation customizations and fonts
# div tags for all plot areas showing plot area boundary
# save all plots as png, jpg, svg, tiff or pdf
# select dpi setting for svg and pdf formats
# cleaned up ui
# pathway enrichment analysis using ReactomePA and enrichplot packages (overenrichment analysis and GSEA maps and plots)
# full customization of pathway and gsea plots/maps
# added results tables for pathway enrichment results and GSEA results
# added shiny.port option to use port 3838
# start info bar containing basic steps
# help tab for basic help/tips info
# fixed heatmap name bug
# removed default white border on sample clustering heatmap
# fixed bug where alert was not shown if filtering was not enabled when running enrichment functions; now requires library(shinyalert)
# fixed heatmap vst nsub bug: nsub now forced to nrow(dds table)
# heatmap variance stabilization defaulted to vst instead of rlog for better performance
# fixed colour widget ordering bug where widgets didn't match order of colour legend in PCA and read counts plots
# added ability to turn on/off labels for heatmap row and column names
# bugs"
#### PCA, gene count, volcano plots don't auto-update to new dds dataset after changing treatment condition factor level
#### legend symbols show letter 'a' below symbol on jitter plots
#set port to 3838
options(shiny.port = 3838)
## load required libraries
library("shiny")
library("shinydashboard")
library("shinyWidgets")
#cran packages
library("BiocManager")
library("colourpicker")
library("data.table")
#library("devtools") # to install from github
library("DT")
library("ggplot2")
library("ggpubr")
library("ggrepel")
library("ggraph")
library("gridExtra")
library("pheatmap")
library("RColorBrewer")
library("scales")
library("shiny")
library("shinydashboard")
library("shinyjqui")
library("shinyWidgets")
library("shinycssloaders")
library("circlize")
library(shinyalert)
# #Bioconductor packages
library("DESeq2")
library("vsn")
library("apeglm")
library("org.Hs.eg.db")
library("org.Mm.eg.db")
library("ReactomePA") #from bioconductor
library("enrichplot") #from bioconductor
# #GitHub packages
library("EnhancedVolcano")
library("ComplexHeatmap")
spinner_type = 1
spinner_col = "#0C71CF"
ui <- dashboardPage(
dashboardHeader(title = "BEAVR", titleWidth = 300),
dashboardSidebar(width = 300,
tags$style("
.skin-blue .sidebar
a.sidebarlink:link, a.sidebarlink:visited {
color: #FFFFFF;
}
.skin-blue .sidebar
a.sidebarlink:hover {
color: #FFFFFF;
}
.skin-blue .sidebar
.treeview {
color: #FFFFFF;
}
.skin-blue .sidebar
.center {
text-align: center;
}
.skin-blue .sidebar
a.shiny-download-link:link, a.shiny-download-link:visited {
color: #000000;
}
.skin-blue .sidebar
a.shiny-download-link:hover {
color: #000000;
}
.skin-blue .sidebar
.borderbox {
padding: 2px 0px 0px 0px;
}
.skin-blue .sidebar
.infobox {
padding: 2px 2px 10px 10px;
margin: 5px 5px 5px 5px;
display:block;
clear:both;
white-space: normal;
}
.content-wrapper, .right-side {
background-color: #FFFFFF;
overflow-x: auto;
}
"),
sidebarMenu(
#Conditional Panels to show tab-specific settings in sidebar
conditionalPanel("input.navigationTabs == 'loadDataTab'",
div(id = 'loadDataTab_sidebar',
tags$div('class'="infobox",
htmlOutput("startinfo")
)
)),
conditionalPanel("input.navigationTabs == 'expSettingsTab'",
div(id = 'expSettingsTab_sidebar'
)),
conditionalPanel("input.navigationTabs == 'geneTableTab'",
div(id = 'geneTableTab_sidebar',
tags$div('class'="center",
tags$br(),
downloadButton("downloadDEGeneTable", "Download Table", class = "btn")
),
materialSwitch("filterTableEnabled", label = tags$b("Filter table"), value = FALSE, status = "primary"),
menuItem(
h4("Common filtering options"),
tags$div('class'="borderbox",
#log2FoldChange
tags$b("log2FoldChange"),
numericInput("log2FC_min", label = "Min", value = 0),
numericInput("log2FC_max", label = "Max", value = 0),
#pvalue
tags$b("pvalue"),
numericInput("pvalue_min", label = "Min", value = 0),
numericInput("pvalue_max", label = "Max", value = 0),
#padj
tags$b("padj"),
numericInput("padj_min", label = "Min", value = 0),
numericInput("padj_max", label = "Max", value = 0)
)
),
menuItem(
h4("More filtering options"),
tags$div('class'="borderbox",
#baseMean
tags$b("baseMean"),
numericInput("baseMean_min", label = "Min", value = 0),
numericInput("baseMean_max", label = "Max", value = 0),
#lfcSE
tags$b("lfcSE"),
numericInput("lfcSE_min", label = "Min", value = 0),
numericInput("lfcSE_max", label = "Max", value = 0),
#stat
tags$b("stat"),
numericInput("stat_min", label = "Min", value = 0),
numericInput("stat_max", label = "Max", value = 0)
)
)
)),
conditionalPanel("input.navigationTabs == 'pcaPlotTab'",
div(id = 'pcaPlotTab_sidebar',
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
selectInput("PCAplot_labels", label = "Sample labels",
choices = list("No labels" = 1, "Sample names" = 2, "Replicate names" = 3),
selected = 1),
numericInput("pcaPointSize", label = "Point size", value = 3)
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
tags$div(id="pcaColorbox")
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("pcaLabelFontSize", label = "Sample labels", value = 5),
numericInput("pcaFontSize_xy_axis", label = "Axis labels", value = 18),
numericInput("pcaFontSize_legend_title", label = "Legend title", value = 16),
numericInput("pcaFontSize_legend_text", label = "Legend labels", value = 15)
)
)
)),
conditionalPanel("input.navigationTabs == 'sampleClusteringPlotTab'",
div(id = 'sampleClusteringPlotTab_sidebar',
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
selectInput("sampleClustering_method", label = "Distance method",
choices = list("Euclidean" = "euclidean", "Pearson" = "pearson", "Spearman" = "spearman",
"Kendall" = "kendall", "Maximum" = "maximum", "Manhattan" = "manhattan",
"Canberra" = "canberra", "Binary" = "binary", "Minkowski" = "minkowski"),
selected = "euclidean"),
selectInput("sampleClustering_cellNums", label = "Distance values",
choices = list("Hide" = FALSE, "Decimal" = "%.2f", "Exponential" = "%.1e"),
selected = FALSE),
numericInput("sampleClusterin_row_dend_width", label = "Row dendrogram width", value = 2),
numericInput("sampleClusterin_col_dend_height", label = "Column dendrogram height", value = 2),
selectInput("sampleClusterin_row_dend_position", label = "Row dendrogram position",
choices = list("Left" = "left", "Right" = "right"),
selected = "left"),
selectInput("sampleClusterin_col_dend_position", label = "Column dendrogram position",
choices = list("Top" = "top", "Bottom" = "bottom"),
selected = "top"),
checkboxInput("sampleClusterin_rowlabels", label = "Show row labels", value = TRUE),
checkboxInput("sampleClusterin_columnlabels", label = "Show column labels", value = TRUE),
selectInput("sampleClusterin_rowlabel_position", label = "Row label position",
choices = list("Left" = "left", "Right" = "right"),
selected = "right"),
selectInput("sampleClusterin_collabel_position", label = "Column label position",
choices = list("Top" = "top", "Bottom" = "bottom"),
selected = "bottom"),
numericInput("sampleClusterin_row_rotation", label = "Row label rotation (degrees)", value = 0),
numericInput("sampleClusterin_col_rotation", label = "Column label rotation (degrees)", value = 45)
)
),
menuItem(
h4("Heatmap colors"),
tags$div('class'="borderbox",
selectInput("sampleClustering_mapColor", label = "Heatmap color",
choices = list("Blues" = "Blues",
"Blue-Purple" = "BuPu",
"Green-Blue" = "GnBu",
"Greens" = "Greens",
"Greys" = "Greys",
"Oranges" = "Oranges",
"Orange-Red" = "OrRd",
"Purple-Blue" = "PuBu",
"Purple-Blue-Green" = "PuBuGn",
"Purple-Red" = "PuRd",
"Purples" = "Purples",
"Red-Purple" = "RdPu",
"Reds" = "Reds",
"Yellow-Green" = "YlGn",
"Yellow-Green-Blue" = "YlGnBu",
"Yellow-Orange-Brown" = "YlOrBr",
"Yellow-Orange-Red" = "YlOrRd"
), selected = "Blues"),
colourInput("sampleClustering_borderColor", "Border color", "#FFFFFF00", allowTransparent = TRUE)
)
),
menuItem(
h4("Label colors"),
tags$div('class'="borderbox",
colourInput("sampleClustering_rowlabelColor", "Row labels", "black"),
colourInput("sampleClustering_collabelColor", "Column labels", "black"),
colourInput("sampleClustering_cellNumsColor", "Distance values", "black"),
colourInput("sampleClustering_legendColor", "Legend labels", "black")
)
),
menuItem(
h4("Legends"),
tags$div('class'="borderbox",
selectInput("sampleClustering_main_legend", label = "Legend position",
choices = list("Left" = "left",
"Right" = "right", "Top" = "top", "Bottom" = "bottom"),
selected = "right"),
selectInput("sampleClustering_main_legend_dir", label = "Legend direction",
choices = list("Horizontal" = "horizontal", "Vertical" = "vertical"),
selected = "horizontal"),
numericInput("sampleClustering_main_legend_size", label = "Legend size", value = 5)
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("sampleClustering_fontsize_rowNames", label = "Row names", value = 10),
numericInput("sampleClustering_fontsize_colNames", label = "Columns names", value = 10),
numericInput("sampleClustering_fontsize_cellNums", label = "Cell values", value = 10),
numericInput("sampleClustering_fontsize_legends", label = "Legend labels", value = 10)
)
)
)),
conditionalPanel("input.navigationTabs == 'multigenecountPlotTab'",
div(id = 'multigenecountPlotTab_sidebar',
menuItem(
h4("Genes"),
tags$div('class'="borderbox",
textAreaInput("multi_gene_name", label = "Enter gene names separated by comma", value = "HRAS,NRAS,KRAS", width = NULL,
height = 100, cols = NULL, rows = NULL, placeholder = NULL,
resize = NULL)
)
),
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
numericInput("multi_genecountGridRows", label = "Grid rows", value = 1),
numericInput("multi_genecountGridColumns", label = "Grid columns", value = 3),
selectInput("multi_readcountplot_type", label = "Plot type",
choices = list("Boxplot" = 1, "Jitter plot" = 2),
selected = 1),
numericInput("multi_genecountPointSize", label = "Jitter point size", value = 3),
selectInput("multi_readcountplot_labels", label = "Sample labels",
choices = list("No labels" = 1, "Sample names" = 2, "Replicate names" = 3),
selected = 1),
materialSwitch("multi_genecountSharedYAxis", label = tags$b("Label y-axis on first plot per row"), value = TRUE, status = "primary"),
materialSwitch("multi_log10scale", label = tags$b("Log10 scale y-axis"), value = FALSE, status = "primary"),
materialSwitch("pcaRotateText", label = tags$b("Rotate x-axis labels"), value = TRUE, status = "primary"),
selectInput("multi_genecountShowLegends", label = "Show legends",
choices = list("Hide legends" = 1, "Show legends on all plots" = 2, "Show one common legend" = 3),
selected = 3),
selectInput("multi_genecountLegendPosition", label = "Legend position",
choices = list("Top" = "top", "Bottom" = "bottom", "Left" = "left", "Right" = "right"),
selected = "Top")
)
),
menuItem(
h4("Statistics"),
tags$div('class'="borderbox",
materialSwitch("multi_genecountStats", label = tags$b("Show statistics"), value = TRUE, status = "primary"),
numericInput("multi_genecountStatsYcord", label = tags$b("Adjust statistics placement"), value = "1")
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
tags$div(id="multi_genecountColorbox")
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("multi_genecountFontSize_plot_title", label = "Gene name", value = 15),
numericInput("multi_genecountLabelFontSize", label = "Sample labels", value = 5),
numericInput("multi_genecountFontSize_xy_axis", label = "Axis labels", value = 12),
numericInput("multi_genecountFontSize_legend_text", label = "Legend labels", value = 12),
numericInput("multi_genecountFontSize_stats_text", label = "Statistics", value = 6)
)
)
)),
conditionalPanel("input.navigationTabs == 'countMatrixHeatmapTab'",
div(id = 'countMatrixHeatmapTab_sidebar',
menuItem(
h4("Genes"),
tags$div('class'="borderbox",
textAreaInput("heatmap_GeneNames", label = "Enter gene names separated by comma", value = "",
width = NULL, height = 100, cols = NULL, rows = NULL, placeholder = NULL,
resize = NULL),
materialSwitch("heatmap_pickTopGenes", label = tags$b("Show top genes instead"), value = TRUE, status = "primary"),
numericInput("heatmap_numGenes", label = "Number of top genes to show", value = 5)
)
),
menuItem(
h4("Clustering"),
tags$div('class'="borderbox",
selectInput("heatmap_varlogmethod", label = "Variance stabilization method",
choices = list("Regularized log transformation" = "rlog",
"Variance stabilization" = "vst"),
selected = "vst"),
selectInput("heatmap_clustMethod", label = "Clustering method",
choices = list("Ward D1 (Ward 1963)" = "ward.D",
"Ward D2 (Complete Ward's criteriom)" = "ward.D2",
"Single" = "single",
"Complete" = "complete",
"Average" = "average",
"McQuitty" = "mcquitty",
"Median" = "median",
"Centroid" = "centroid"),
selected = "ward.D"),
selectInput("heatmap_distance", label = "Distance method",
choices = list("Euclidean" = "euclidean", "Pearson" = "pearson", "Spearman" = "spearman",
"Kendall" = "kendall", "Maximum" = "maximum", "Manhattan" = "manhattan",
"Canberra" = "canberra", "Binary" = "binary", "Minkowski" = "minkowski"),
selected = "euclidean"),
materialSwitch("heatmap_clustRows", label = tags$b("Cluster rows"), value = TRUE, status = "primary"),
materialSwitch("heatmap_clustCols", label = tags$b("Cluster columns"), value = FALSE, status = "primary")
)
),
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
sliderInput("heatmap_scale_range", label = "Gene expression scale",
min = -6, max = 6, value = c(-2,2), step = 0.5),
selectInput("heatmap_annotations", label = "Annotations",
choices = list("None" = "none", "Both" = "both",
"Replicate" = "replicate", "Treatment" = "treatment"),
selected = "both"),
selectInput("heatmap_cellNums", label = "Distance values",
choices = list("Hide" = FALSE, "Decimal" = "%.2f", "Exponential" = "%.1e"),
selected = FALSE),
numericInput("heatmap_row_dend_width", label = "Row dendrogram width", value = 2),
numericInput("heatmap_col_dend_height", label = "Column dendrogram height", value = 2),
selectInput("heatmap_row_dend_position", label = "Row dendrogram position",
choices = list("Left" = "left", "Right" = "right"),
selected = "left"),
selectInput("heatmap_col_dend_position", label = "Column dendrogram position",
choices = list("Top" = "top", "Bottom" = "bottom"),
selected = "top"),
checkboxInput("heatmap_show_genelabels", label = "Show gene labels", value = TRUE),
checkboxInput("heatmap_show_samplelabels", label = "Show sample labels", value = TRUE),
selectInput("heatmap_GeneNameType", label = "Gene label type",
choices = list("HGNC symbols" = "HGNC", "ENSEMBL IDs" = "ENSEMBL")),
selectInput("heatmap_genelabel_position", label = "Gene label position",
choices = list("Left" = "left", "Right" = "right"),
selected = "right"),
selectInput("heatmap_samplelabel_position", label = "Sample label position",
choices = list("Top" = "top", "Bottom" = "bottom"),
selected = "bottom"),
numericInput("heatmap_row_rotation", label = "Gene name rotation (degrees)", value = 0),
numericInput("heatmap_col_rotation", label = "Sample name rotation (degrees)", value = 45)
)
),
menuItem(
h4("Heatmap colors"),
tags$div('class'="borderbox",
colourInput("heatmap_lowColor", "Low color", "#374AB3", allowTransparent = FALSE),
colourInput("heatmap_midColor", "Mid color", "#FFFFFF", allowTransparent = FALSE),
colourInput("heatmap_highColor", "High color", "#E62412", allowTransparent = FALSE),
colourInput("heatmap_borderColor", "Border color", "#FFFFFF00", allowTransparent = TRUE)
)
),
menuItem(
h4("Replicate colors"),
tags$div('class'="borderbox",
tags$div(id="heatmap_replicateColorbox")
)
),
menuItem(
h4("Condition/Treatment colors"),
tags$div('class'="borderbox",
tags$div(id="heatmap_conditionColorbox")
)
),
menuItem(
h4("Label colors"),
tags$div('class'="borderbox",
colourInput("heatmap_rowlabelColor", "Gene labels", "black"),
colourInput("heatmap_collabelColor", "Sample labels", "black"),
colourInput("heatmap_cellNumsColor", "Distance values", "black"),
colourInput("heatmap_legendColor", "Legend labels", "black")
)
),
menuItem(
h4("Legends"),
tags$div('class'="borderbox",
selectInput("heatmap_main_legend", label = "Main legend position",
choices = list("Left" = "left",
"Right" = "right", "Top" = "top", "Bottom" = "bottom"),
selected = "right"),
selectInput("heatmap_anno_legend", label = "Annotations legend position",
choices = list("Left" = "left",
"Right" = "right", "Top" = "top", "Bottom" = "bottom"),
selected = "bottom"),
selectInput("heatmap_main_legend_dir", label = "Main legend direction",
choices = list("Horizontal" = "horizontal", "Vertical" = "vertical"),
selected = "vertical"),
selectInput("heatmap_anno_legend_dir", label = "Annotations legend direction",
choices = list("Horizontal" = "horizontal", "Vertical" = "vertical"),
selected = "vertical"),
numericInput("heatmap_main_legend_size", label = "Main legend size", value = 5)
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("heatmap_fontsize_geneNames", label = "Gene names", value = 10),
numericInput("heatmap_fontsize_sampleNames", label = "Sample names", value = 10),
numericInput("heatmap_fontsize_annotations", label = "Annotations", value = 10),
numericInput("heatmap_fontsize_cellNums", label = "Cell values", value = 10),
numericInput("heatmap_fontsize_legends", label = "Legend labels", value = 10)
)
)
)),
conditionalPanel("input.navigationTabs == 'volcanoPlotTab'",
div(id = 'volcanoPlotTab_sidebar',
menuItem(
h4("Cutoffs"),
tags$div('class'="borderbox",
textInput("volcanoFCcutoff", "Log2 fold change", value = 1, width = NULL,
placeholder = NULL),
selectInput("volcanopCutoffType", label = "p value cutoff type",
choices = list("Unadjusted p value" = "pvalue", "Adjusted p value" = "padj"),
selected = "unadj"),
textInput("volcanopCutoff", "p value or padj value", value = "0.05", width = NULL,
placeholder = NULL)
)
),
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
numericInput("volcanoPointSize", label = "Point size", value = 3),
materialSwitch("volcanoCutoffLines", label = tags$b("Show cutoff lines"), value = TRUE, status = "primary"),
selectInput("volcanoLegendPosition", label = "Legend position",
choices = list("Top" = "top", "Bottom" = "bottom", "Left" = "left", "Right" = "right"),
selected = "bottom")
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
colourInput("volcano_NSColor", "Not significant color", "#5B5B5C", allowTransparent = FALSE),
colourInput("volcano_LFCColor", "LFC only color", "#0FBD32", allowTransparent = FALSE),
colourInput("volcano_pvalColor", "p value only color", "#126FE8", allowTransparent = FALSE),
colourInput("volcano_pvalLFCColor", "LFC and p value color", "#FF0000", allowTransparent = TRUE)
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("volcanoFontSize_plot_title", label = "Plot title", value = 15),
numericInput("volcanoFontSize_label", label = "Point labels", value = 5),
numericInput("volcanoFontSize_xy_axis", label = "Axis labels", value = 15),
numericInput("volcanoFontSize_legend_title", label = "Legend labels", value = 15)
)
)
)),
conditionalPanel("input.navigationTabs == 'enrichmentPlotTab'",
div(id = 'enrichmentPlotTab_sidebar',
menuItem(
h4("Enrichment"),
tags$div('class'="borderbox",
numericInput("enrPvalcutoff", "p value cutoff for enrichment", value = "0.05"),
numericInput("enrNumCategories", label = "Max number of categories", value = 10)
)
),
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
selectInput("enrPlotType", label = "Plot type",
choices = list("Bar plot" = "bar", "Dot plot" = "dot"),
selected = "bar")
)
),
menuItem(
h4("Legend"),
tags$div('class'="borderbox",
selectInput("enrLegendPosition", label = "Legend position",
choices = list("Top" = "top", "Bottom" = "bottom", "Left" = "left", "Right" = "right"),
selected = "right"),
selectInput("enrLegendDirection", label = "Legend direction",
choices = list("Horizontal" = "horizontal", "Vertical" = "vertical"),
selected = "vertical")
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
colourInput("enrMostColor", "Most significant color", "#374AB3", allowTransparent = FALSE),
colourInput("enrLeastColor", "Least significant color", "#E62412", allowTransparent = FALSE)
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("enrFontSize_xy_axis", label = "Axis labels", value = 15),
numericInput("enrFontSize_legend", label = "Legend labels", value = 15)
)
)
)),
conditionalPanel("input.navigationTabs == 'enrichmentMapTab'",
div(id = 'enrichmentMapTab_sidebar',
menuItem(
h4("Enrichment"),
tags$div('class'="borderbox",
numericInput("enrMapPvalcutoff", "p value cutoff for enrichment", value = "0.05")
)
),
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
selectInput("enrMapLegendPosition", label = "Legend position",
choices = list("Top" = "top", "Bottom" = "bottom", "Left" = "left", "Right" = "right"),
selected = "right"),
selectInput("enrMapLegendDirection", label = "Legend direction",
choices = list("Horizontal" = "horizontal", "Vertical" = "vertical"),
selected = "vertical")
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
colourInput("enrMapMostColor", "Most significant color", "#374AB3", allowTransparent = FALSE),
colourInput("enrMapLeastColor", "Least significant color", "#E62412", allowTransparent = FALSE),
colourInput("enrMaplineColor", "Edge/Line color", "#C9C3C3", allowTransparent = FALSE),
sliderInput("enrMaptransparency", label = "Edge/Line transparency",
min = 0, max = 100, value = 50, step = 1, post = "%")
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("enrMapFontSize_labels", label = "Labels", value = 5),
numericInput("enrMapFontSize_legend", label = "Legend labels", value = 15)
)
)
)),
conditionalPanel("input.navigationTabs == 'gseaMapTab'",
div(id = 'gseaMapTab_sidebar',
menuItem(
h4("Enrichment"),
tags$div('class'="borderbox",
numericInput("gseaMapPvalcutoff", "p value cutoff for enrichment", value = "0.05")
)
),
menuItem(
h4("Legend"),
tags$div('class'="borderbox",
selectInput("gseaMapLegendPosition", label = "Legend position",
choices = list("Top" = "top", "Bottom" = "bottom", "Left" = "left", "Right" = "right"),
selected = "right"),
selectInput("gseaMapLegendDirection", label = "Legend direction",
choices = list("Horizontal" = "horizontal", "Vertical" = "vertical"),
selected = "vertical")
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
colourInput("gseaMapMostColor", "Most significant color", "#374AB3", allowTransparent = FALSE),
colourInput("gseaMapLeastColor", "Least significant color", "#E62412", allowTransparent = FALSE),
colourInput("gseaMaplineColor", "Edge/Line color", "#C9C3C3", allowTransparent = FALSE),
sliderInput("gseaMaptransparency", label = "Edge/Line transparency",
min = 0, max = 100, value = 50, step = 1, post = "%")
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("gseaMapFontSize_labels", label = "Axis labels", value = 5),
numericInput("gseaMapFontSize_legend", label = "Legend labels", value = 15)
)
)
)),
conditionalPanel("input.navigationTabs == 'gseaPlotTab'",
div(id = 'gseaPlotTab_sidebar',
menuItem(
h4("Enrichment"),
tags$div('class'="borderbox",
uiOutput("gseaPlotPathways")
)
),
menuItem(
h4("Appearance"),
tags$div('class'="borderbox",
selectInput("gseaPlotShowPvalue", label = "p values",
choices = list("Show" = TRUE, "Hide" = FALSE),
selected = FALSE)
)
),
menuItem(
h4("Colors"),
tags$div('class'="borderbox",
colourInput("gseaPlotLineColor", "Enrichment score line color", "#1EFF00", allowTransparent = FALSE)
)
),
menuItem(
h4("Font sizes"),
tags$div('class'="borderbox",
numericInput("gseaPlotFontSize", label = "Base font size", value = 15)
)
)
)),
conditionalPanel("input.navigationTabs == 'enrichmentTableTab'",
div(id = 'enrichmentTableTab_sidebar',
tags$div('class'="center",
tags$br(),
downloadButton("downloadenrichmentTable", "Download Table", class = "btn")
),
materialSwitch("enrichmentTablefilterTableEnabled", label = tags$b("Filter table"), value = FALSE, status = "primary"),
menuItem(
h4("Filter by statistics"),
tags$div('class'="borderbox",
tags$b("Count"),
numericInput("enr_count_min", label = "Min", value = 0),
numericInput("enr_count_max", label = "Max", value = 0),
#pvalue
tags$b("pvalue"),
numericInput("enr_pvalue_min", label = "Min", value = 0),
numericInput("enr_pvalue_max", label = "Max", value = 0),
#padj
tags$b("padj"),
numericInput("enr_padj_min", label = "Min", value = 0),
numericInput("enr_padj_max", label = "Max", value = 0),
#qvalue
tags$b("qvalue"),
numericInput("enr_qvalue_min", label = "Min", value = 0),
numericInput("enr_qvalue_max", label = "Max", value = 0)
)
)
)),
conditionalPanel("input.navigationTabs == 'gseaTableTab'",
div(id = 'gseaTableTab_sidebar',
tags$div('class'="center",
tags$br(),
downloadButton("downloadgseaTable", "Download Table", class = "btn")
),
materialSwitch("gseaTablefilterTableEnabled", label = tags$b("Filter table"), value = FALSE, status = "primary"),
menuItem(
h4("Filter by enrichment scores"),
tags$div('class'="borderbox",
#enrichment Score
tags$b("Enrichment score (ES)"),
numericInput("gsea_enrichmentScore_min", label = "Min", value = 0),
numericInput("gsea_enrichmentScore_max", label = "Max", value = 0),
#NES
tags$b("Normalized enrichment score (NES)"),
numericInput("gsea_nes_min", label = "Min", value = 0),
numericInput("gsea_nes_max", label = "Max", value = 0)
)
),
menuItem(
h4("Filter by statistics"),
tags$div('class'="borderbox",
#pvalue
tags$b("pvalue"),
numericInput("gsea_pvalue_min", label = "Min", value = 0),
numericInput("gsea_pvalue_max", label = "Max", value = 0),
#padj
tags$b("padj"),
numericInput("gsea_padj_min", label = "Min", value = 0),
numericInput("gsea_padj_max", label = "Max", value = 0),
#qvalue
tags$b("qvalue"),
numericInput("gsea_qvalue_min", label = "Min", value = 0),
numericInput("gsea_qvalue_max", label = "Max", value = 0),
tags$b("Rank"),
numericInput("gsea_rank_min", label = "Min", value = 0),
numericInput("gsea_rank_max", label = "Max", value = 0)
)
)
))
)
), #end dashboard Sidebar
dashboardBody(
tabsetPanel(
id = "navigationTabs",
#Load data tab
tabPanel("Load Data", id = "loadDataTab", value= "loadDataTab", fluidRow(
#layout HTML tags
HTML('<div style="padding:10px 10px 10px 10px;"><p>'),
#Load read counts file
fileInput("rawreadsfile", "Select read count table file",
multiple = FALSE,
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv")),
radioButtons("sep1", "Separator",
choices = c(Comma = ",",
Semicolon = ";",
Tab = "\t"),
selected = ","),
#Load coldata
fileInput("coldatafile", "Select sample treatment matrix file",
multiple = FALSE,
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv")),
radioButtons("sep2", "Separator",
choices = c(Comma = ",",
Semicolon = ";",
Tab = "\t"),
selected = ","),
HTML('</p></div>')
)),
#Experiment settings tab
tabPanel("Settings", id = "expSettingsTab", value= "expSettingsTab",
#layout HTML tags
HTML('<div style="padding:10px 10px 10px 10px;"><p>'),
selectInput("ref_genome_organism", label = "Reference organism",
choices = list("Human" = 1, "Mouse" = 2),
selected = 1),
uiOutput("control_condslist"),
uiOutput("treatment1_condslist"),
uiOutput("FDR_value"),
selectInput("shrinkage_method", label = "Shrinkage estimator",
choices = list("Approximate posterior estimation (apeglm)" = 1, "Normal (adaptive normal distribution)" = 2),
selected = 1),
uiOutput("min_reads"),
HTML('</p></div>')
),
#DE gane table tab
tabPanel("Gene Table", id = "geneTableTab", value= "geneTableTab", fluidRow(
#layout HTML tags
HTML('<div style="padding:10px 10px 10px 10px;"><p>'),
DT::dataTableOutput("calc_res_values"),
HTML('</p></div>')
)),
#PCA plot tab
tabPanel("PCA", id = "pcaPlot", value= "pcaPlotTab", fluidRow(
#layout HTML tags
HTML('<div style="padding:10px 10px 10px 10px;"><p>'),
# download buttons
dropdown(label = "Save Plot",
selectInput("PCAplot_dpi", label = "Output dpi", width = "100",
choices = list("24 dpi" = 24, "48 dpi" = 48, "96 dpi" = 96, "192 dpi" = 192),
selected = 48),
downloadButton("savePCApng", "PNG"),
HTML('<br><br>'),
downloadButton("savePCAjpg", "JPG"),
HTML('<br><br>'),
downloadButton("savePCAsvg", "SVG"),
HTML('<br><br>'),
downloadButton("savePCApdf", "PDF"),
HTML('<br><br>'),
downloadButton("savePCAtiff", "TIFF"),
size = "default",
icon = icon("download", class = ""),
up = FALSE
),
HTML('</p>'),
jqui_resizable(#jqui resizable canvass
tagList(
# div box for PCA plot
HTML('<div style="border:1px solid black;padding:5px 5px 0px 0px;width:500;background-color: #FFFFFF;float:left;display:block;"><p>'),