-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbowtie2_ui.R
More file actions
472 lines (462 loc) · 13.5 KB
/
bowtie2_ui.R
File metadata and controls
472 lines (462 loc) · 13.5 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
library(shiny)
library(shinyjs)
library(shinyBS)
library(shinydashboard)
bowtie2_tab <- fluidRow(
column(
width = 9,
id = "main",
box(
width = NULL,
solidHeader = TRUE,
fluidRow(
column(
width = 4,
div(id = "indexSelect",
selectizeInput(
"index",
label = NULL,
options = list(placeholder = "Select Index"),
choices = NULL
))
),
column(
width = 8,
conditionalPanel(
condition = "input.readsAreSequences && input.paired == 'Paired'",
div(
id = "pairedInputSequence",
textAreaInput(
"mate1_sequence",
label = NULL,
placeholder = "Enter mate 1 sequence",
resize = "vertical"
),
textAreaInput(
"mate2_sequence",
label = NULL,
placeholder = "Enter mate 2 sequence",
resize = "vertical"
)
)
)
),
column(
width = 8,
conditionalPanel(
condition = "!input.readsAreSequences && input.paired == 'Paired'",
div(id = "pairedInputFile",
fileInput(
"mate1",
label = NULL,
placeholder = "Select reads for mate 1",
accept = c(
"text/plain",
".fa",
".fq"
),
multiple = FALSE
),
fileInput(
"mate2",
label = NULL,
placeholder = "Select reads for mate 2",
accept = c(
"text/plain",
".fa",
".fq"
),
multiple = FALSE
)
)
)
),
conditionalPanel(condition = "input.readsAreSequences && input.paired == 'Unpaired'",
column(
width = 8,
div(
id = "unpairedInputSequence",
textAreaInput(
"unpaired_sequence",
label = NULL,
placeholder = "Enter sequence",
resize = "horizontal"
)
)
)),
conditionalPanel(condition = "!input.readsAreSequences && input.paired == 'Unpaired'",
column(
width = 8,
div(
id = "unpairedInputFile",
fileInput(
"unpaired",
label = NULL,
placeholder = "Select unpaired reads",
accept = c(
"text/plain",
".fa",
".fq"
),
multiple = FALSE
)
)
))
),
a(id = "toggleCommand", "Show command"),
hidden(div(
id = "cmd_line",
textAreaInput(
inputId = "bt2Options",
label = NULL,
resize = "vertical"
)
)),
fluidRow(column(12,
div(
style = "display:inline-block",
bsButton("submit",
"Submit Query",
style = "primary",
icon = icon("play"))
),
div(
style = "display:inline-block",
hidden(uiOutput("clip"))
)
))
# div(style = "display: inline-block;",
# actionButton("runAligner", label = "Run Alignment", icon = icon("play"), color = "green"))
),
box(width = NULL,
tabsetPanel(
id = "bowtie2tabs",
tabPanel(
"Welcome",
h4("Welcome to the Bowtie 2 UI!"),
p(
"This is our first attempt at a web interface for the Bowtie family
of aligners. Is this useful to you? Do you see the reference
genomes that are important to you? Is the so-called \"CRISPR\" app
useful to you? Would other apps be useful? We are eager for
feedback. Please click the GitHub icon toward the upper-right to
go to the repo and request features and report feedback and issues."
),
h5("What is Bowtie2?"),
p(
tags$b("Bowtie 2"),
"is an ultrafast, memory-efficient short read aligner.
It aligns short DNA sequences (reads) to the human genome
at a rate of over 25 million 35-bp reads per hour.
Bowtie indexes the genome with an FM index to keep its
memory footprint small: typically about 2.2 GB for the
human genome (2.9 GB for paired-end)."
),
p("Click the tutorial button below to get started"),
bsButton("tutorial", label = "Get Started", style = "success")
)
), absolutePanel(
id = "bowtie2panel",
top = 0,
right = 0,
hidden(div(
id = "bowtie2controls",
style = "padding: 10px;",
downloadButton("bt2DownloadSAM", "Download"),
actionButton(
"bt2ToggleHighlight",
"Toggle Highlight",
icon = icon("palette")
)
)
))),
bsAlert("alert")
),
column(
width = 3,
# Input options
div(id = "formatOptions",
box(
width = NULL,
title = "Input",
status = "warning",
collapsible = TRUE,
# -c
checkboxInput("readsAreSequences", label = "Reads are sequences, not files"),
selectInput(
"inputFileFormat",
label = h5("Input File Format"),
choices = list(
"FASTQ" = "-q",
"FASTA" = "-f"
# temporarily disabled
# "TAB5" = "--tab5",
# "TAB6" = "--tab6",
# "QSEQ" = "--qseq"
),
selected = "-q"
),
radioButtons(
inputId = "paired",
label = NULL,
choices = list("Paired", "Unpaired"),
selected = "Paired",
inline = TRUE
),
radioButtons(
inputId = "typeOfQualityValues",
label = h5("Type of Quality Values"),
choices = list(
"Phred 33" = "--phred33",
"Phred 64" = "--phred64",
"Integer Qualities" = "--int-quals"
),
selected = "--phred33",
inline = FALSE
),
numericInput(
inputId = "skip",
label = h5("skip the first <int> reads/pairs in the input"),
value = 0,
min = 0
),
numericInput(
inputId = "upto",
label = h5("stop after first <int> reads/pairs"),
value = 50,
min = 0,
max = 500
),
numericInput(
inputId = "trim5",
label = h5("trim <int> bases from 5'/left end of reads"),
value = 0,
min = 0
),
numericInput(
inputId = "trim3",
label = h5("trim <int> bases from 3'/right end of reads"),
value = 0,
min = 0
)
)
),
# Alignment options
div(id = "alnAlgOptions",
box(
width = NULL,
title = "Alignment",
status = "success",
collapsible = TRUE,
radioButtons(
inputId = "alignmentType",
label = NULL,
choices = list("End-to-end" = "--end-to-end", "Local" = "--local"),
selected = "--end-to-end",
inline = TRUE
),
conditionalPanel(
condition = "input.alignmentType == '--end-to-end'",
radioButtons(
inputId = "endToEndPresets",
label = NULL,
choices = list(
"Very fast" = "--very-fast",
"Fast" = "--fast",
"Sensitive" = "--sensitive",
"Very sensitive" = "--very-sensitive"
),
selected = "--sensitive"
)
),
conditionalPanel(
condition = "input.alignmentType == '--local'",
radioButtons(
inputId = "localPresets",
label = NULL,
choices = list(
"Very fast" = "--very-fast-local",
"Fast" = "--fast-local",
"Sensitive" = "--sensitive-local",
"Very sensitive" = "--very-sensitive-local"
),
selected = "--sensitive-local"
)
),
sliderInput(
"seedLen",
label = h5("Seed Length"),
min = 4,
max = 31,
value = 22
),
textInput(
"interval",
label = h5("Interval between seed substrings w/r/t read length"),
value = "S,1,1.15"
),
textInput(
"nCeil",
label = h5("func for max # non-A/C/G/Ts permitted in aln"),
value = "L,0,0.15"
),
numericInput(
"maxMM",
label = h5("Max # of mismatches in seed alignment"),
value = 0,
min = 0,
max = 1
),
numericInput(
"dPad",
label = h5("Extra ref chars to include on sides of DP table"),
value = 15
),
numericInput(
"gBar",
label = h5("Disallow gaps within <int> nucleotides of read extremes"),
value = 4
),
checkboxInput("ignoreQuals", label = "Treat all quality values as 30 on Phred scale"),
checkboxInput("noFw", label = "Do not align forward (original) version of read"),
checkboxInput("noRc", label = "Do not align reverse-compliment version of read"),
checkboxInput("no1MmUpfront", label = "Do not allow 1 mismatch alignments before attempting to scan for the optimal seeded alignments")
)
),
# Scoring options
div(id = "scoringFuncOptions",
box(
width = NULL,
title = "Scoring",
status = "primary",
collapsible = TRUE,
conditionalPanel(
condition = "input.alignmentType == '--end-to-end'",
numericInput(
"matchBonus",
label = h5("Match bonus"),
min = 0,
value = 0
),
textInput(
"scoreMin",
label = h5("Min acceptable alignment score w/r/t read length"),
value = "L,-0.6,-0.6"
)
),
conditionalPanel(
condition = "input.alignmentType == '--local'",
numericInput(
"matchBonus",
label = h5("Match bonus"),
min = 0,
value = 2
),
textInput(
"scoreMin",
label = h5("Min acceptable alignment score w/r/t read length"),
value = "G,20,8"
)
),
numericInput(
"maxPenalty",
label = h5("Max penalty for mismatch; lower quality = lower penalty"),
min = 0,
value = 6
),
numericInput(
"nPenalty",
label = h5("Penalty for non-A/C/G/Ts in read/reference"),
value = 1
)
)
),
# Reporting
# box(width = NULL, title = "Reporting", collapsible = TRUE, collapsed = TRUE,
# radioButtons(inputId = "reporting", label = NULL,
# choices = list("Default" = "", "Report up to "))
# ),
# Effort
box(
width = NULL,
title = "Effort",
collapsible = TRUE,
collapsed = TRUE,
numericInput(
"extendAttempts",
label = h5("Give up extending after <int> failed extends in a row"),
value = 15
),
numericInput(
"seedCount",
label = h5("For reads w/ repetitive seeds, try <int> sets of seeds"),
value = 2
)
),
conditionalPanel(
condition = "input.paired == 'Paired'",
box(
width = NULL,
title = "Paired-end",
collapsible = TRUE,
collapsed = TRUE,
numericInput(
"minIns",
label = h5("Minimum fragment length"),
value = 0
),
numericInput(
"maxIns",
label = h5("Maximum fragment length"),
value = 500
),
radioButtons(
"mateAlign",
label = h5("Mate alignment"),
choices = list(
"fw/rev" = "--fr",
"rev/fw" = "--rf",
"fw/fw" = "--ff"
),
selected = "--fr"
),
checkboxInput("noMixed", "Suppress unpaired alignments for paired reads"),
checkboxInput(
"noDiscordant",
"Suppress discordant alignments for paired reads"
),
checkboxInput("doveTail", "Concordant when mates extend past each other"),
checkboxInput(
"noContain",
"Not concordant when one mate alignment contains other"
),
checkboxInput("noOverlap", "Not concordant when mates overlap at all")
)
),
# Output options
div(id = "outputOptions",
box(
width = NULL,
title = "Output",
status = "info",
collapsible = TRUE,
checkboxInput(
"omitSecSeq",
"Put '*' in SEQ and QUAL fields for secondary alignments"
),
checkboxInput(
"samNoQnameTrunc",
"Suppress standard behaviour of truncating read name at first whitespace at the expense of generating non-standard SAM"
),
checkboxInput(
"xEq",
"Use =/X, instead of M, to specify matches/mismatches in SAM record"
),
checkboxInput(
"softClippedUnmappedTlen",
"Exclude soft-clipped bases when reporting TLEN"
)
)
)
)
)