-
Notifications
You must be signed in to change notification settings - Fork 3
/
ui.R
517 lines (509 loc) · 23.1 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
# UI Options --------------------------------------------------------------
# Set default color and type for shinycssloaders
options(spinner.type = 7, spinner.color = "#989898")
example_url <- function(x) {
has_tooltip <- !is.null(x$tooltip)
if (has_tooltip) {
if (!is.null(x$input_id)) {
tags$li(actionLink(x$input_id, x$text), class = "dropdown-item",
"data-toggle" = "tooltip", "data-placement" = "right",
title = x$tooltip)
} else {
tags$li(tags$a(href = x$url, x$text), class = "dropdown-item",
"data-toggle" = "tooltip", "data-placement" = "right",
title = x$tooltip)
}
} else {
if (!is.null(x$input_id)) {
tags$li(actionLink(x$input_id, x$text), class = "dropdown-item")
} else {
tags$li(tags$a(href = x$url, x$text), class = "dropdown-item")
}
}
}
INPUT_CHOICES <- list(
population = c("EUR", "AFR", "AMR", "ASN"),
HaploR = c(
"Chromosome" = "chr",
"Position" = "pos_hg38",
"r2" = "r2",
"Query SNP" = "query_snp_rsid",
"D'" = "D'",
"Query SNP" = "is_query_snp",
"Reference allele" = "ref",
"Alternative allele" = "alt",
"LD(AFR)" = "AFR",
"LD(AMR)" = "AMR",
"LD(ASN)" = "ASN",
"LD(EUR)" = "EUR",
"GERP scores" = "GERP_cons",
"SiPhy scores" = "SiPhy_cons",
"Chromatin States" = "Chromatin_States",
"Imputed Chromatin States" = "Chromatin_States_Imputed",
"Chromatin Marks" = "Chromatin_Marks",
"DNAse" = "DNAse",
"Proteins",
"eQTL",
"GWAS study name" = "gwas",
"GRASP study name" = "grasp",
"Motifs",
"GENCODE transcript ID" = "GENCODE_id",
"GENCODE gene name" = "GENCODE_name",
"GENCODE direction" = "GENCODE_direction",
"GENCODE distance" = "GENCODE_distance",
"NCBI Reference Sequence Accession number" = "RefSeq_id",
"NCBI Reference Sequence name" = "RefSeq_name",
"NCBI Reference Sequence direction" = "RefSeq_direction",
"NCBI Reference Sequence distance" = "RefSeq_distance",
"Annotated proteins" = "dbSNP_functional_annotation"
),
onco = list(
general = c(
"Lineages in ACHILLES dataset" = "ACHILLES_Lineage_Results_Top_Genes",
"Total number of mutations in CCLE Oncomap data" = "CCLE_By_Gene_total_mutations_in_gene",
"Gene symbols of fusion events (COSMIC)" = "COSMIC_FusionGenes_fusion_genes",
"Tissue type summary of tumor samples (COSMIC)" = "COSMIC_Tissue_tissue_types_affected",
"Total numbers of records for gene (COSMIC)" = "COSMIC_Tissue_total_alterations_in_gene",
"Familial cancer database reference used" = "Familial_Cancer_Genes_Reference",
"Familial cancer syndromes" = "Familial_Cancer_Genes_Syndrome",
"Familial cancer syndrome synonyms" = "Familial_Cancer_Genes_Synonym",
"HGNC Accession" = "HGNC_Accession.Numbers",
"Known DNA repair roles" = "HumanDNARepairGenes_Role",
"Published MutSig analyses" = "MutSig.Published.Results_Published_Results",
"Overlapping significant GISTIC amplification focal peaks from TCGAscape" = "TCGAScape_Amplification_Peaks",
"Overlapping significant GISTIC deletion focal peaks from TCGAscape" = "TCGAScape_Deletion_Peaks",
"Overlapping significant GISTIC aplification focal peaks from Tumorscape" = "TUMORScape_Amplification_Peaks",
"Overlapping significant GISTIC deletion focal peaks from Tumorscape" = "TUMORScape_Deletion_Peaks",
"Observed alternate allele" = "alt_allele",
"Build" = "build",
"Chromosome" = "chr",
"Class" = "class",
"End coordinate" = "end",
"Gene" = "gene",
"Protein change" = "protein_change",
"Positive strand reference allele" = "ref_allele",
"Start coordinate" = "start",
"Strand orientation" = "strand",
"Transcripts" = "transcripts"
),
cancer_gene_census = c(
"Variant is in a gene that is mutated in the germline predisposing to cancer" = "CGC_Cancer.Germline.Mut",
"Variants dominant/recesive" = "CGC_Cancer.Molecular.Genetics",
"Variant is in a gene that is somatically mutated in cancer" = "CGC_Cancer.Somatic.Mut",
"Cancer related syndromes" = "CGC_Cancer.Syndrome",
"Chromosome" = "CGC_Chr",
"Chromosome band" = "CGC_Chr.Band",
"Entrez gene ID" = "CGC_GeneID",
"Type of mutations" = "CGC_Mutation.Type",
"Full gene name" = "CGC_Name",
"Variant is in a gene that is germline mutated in other diseases/syndromes" = "CGC_Other.Germline.Mut",
"Other diseases/syndromes" = "CGC_Other.Syndrome.Disease",
"Tissue types with mutations" = "CGC_Tissue.Type",
"Known translocation partner gene" = "CGC_Translocation.Partner",
"Tumor types with somatic alterations" = "CGC_Tumour.Types...Somatic.Mutations.",
"Tumor types with germline alterations" = "CGC_Tumour.Types..Germline.Mutations."
),
uniprot = c(
"Overlapping UniProt sites with experimental data" = "UniProt_AA_experimental_info",
"Overlapping UniProt variants of interest" = "UniProt_AA_natural_variation",
"Overlapping UniProt regions of interest " = "UniProt_AA_region",
"Overlapping UniProt single amino acid sites" = "UniProt_AA_site",
"Listing of compounds from DrugBank known to interact with genes" = "UniProt_DrugBank",
"GO terms describing pathways and processes UniProt protein is involved in" = "UniProt_GO_Biological_Process",
"GO terms describing localization of given UniProt protein" = "UniProt_GO_Cellular_Component",
"GO terms describing molecular activity of given UniProt protein" = "UniProt_GO_Molecular_Function",
"Alternative UniProt accession ID" = "UniProt_alt_uniprot_accessions",
"Uniprot accession number" = "UniProt_uniprot_accession",
"UniProt entry name" = "UniProt_uniprot_entry_name"
)
),
regulome = c(
"Chromosome" = "#chromosome",
"Coordinates" = "coordinate",
"Hits" = "hits",
"Score" = "score_anno"
# "Score" = "score"
)
)
# Shiny UI ----------------------------------------------------------------
# The Shiny UI is wrapped in a function with argument `request` to enable bookmarking
function(request) {
dashboardPage(
skin = "black",
dashboardHeader(
title = "epiTAD",
tags$li(
class = "dropdown",
actionLink("btn_info_nav", label = "", icon = icon("info"), title = "About epiTAD")
),
tags$li(
class = "dropdown",
tags$a(
href = "https://github.com/gerkelab/epiTAD/",
title = "epiTAD on GitHub",
target = "_blank",
icon("github")
)
),
tags$li(
class = "dropdown",
tags$a(
href = "https://gerkelab.com/project/epiTAD/",
title = "GerkeLab Project Page",
target = "_blank",
icon("flask")
)
)
),
dashboardSidebar(disable = TRUE),
dashboardBody(
tags$head(
tags$style(
HTML(
".box-shadow {
box-shadow: 0 1px 3px rgba(0,0,0,.25);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.25);"
)
),
#<link rel="stylesheet" type="text/css" href="mystyles.css" media="screen" />
tags$link(rel = "stylesheet", type = "text/css", href = "AdminLTE.gerkelab.min.css", media = "screen"),
tags$link(rel = "stylesheet", type = "text/css", href = "_all-skins.gerkelab.min.css", media = "screen"),
tags$link(rel = "stylesheet", type = "text/css", href = "epitad.css", media = "screen")
),
chooseSliderSkin("Flat", "#418c7a"),
fluidRow(
box(
title = "Query SNPs", width = 4,
textInput("snpList", "Enter SNP rsIDs (comma separated)", value = "", placeholder = "rs123, rs5574"),
h5(helpText("Upload SNP List (one SNP per line)")),
fileInput("file1", "Choose a file",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
),
tags$hr(),
fluidRow(
column(6, selectInput("pop", "Population", INPUT_CHOICES$population, selected = "EUR")),
column(6, sliderInput("value", "LD threshold", min = 0, max = 1, value = 0.8))
),
tags$hr(),
tags$div(
class = "btn-toolbar",
actionButton("update1", "Perform query", class = "btn-primary", style = "color: #FFFFFF"),
tags$div(
class = "btn-group dropup",
tags$button(
class = "btn btn-default dropdown-toggle",
role = "button",
id = "exampleDropdownMenu",
"data-toggle" = "dropdown",
"aria-haspopup" = "true",
"aria-expanded" = "false",
"Examples", tags$span(class = "caret")
),
tags$ul(
class = "dropdown-menu box-shadow",
"aria-labelledby" = "exampleDropdownMenu",
tags$li("A selection of SNPs that are...", class = "dropdown-header"),
example_url(EXAMPLES$ancestry),
example_url(EXAMPLES$`8q24`),
example_url(EXAMPLES$protective)
)
),
actionButton("btn_info", "", icon = icon("info"),
"data-toggle" = "tooltip", "data-placement" = "right",
title = "Learn more about epiTAD"),
bookmarkButton(class = "pull-right")
)
),
tabBox(
title = "", width = 8,
tabPanel(
"Figure",
withSpinner(plotlyOutput("megaPlot", height = "600px")),
tags$br(),
tags$div(
# plot controls panel group ----
class = "panel-group", id = "plot-controls", role = "tablist", "aria-multiselectable" = "true",
tags$div(
class = "panel panel-default",
tags$div(
# plot controls panel heading ----
class = "panel-heading", role = "tab", id = "plot-controls-heading",
tags$h5(
class = "panel-title",
tags$a("Plot Options", href = "#plot-controls-body",
class = "collapsed", role = "button",
"data-toggle" = "collapse", "data-parent" = "#plot-controls",
"aria-expanded" = "false", "aria-controls" = "plot-controls-body")
)
# plot controls panel heading end ----
),
tags$div(
# plot controls panel body wrapper ----
id = "plot-controls-body", role = "tabpanel", "aria-labelledby" = "plot-controls-heading",
class = "panel-collapse collapse",
tags$div(
# plot controls panel body ----
class = "panel-body",
helpText("Coordinates must be at least 200000 BP apart"),
fluidRow(
# plot controls input row ----
column(4, numericInput("plotStartBP", label = "Starting Coordinates (BP)", value = 0)),
column(4, numericInput("plotEndBP", label = "Ending Coordinates (BP)", value = 0)),
column(4,
selectizeInput("plotColor", "Color Scheme",
choices = list(
"Viridis" = list(
"Viridis",
"Magma",
"Plasma",
"Inferno",
"Cividis"
),
"Viridis Reversed" = list(
"Viridis (Reverse)" = "viridis rev",
"Magma (Reverse)" = "magma rev",
"Plasma (Reverse)" = "plasma rev",
"Inferno (Reverse)" = "inferno rev",
"Cividis (Reverse)" = "cividis rev"
),
"Other Palettes" = list(
"Topo",
"Rainbow",
"Heat",
"Terrain",
"CM"
)
), multiple = FALSE, selected = "Viridis"
)
)
# plot controls input row end ----
),
tags$div(
# plot-controls button group ----
class = "btn-group",
actionButton("updateBP", "Update Coordinates"),
actionButton("resetBP", "Reset Plot"),
actionButton("showgenes","Toggle gene names"),
downloadButton("plotDownload", "Download Plot")
# plot controls button group end ----
)
# plot controls panel body end ----
)
# plot controls panel body wrapper end ----
)
)
# plot controls panel group end ----
)
),
tabPanel(
"Links",
uiOutput("clinical1"),
uiOutput("ucsc1")
),
tabPanel(
"Download",
tags$p("Use the button below to download all tables in a single excel file"),
downloadButton("download_all", "Download all")
)
)
),
fluidRow(
tabBox(
title = "Variant Annotation",
tabPanel(
"HaploReg",
tags$div(
tags$div(
# haploreg controls panel group ----
class = "panel-group", id = "haploreg-controls", role = "tablist", "aria-multiselectable" = "true",
tags$div(
class = "panel panel-default",
tags$div(
# haploreg controls panel heading ----
class = "panel-heading", role = "tab", id = "haploreg-controls-heading",
tags$h5(
class = "panel-title",
tags$a("Additional annotations", href = "#haploreg-controls-body",
class = "collapsed", role = "button",
"data-toggle" = "collapse", "data-parent" = "#haploreg-controls",
"aria-expanded" = "false", "aria-controls" = "haploreg-controls-body")
)
# haploreg controls panel heading end ----
),
tags$div(
# haploreg controls panel body wrapper ----
id = "haploreg-controls-body", role = "tabpanel", "aria-labelledby" = "haploreg-controls-heading",
class = "panel-collapse collapse",
tags$div(
# haploreg controls panel body ----
class = "panel-body",
fluidRow(
# haploreg controls input row ----
column(12, checkboxGroupInput("parameters", "", INPUT_CHOICES$HaploR, inline = TRUE, selected = c("query_snp_rsid", "pos_hg38", "r2")))
# haploreg controls input row end ----
)
# haploreg controls panel body end ----
)
# haploreg controls panel body wrapper end ----
)
)
# haploreg controls panel group end ----
)
),
tags$hr(),
withSpinner(DT::dataTableOutput("LDtable1"), proxy.height = "395px")
),
tabPanel(
"RegulomeDB",
tags$div(
tags$div(
# regulomedb controls panel group ----
class = "panel-group", id = "regulomedb-controls", role = "tablist", "aria-multiselectable" = "true",
tags$div(
class = "panel panel-default",
tags$div(
# regulomedb controls panel heading ----
class = "panel-heading", role = "tab", id = "regulomedb-controls-heading",
tags$h5(
class = "panel-title",
tags$a("Remove annotations", href = "#regulomedb-controls-body",
class = "collapsed", role = "button",
"data-toggle" = "collapse", "data-parent" = "#regulomedb-controls",
"aria-expanded" = "false", "aria-controls" = "regulomedb-controls-body")
)
# regulomedb controls panel heading end ----
),
tags$div(
# regulome controls panel body wrapper ----
id = "regulomedb-controls-body", role = "tabpanel", "aria-labelledby" = "regulomedb-controls-heading",
class = "panel-collapse collapse",
tags$div(
# regulome controls panel body ----
class = "panel-body",
fluidRow(
# regulome controls input row ----
column(12, checkboxGroupInput("parameters2", "", INPUT_CHOICES$regulome, selected = c("#chromosome", "coordinate","score")))
# regulomedb controls input row end ----
)
# regulomedb controls panel body end ----
)
# regulomedb controls panel body wrapper end ----
)
)
# regulomedb controls panel group end ----
)
),
tags$hr(),
withSpinner(DT::dataTableOutput("LDtable2"), proxy.height = "395px")
),
tabPanel(
"TADs",
withSpinner(textOutput("tadBoundaries"), proxy.height = "395px"),
uiOutput("hic1")
)
),
tabBox(
title = "Gene Annotation",
tabPanel(
"ENSEMBL",
h5(helpText("Genes spanned by the greater of the LD or TAD region")),
withSpinner(DT::dataTableOutput("geneTable"), proxy.height = "395px")
),
tabPanel(
"Oncotator",
tags$div(
tags$div(
# oncotator controls panel group ----
class = "panel-group", id = "oncotator-controls", role = "tablist", "aria-multiselectable" = "true",
tags$div(
class = "panel panel-default",
tags$div(
# oncotator controls panel heading ----
class = "panel-heading", role = "tab", id = "oncotator-controls-heading",
tags$h5(
class = "panel-title",
tags$a("Additional annotations", href = "#oncotator-controls-body",
class = "collapsed", role = "button",
"data-toggle" = "collapse", "data-parent" = "#oncotator-controls",
"aria-expanded" = "false", "aria-controls" = "oncotator-controls-body")
)
# oncotator controls panel heading end ----
),
tags$div(
# oncotator controls panel body wrapper ----
id = "oncotator-controls-body", role = "tabpanel", "aria-labelledby" = "oncotator-controls-heading",
class = "panel-collapse collapse",
tags$div(
# oncotator controls panel body ----
class = "panel-body",
checkboxGroupInput("oncoParameters1", "General", INPUT_CHOICES$onco$general, inline = TRUE),
checkboxGroupInput("oncoParameters2", "Cancer Gene Census", INPUT_CHOICES$onco$cancer_gene_census, inline = TRUE),
checkboxGroupInput("oncoParameters3", "HUGO Gene Nomenclature Committee", INPUT_CHOICES$onco$hugo_gene_nomenclature, inline = TRUE),
checkboxGroupInput("oncoParameters4", "UniProt", INPUT_CHOICES$onco$uniprot, inline = TRUE)
# oncotator controls panel body end ----
)
# oncotator controls panel body wrapper end ----
)
)
# oncotator controls panel group end ----
)
),
tags$hr(),
withSpinner(DT::dataTableOutput("oncoTable"), proxy.height = "395px")
),
tabPanel(
"eQTL",
tags$div(
tags$div(
# eqtl controls panel group ----
class = "panel-group", id = "eqtl-controls", role = "tablist", "aria-multiselectable" = "true",
tags$div(
class = "panel panel-default",
tags$div(
# eqtl controls panel heading ----
class = "panel-heading", role = "tab", id = "eqtl-controls-heading",
tags$h5(
class = "panel-title",
tags$a("Tissues", href = "#eqtl-controls-body",
class = "collapsed", role = "button",
"data-toggle" = "collapse", "data-parent" = "#eqtl-controls",
"aria-expanded" = "false", "aria-controls" = "eqtl-controls-body")
)
# eqtl controls panel heading end ----
),
tags$div(
# eqtl controls panel body wrapper ----
id = "eqtl-controls-body", role = "tabpanel", "aria-labelledby" = "eqtl-controls-heading",
class = "panel-collapse collapse",
tags$div(
# eqtl controls panel body ----
class = "panel-body",
fluidRow(
# eqtl controls input row ----
column(12,uiOutput("eTissues"))
# eqtl controls input row end ----
)
# eqtl controls panel body end ----
)
# eqtl controls panel body wrapper end ----
)
)
# eqtl controls panel group end ----
)
),
tags$hr(),
tags$div(
style = "min-height: 1.5em",
DT::dataTableOutput("eTable1")
),
uiOutput("eqtl1")
)
)
)
)
)
}