-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
340 lines (319 loc) · 11.9 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
##------------ Biotools ddRAD ---------------##
################# UI Mainpage #################
### fresh create theme
mytheme <- create_theme(
bs4dash_vars(
navbar_light_color = "#BEC5CB",
navbar_light_active_color = "#FFF",
navbar_light_hover_color = "#FFF"
),
bs4dash_yiq(
contrasted_threshold = 10,
text_dark = "#FFF",
text_light = "#272c30"
),
bs4dash_layout(
sidebar_width = "320px"
),
bs4dash_sidebar_light(
bg = "#C3D1CF",
color = "#5C5D5F",
hover_color = "#FFF",
submenu_bg = "#DEDEDE",
submenu_color = "#FFF",
submenu_hover_color = "#FFF"
),
bs4dash_status(
primary = "#829EB0",
danger = "#BF616A",
warning = "#BCB471",
success = "#7AA291",
light = "#96A2A2"
),
bs4dash_color(
navy = "#447277",
lightblue = "#8A9DBA",
purple = "#7C609B",
fuchsia = "#98987A",
maroon = "#877584",
teal = "#60847E",
lime = "#A5DB9D"
)
)
###
dashboardPage(
## preloader use waiter package
preloader = list(html = tagList(spin_terminal(),
h4("loading...")
), color = "#405452"),
fullscreen = TRUE,
scrollToTop = TRUE,
### Header
header = dashboardHeader(
## Navbar
status = "success",
title = dashboardBrand(
title = shiny::tags$span("igvShiny_TestApp",
style = "font-weight: 400; color: white; font-size: 26px"),
color = "teal",
opacity = 0.8)
),
###
###### Siderbar ######
sidebar = dashboardSidebar(
skin = "light",
## User panel
sidebarUserPanel(
name = a("igvShiny_TestApp",style = "font-size: 130%;")
),
## Siderbar Menu
bs4SidebarMenu(
id = "sidebar_menu",
bs4SidebarMenuItem(
"_1. Genome Select",
tabName = "basic_genome_info",
icon = icon("question-circle")
),
bs4SidebarMenuItem(
"_2. Genome Viewer",
tabName = "genome_viewer",
icon = icon("chart-bar")
),
bs4SidebarMenuItem(
"_ Version Log",
tabName = "version_log",
icon = icon("book")
))
),
###### Body ######
body = dashboardBody(
##------ fresh theme --------##
use_theme(mytheme),
##------ Body setting -------##
# dark datatable setting
uiOutput('datatable_darkcontrol'),
# idel control
shiny::tags$script(inactivity),
# head tag
shiny::tags$head(shiny::tags$link(rel = "icon", type = "image/png", href = "favicon.png")),
# echarts4r theme
# e_theme_register(echarts_dark_theme$options, name = "dark_theme"),
useShinyalert(),
# shinyJS
useShinyjs(),
shinyjs::extendShinyjs(text = "shinyjs.clickpin = function(){$('#controlbarPin').click()}",functions = c("clickpin")),
# include shinyFeedback
useShinyFeedback(),
# Add cutstom css to wider Modal
includeCSS(path = "www/custom.css"),
# Add cutstom javascript to Busy disable button
includeScript('www/shinycustom.js'),
# Cicerone
use_cicerone(),
# Waiter
useWaiter(),
## sliderbar
chooseSliderSkin(skin = "Shiny",color = "#669999"),
#setSliderColor(c("#669999","#669999"),c(1,2)),
##------ Body content -------##
tabItems(
##--- Page 1 Basic Info & Genome Select ---####
tabItem(
tabName = "basic_genome_info",
### Info Table and Select Control
fluidRow(
box(
title = "Genome Info Table",
status = "teal",
solidHeader = TRUE,
width = 9, height = 600, elevation = 2,
DTOutput('basic_genome_info_DT')
),
box(
title = "Select Genome Control Panel",
background = "teal",
width = 3, height = 600, elevation = 2,
uiOutput('basic_genome_info_genome_select_ui'),
uiOutput('basic_genome_info_genome_ref_select_ui'),
hr(),
shiny::actionButton('basic_genome_info_select_check',label ="Check Genome", icon("play-circle"),width = "100%",
style="color: #fff; background-color: #BD9D9D; border-color: #BD9D9D;", class = "bttn-simple" )
)
),
### Genome Info karyoplote
fluidRow(
box(
id = "basic_genome_info_karyoplote",
title = "Genome Information plot",
status = "teal",
solidHeader = TRUE,
width = 12, height = 800, elevation = 2,
plotOutput('basic_genome_info_karyoplote_plot',height = 750,width = 900),
##
sidebar = boxSidebar(
id = "basic_genome_info_karyoplote_sidebar",
background = "#5D655E",
startOpen = TRUE,easyClose = FALSE,
width = 30,
column(width = 10,
h5("karyoplote Parameter:"),
uiOutput('basic_genome_info_karyoplote_chr_ui'),
radioGroupButtons(
'basic_genome_info_karyoplote_addtrack',
label = "Add Plot Track",
selected = "None",
status = "primary",
size = "normal",
direction = "vertical",
justified = TRUE,
individual = FALSE,
checkIcon = list(
yes = icon("check-square"),
no = icon("square")
),
width = 250,
choices = c("None","Add ATCG Content"),
disabled = FALSE
),
pickerInput(
inputId = 'basic_genome_info_karyoplote_binwidth',
label = "Heatmap Bin width",
selected = 1000000,
choices = c(100000,500000,1000000,5000000)),
## ATCG color node
shiny::tags$label(class = "control-label","ATCG color palette select"),
fluidRow(
column(width = 3,
colourpicker::colourInput(
label = "A",
inputId = 'basic_genome_info_karyoplote_a_color',
value = "#E27E72"
)
),
column(width = 3,
colourpicker::colourInput(
label = "T",
inputId = 'basic_genome_info_karyoplote_t_color',
value = "#72A3E2"
)
),
column(width = 3,
colourpicker::colourInput(
label = "C",
inputId = 'basic_genome_info_karyoplote_c_color',
value = "#72E281"
)
),
column(width = 3,
colourpicker::colourInput(
label = "G",
inputId = 'basic_genome_info_karyoplote_g_color',
value = "#EBDA70"
)
)
),
hr(),
shiny::downloadButton(style="color: #fff; background-color: #4D72A9; border-color: #4D72A9;",
class = "bttn-simple",outputId = 'basic_genome_info_karyoplote_plot_dl',label = "Download Plot")
)
)
)
)
),
####--- Page 2 Genome Viewer ---####
tabItem(
tabName = "genome_viewer",
# Target Region Info
fluidRow(
box(title = "Target Fragment Position Info",
status = "maroon",
solidHeader = TRUE,
width = 8, height = 600, elevation = 2,
DTOutput('simulation_check_igvinfo_DT',height = 520)
),
box(title = "Target Fragment IGV Track Control",
background = "maroon",
solidHeader = TRUE,
width = 4, height = 600, elevation = 2,
h5("You can upload simuation bam or small test library bam to check match in silico result.
(Advice bam file small than 500 Mb.) and needs upload index bai file."),
fileInput('simulation_check_bam_file',"Input Simulate BAM and BAI File select:",
multiple = TRUE, accept = c(".bam",".bai"),
width = NULL, buttonLabel = "Browse...",
placeholder = "No file selected"),
hr(),
shiny::actionButton('simulation_check_add_gene_track',label ="Add Gene Tracks Info", icon("water"),width = 250,
style="color: #fff; background-color: #C68841; border-color: #C68841;", class = "bttn-simple" )
)
),
fluidRow(
box(title = "Target Fragment Position Info",
status = "maroon",
solidHeader = TRUE,
width = 12, height = 700, elevation = 2,
igvShinyOutput('igvShiny_0'))
),
## BAM Summary Info
fluidRow(
## Summary plot
tabBox(
title = "Input Simulation BAM Summary Plot",
id = "simulation_check_bam_summary_plot_tabbox",
status = "maroon",
side = "right",
type = "pills",
width = 7, height = 655, elevation = 2,
selected = "MAPQ Distribution",solidHeader = TRUE,
tabPanel(
title = "MAPQ Distribution",
ggplotZoomDownloadUI('bam_mapq_distribution_plot', height = 550)
)
)
)
),
#===================================#
####--- Page Version Log ---####
tabItem(
tabName = "version_log",
fluidRow(
bs4ValueBox(
value = shiny::tags$p(0, style = "font-size: 180%;"),
elevation = 4,width = 3,
subtitle = "Total Usage Count",
color = "primary",gradient = TRUE,
icon = icon("user-friends")
),
bs4ValueBox(
value = shiny::tags$p(paste0(0," mins"), style = "font-size: 180%;"),
elevation = 4,width = 3,
subtitle = "Total Usage Time",
color = "olive",gradient = TRUE,
icon = icon("user-clock")
)
),
fluidRow(
box(
id = "version_log_box",
title = "Version log",elevation = 2,
status = "warning",width = 6,height = 600,solidHeader = TRUE,
p("Version Number : First : Important change or Server upload ;"),
p("Second : Module add or Big change ; Third : Bug fixed or Slightly change."),
reactableOutput('version_log_reactable')
)
),
fluidRow(
box(
id = "vsession_package_info_box",
title = "Package session info",elevation = 2,
status = "primary",width = 6,height = 600,solidHeader = TRUE,
p("Session Package version."),
p("Group package by source and use."),
reactableOutput('session_package_info')
)
)
)
)
),
### Footer
footer = bs4DashFooter(left = "created by Biotools BioInfo."),
)