-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathui.R
197 lines (152 loc) · 7.85 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
library(shiny)
library(shinyBS)
library(shinysky)
library(shinyjs)
library(V8)
library(shinythemes)
library(plotly)
shinyUI(fluidPage(
#CSS style specification
theme = shinytheme("united"),
tags$style(HTML("
.shiny-output-error { visibility: hidden; }
.shiny-output-error:before {
visibility: visible;
color: orangered;
content: 'ERROR. An error has occurred. Please contact the app authors at [email protected] or submit your bug-reports at https://github.com/marcos-diazg/musica/issues.'; }
}
")),
#Error management
uiOutput("custom_error"),
#Activation of Shiny js
useShinyjs(),
shinyjs::extendShinyjs(text = "shinyjs.refresh = function() { location.reload(); }",functions="refresh"),
#Title
titlePanel(title=div(img(src="musica.png"),"\t\tMutational Signatures in Cancer"),windowTitle = "MuSiCa - Mutational Signatures in Cancer"),
sidebarLayout(
sidebarPanel(
#Input format
radioButtons("datatype", "Input file format", c("VCF","TSV","Excel","MAF"),selected = "VCF",inline = TRUE),
#Help menu for format of input file
actionLink("helpformat","Help with input file format", icon=icon("question-circle-o")),
bsModal("modal","HELP Input file format","helpformat", includeHTML("./aux_files/help_with_input.html")),
hr(),
#File uploading
fileInput("fileinput","Upload your file/s", multiple=TRUE),
hr(),
#Genome selection
selectInput("genome","Reference genome",c("UCSC GRCh38/hg38"="hg38","UCSC GRCh37/hg19"="19","1000genomes hs37d5"="37"),selected="hg38"),
hr(),
#Type of Study
radioButtons("studytype","Type of study", c("Whole Genome Sequencing", "Whole Exome Sequencing", "Targeted Sequencing")),
uiOutput("kb_sequenced"),
hr(),
uiOutput("run_button"),
#Stuff only showed when run button is pressed
hidden(
div(id="after_run",
br(),
br(),
#Sample selection for plots (post push run)
uiOutput("mean_checkbox"),
uiOutput("custom_error_style"),
uiOutput("selected_samples"),
#Cancer type selection for plots (post push run)
uiOutput("selected_cancer_types"),
hr(),
uiOutput("col_dendro_heatmap"),
uiOutput("row_dendro_heatmap"),
uiOutput("col_dendro_cancers"),
uiOutput("row_dendro_cancers"),
uiOutput("heatmap_sample_names"),
#uiOutput("error_input"),
#Clear button
actionButton("clear","Clear")
)
)
),
#Hidding tabs of mainpanel (results)
hidden(
mainPanel(id="mainpanel",
tabsetPanel(id="tab", type="pills",
#Somatic Mutation Prevalence
tabPanel("Somatic mutation prevalence",value="smp",
br(),
downloadButton("download_smp_plot_ID",label="Download plot"),
bsModal("modal_smp","Download plot","download_smp_plot_ID",
radioButtons("type_smp_plot","Format",c("pdf","png","tiff"),selected="pdf"),
downloadButton("download_smp_plot","OK")),
downloadButton("download_smp_table",label="Download table"),
p(),
plotOutput("smp")
),
#Plot profile 96 changes
tabPanel("Mutational profile",value="96prof",
br(),
downloadButton("download_prof96_plot_ID",label="Download plot"),
bsModal("modal_prof96","Download plot","download_prof96_plot_ID",
radioButtons("type_prof96_plot","Format",c("pdf","png","tiff"),selected="pdf"),
downloadButton("download_prof96_plot","OK")),
downloadButton("download_prof96_table",label="Download table"),
p(),
plotOutput("prof96")
),
#Contribution of COSMIC mutational signatures (heatmap and table)
tabPanel("COSMIC signatures contributions", value="contrib",
br(),
downloadButton("download_signatures_plot_ID",label="Download plot"),
bsModal("modal_signatures","Download plot","download_signatures_plot_ID",
radioButtons("type_signatures_plot","Format",c("pdf","png")),
downloadButton("download_signatures_plot","OK")),
downloadButton("download_contr",label="Download table"),
p(),
fluidRow(plotlyOutput("heatmap_signatures",width="100%", height="800px")),
p(),
dataTableOutput("contr")
),
#
#Reconstructed mutational profile
tabPanel("Reconstructed mutational profile", value="reconst",
tags$style(HTML(".shiny-output-error-reconstructed {visibility: hidden;}
.shiny-output-error-reconstructed:before {visibility: visible; color: orangered; content:'Sample selection error, please select just one sample at a time to visualize its reconstructed mutational profile.';}")),
br(),
downloadButton("download_reconst_plot_ID",label="Download plot"),
bsModal("modal_reconst","Download plot","download_reconst_plot_ID",
radioButtons("type_reconst_plot","Format",c("pdf","png","tiff"),selected="pdf"),
downloadButton("download_reconst_plot","OK")),
downloadButton("download_reconst_table",label="Download table"),
p(),
plotOutput("reconst")
),
#Comparison of COSMIC mutational signatures with cancers
tabPanel("Comparison with cancers signatures", value="comp_canc_sign",
br(),
downloadButton("download_known_plot_ID",label="Download plot"),
bsModal("modal_known","Download plot","download_known_plot_ID",
radioButtons("type_known_plot","Format",c("pdf","png")),
downloadButton("download_known_plot","OK")),
p(),
fluidRow(plotlyOutput("heatmap_known",width="100%", height="800px"),
img(src="legend.png",width=400))
),
#Principal Component Analysis (PCA)
tabPanel("Principal components analysis", value="pca",
tags$style(HTML(".shiny-output-error-pca {visibility: hidden;}
.shiny-output-error-pca:before {visibility: visible; color: orangered; content:'PCA analysis works only with 3 or more samples.';}")),
br(),
downloadButton("download_pca_ID",label="Download plot"),
downloadButton("download_pca_table",label="Download table"),
bsModal("modal_pca","Download plot","download_pca_ID",
radioButtons("type_pca_plot","Format",c("pdf","png","tiff")),
downloadButton("download_pca_plot","OK")),
p(),
fluidRow(
column(4,tableOutput("pca_plot_table")),
column(8,plotOutput("pca_plot",height=650,width=650))
)
)
)
)
)
)
))