File: flexbar.xml

package info (click to toggle)
flexbar 1%3A3.5.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 720 kB
  • sloc: cpp: 3,524; xml: 603; sh: 128; perl: 51; makefile: 18
file content (739 lines) | stat: -rw-r--r-- 26,464 bytes parent folder | download | duplicates (3)
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

<!-- Flexbar tool definition for Galaxy, version 3.5.0 -->
<!-- Author: Johannes Roehr -->


<tool id="flexbar" name="Flexbar" version="3.5.0">
	
	<description>- flexible barcode and adapter removal</description>
    
	<requirements>
        <requirement type="package" version="3.5.0">flexbar</requirement>
    </requirements>
	
	<version_command>flexbar --versions</version_command>
	
	<command detect_errors="aggressive">
		
		<![CDATA[
		
		#if $reads.mode == "se":
			ln -s '$reads.rs' '$outlog'_input1.'$reads.rs.extension' &&
		#elif $reads.mode == "pe":
			ln -s '$reads.r1' '$outlog'_input1.'$reads.r1.extension' &&
			ln -s '$reads.r2' '$outlog'_input2.'$reads.r2.extension' &&
		#else:
			ln -s '$reads.rc.forward' '$outlog'_input1.'$reads.rc.forward.extension' &&
			ln -s '$reads.rc.reverse' '$outlog'_input2.'$reads.rc.reverse.extension' &&
		#end if
		
		#if $cBarcodes.select == "on":
			
			mkdir flexbar_barcoded &&
			
			#if $cBarcodes.bAdvanced.cbReads.select == "yes":
				ln -s '$cBarcodes.bAdvanced.cbReads.bReads' '$outlog'_input3.'$cBarcodes.bAdvanced.cbReads.bReads.extension' &&
			#end if
		#end if
		
		
		'$__tool_directory__/flexbar.pl' flexbar
		
		--threads \${GALAXY_SLOTS:-1}
		
		#if $reads.mode == "se":
			--reads '$outlog'_input1.'$reads.rs.extension'
		#elif $reads.mode == "pe":
			--reads '$outlog'_input1.'$reads.r1.extension'
			--reads2 '$outlog'_input2.'$reads.r2.extension'
		#else:
			--reads '$outlog'_input1.'$reads.rc.forward.extension'
			--reads2 '$outlog'_input2.'$reads.rc.reverse.extension'
		#end if
		
		--max-uncalled $maxUncalled
		--min-read-length $minReadLen
		
		#if $trimEnds.select == "on":
			--pre-trim-left $trimEnds.trimLeft
			--pre-trim-right $trimEnds.trimRight
		#end if
		
		
		#if $cTrimQual.select != "off":
			#if $reads.mode == "se":
				#if $reads.rs.ext == "fastqsanger":
					--qtrim-format sanger
				#end if
				#if $reads.rs.ext == "fastqsolexa":
					--qtrim-format solexa
				#end if
				#if $reads.rs.ext == "fastqillumina":
					--qtrim-format i1.3
				#end if
			#elif $reads.mode == "pe":
				#if $reads.r1.ext == "fastqsanger":
					--qtrim-format sanger
				#end if
				#if $reads.r1.ext == "fastqsolexa":
					--qtrim-format solexa
				#end if
				#if $reads.r1.ext == "fastqillumina":
					--qtrim-format i1.3
				#end if
			#else:
				#if $reads.rc.forward.ext == "fastqsanger":
					--qtrim-format sanger
				#end if
				#if $reads.rc.forward.ext == "fastqsolexa":
					--qtrim-format solexa
				#end if
				#if $reads.rc.forward.ext == "fastqillumina":
					--qtrim-format i1.3
				#end if
			#end if
		#end if
		
		#if $cTrimQual.select == "tail":
			--qtrim TAIL
			--qtrim-threshold $cTrimQual.trimQualTail
			$cTrimQual.trimQualPostTail
		#end if
		#if $cTrimQual.select == "win":
			--qtrim WIN
			--qtrim-threshold $cTrimQual.trimQualWin
			--qtrim-win-size $cTrimQual.trimQualWinSize
			$cTrimQual.trimQualPostWin
		#end if
		#if $cTrimQual.select == "bwa":
			--qtrim BWA
			--qtrim-threshold $cTrimQual.trimQualBWA
			$cTrimQual.trimQualPostBWA
		#end if
		
		
		#if $cBarcodes.select == "on":
			
			--target flexbar_barcoded/flexbarOut
			
			#if $cBarcodes.ccBarcodes.select == "file":
				--barcodes $cBarcodes.ccBarcodes.barcodeFile
			#end if
			#if $cBarcodes.ccBarcodes.select == "files":
				--barcodes $cBarcodes.ccBarcodes.barcodeFile1
				--barcodes2 $cBarcodes.ccBarcodes.barcodeFile2
			#end if
			
			--barcode-error-rate $cBarcodes.bThresh
			
			--barcode-trim-end $cBarcodes.bTrimEnd
			
			#if $cBarcodes.bAdvanced.cbReads.select == "yes":
				--barcode-reads '$outlog'_input3.'$cBarcodes.bAdvanced.cbReads.bReads.extension'
			#end if
			
			#if $cBarcodes.bAdvanced.cbMinOverlap.select == "yes":
				--barcode-min-overlap $cBarcodes.bAdvanced.cbMinOverlap.bMinOverlap
			#end if
			
			$cBarcodes.bAdvanced.bKeep
			$cBarcodes.bAdvanced.bUnassigned
			
			#if $cBarcodes.bAdvanced.cbTailLen.select == "yes":
				--barcode-tail-length $cBarcodes.bAdvanced.cbTailLen.bTailLen
			#end if
			
			#if $cBarcodes.bAdvanced.cbAlignScores.select == "yes":
				--barcode-match    $cBarcodes.bAdvanced.cbAlignScores.bMatch
				--barcode-mismatch $cBarcodes.bAdvanced.cbAlignScores.bMismatch
				--barcode-gap      $cBarcodes.bAdvanced.cbAlignScores.bGap
			#end if
		#end if
		
		
		#if $cAdapters.select == "on":
			
			#if $cAdapters.ccAdapters.select == "file":
				--adapters '$cAdapters.ccAdapters.adapterFile'
			#end if
			#if $cAdapters.ccAdapters.select == "files":
				--adapters '$cAdapters.ccAdapters.adapterFile1'
				--adapters2 '$cAdapters.ccAdapters.adapterFile2'
			#end if
			#if $cAdapters.ccAdapters.select == "preset":
				--adapter-preset '$cAdapters.ccAdapters.adapterPreset'
			#end if
			#if $cAdapters.ccAdapters.select == "seq":
				--adapter-seq $cAdapters.ccAdapters.adapterSeq
			#end if
			
			--adapter-trim-end $cAdapters.aTrimEnd
			--adapter-min-overlap $cAdapters.aMinOverlap
			--adapter-error-rate $cAdapters.aThresh
			
			#if $cAdapters.cPairOverlap.select == "on":
				--adapter-pair-overlap $cAdapters.cPairOverlap.aPairOverlap
				--adapter-min-poverlap $cAdapters.cPairOverlap.aMinPoverlap
			#end if
			
			#if $cAdapters.aAdvanced.caTailLen.select == "yes":
				--adapter-tail-length $cAdapters.aAdvanced.caTailLen.aTailLen
			#end if
			
			#if $cAdapters.aAdvanced.cRevComp.select == "on":
				--adapter-revcomp ON
				#if $cAdapters.aAdvanced.cRevComp.aRevCompEnd != "off":
					--adapter-revcomp-end $cAdapters.aAdvanced.cRevComp.aRevCompEnd
				#end if
			#end if
			#if $cAdapters.aAdvanced.cRevComp.select == "only":
				--adapter-revcomp ONLY
			#end if
			
			$cAdapters.aAdvanced.aReadSet
			
			--adapter-cycles $cAdapters.aAdvanced.aCycles
			
			#if $cAdapters.aAdvanced.caAlignScores.select == "yes":
				--adapter-match    $cAdapters.aAdvanced.caAlignScores.aMatch
				--adapter-mismatch $cAdapters.aAdvanced.caAlignScores.aMismatch
				--adapter-gap      $cAdapters.aAdvanced.caAlignScores.aGap
			#end if
		#end if
		
		
		#if $hTrim.select == "on":
			#if $hTrim.hTrimLeft != "":
				--htrim-left $hTrim.hTrimLeft
			#end if
			#if $hTrim.hTrimRight != "":
				--htrim-right $hTrim.hTrimRight
			#end if
			
			--htrim-min-length $hTrim.hMinLength
			--htrim-error-rate $hTrim.hErrorRate
			
			#if $hTrim.hAdvanced.hMinLength2 != "":
				--htrim-min-length2 $hTrim.hAdvanced.hMinLength2
			#end if
			#if $hTrim.hAdvanced.hMaxLength != "":
				--htrim-max-length $hTrim.hAdvanced.hMaxLength
			#end if
			
			$hTrim.hAdvanced.hMaxFirst
			$hTrim.hAdvanced.hTrimAdapter
		#end if
		
		
		#if $cTrimLen.select == "on":
			--post-trim-length $cTrimLen.trimLen
		#end if
		
		#if $cAddOptions.select == "show":
			$cAddOptions.logLevel
			$cAddOptions.numTags
			$cAddOptions.remTags
			$cAddOptions.rndTags
			$cAddOptions.singleReadsP
			
			#if $cAddOptions.cReadBundle.select == "show":
				--bundle $cAddOptions.cReadBundle.bundle
				
				#if $cAddOptions.cReadBundle.bundles != "":
					--bundles $cAddOptions.cReadBundle.bundles
				#end if
			#end if
		#end if
		
		#if $cBarcodes.select == "off":
			#if $reads.mode == "se":
				--output-reads '$rsout'.'$reads.rs.extension'
			#elif $reads.mode == "pe":
				--output-reads '$r1out'.'$reads.r1.extension'
				--output-reads2 '$r2out'.'$reads.r2.extension'
			#else:
				--output-reads '$rcout.forward'.'$reads.rc.forward.extension'
				--output-reads2 '$rcout.reverse'.'$reads.rc.reverse.extension'
			#end if
		#end if
		
		--output-log '$outlog'
		
		#if $cBarcodes.select == "on":
			flexbar_barcoded
		#end if
		
		]]>
	</command>
	
	
	<inputs>
		
		<conditional name="reads">
			<param name="mode" type="select" label="Sequencing reads">
				<option value="se">Single read file</option>
				<option value="pe" selected="true">Paired read files</option>
				<option value="pc">Paired read collection</option>
			</param>
			<when value="se">
				<param name="rs" type="data" format="fastqsanger,fastqsolexa,fastqillumina,fastqsanger.gz,fastqsolexa.gz,fastqillumina.gz,fastqsanger.bz2,fastqsolexa.bz2,fastqillumina.bz2" label="Fastq read file"/>
			</when>
			<when value="pe">
				<param name="r1" type="data" format="fastqsanger,fastqsolexa,fastqillumina,fastqsanger.gz,fastqsolexa.gz,fastqillumina.gz,fastqsanger.bz2,fastqsolexa.bz2,fastqillumina.bz2" label="Fastq read file 1"/>
				<param name="r2" type="data" format="fastqsanger,fastqsolexa,fastqillumina,fastqsanger.gz,fastqsolexa.gz,fastqillumina.gz,fastqsanger.bz2,fastqsolexa.bz2,fastqillumina.bz2" label="Fastq read file 2"/>
			</when>
			<when value="pc">
				<param name="rc" format="fastqsanger,fastqsolexa,fastqillumina,fastqsanger.gz,fastqsolexa.gz,fastqillumina.gz,fastqsanger.bz2,fastqsolexa.bz2,fastqillumina.bz2" type="data_collection" collection_type="paired" label="Fastq pair collection"/>
			</when>
		</conditional>
		
		<param name="maxUncalled" size="4" type="integer" value="0"  label="1) Maximum uncalled bases"/>
		
		<conditional name="trimEnds">
			<param name="select" type="select" label="2) Trimming of read ends">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<param name="trimLeft" size="4" type="integer" value="0" label="Left"/>
				<param name="trimRight" size="4" type="integer" value="0" label="Right" help="trims specified number of bases at ends"/>
			</when>
		</conditional>
		
		<conditional name="cTrimQual">
			<param name="select" type="select" label="3) Quality-based trimming">
				<option value="off" selected="true">Off</option>
				<option value="tail">Tail</option>
				<option value="win">Window</option>
				<option value="bwa">BWA</option>
			</param>
			<when value="off">
			</when>
			<when value="tail">
				<param name="trimQualTail" size="4" type="integer" value="20" label="Quality threshold" help="trim right end until specified quality or higher"/>
				
				<param name="trimQualPostTail" type="select" label="After adapter removal">
					<option value="" selected="true">No</option>
					<option value="--qtrim-post-removal">Yes</option>
				</param>
			</when>
			<when value="win">
				<param name="trimQualWin" size="4" type="integer" value="20" label="Quality threshold"/>
				<param name="trimQualWinSize" size="4" type="integer" value="5" label="Window length" help="sliding window average quality approach from left end"/>
				
				<param name="trimQualPostWin" type="select" label="After adapter removal">
					<option value="" selected="true">No</option>
					<option value="--qtrim-post-removal">Yes</option>
				</param>
			</when>
			<when value="bwa">
				<param name="trimQualBWA" size="4" type="integer" value="20" label="Quality threshold" help="trimming approach used by BWA"/>
				
				<param name="trimQualPostBWA" type="select" label="After adapter removal">
					<option value="" selected="true">No</option>
					<option value="--qtrim-post-removal">Yes</option>
				</param>
			</when>
		</conditional>
		
		
		<conditional name="cBarcodes">
			<param name="select" type="select" label="4) Barcode detection">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<conditional name="ccBarcodes">
					<param name="select" type="select" label="Barcodes">
						<option value="file" selected="true">Barcode file</option>
						<option value="files">Two barcode files</option>
					</param>
					<when value="file">
						<param format="fasta" name="barcodeFile" type="data" label="Fasta file with barcodes for reads 1"/>
					</when>
					<when value="files">
						<param format="fasta" name="barcodeFile1" type="data" label="Fasta file with barcodes for reads 1"/>
						<param format="fasta" name="barcodeFile2" type="data" label="Fasta file with barcodes for reads 2"/>
					</when>
				</conditional>
				
				<param name="bThresh" size="4" type="float" value="0.0" label="Error rate" help="allowed fraction of mismatches and indels"/>
				
				<param name="bTrimEnd" type="select" label="Trim-end mode">
					<option value="LTAIL" selected="true">Left tail</option>
					<option value="LEFT">Left</option>
					<option value="RTAIL">Right tail</option>
					<option value="RIGHT">Right</option>
					<option value="ANY">Any</option>
				</param>
				
				<section name="bAdvanced" title="Advanced options" expanded="false">
					
					<conditional name="cbReads">
						<param name="select" type="select" label="Separate barcode reads">
							<option value="no" selected="true">No</option>
							<option value="yes">Yes</option>
						</param>
						<when value="no">
						</when>
						<when value="yes">
							<param name="bReads" type="data" label="Fastq file with separate barcode reads" format="fastqsanger,fastqsolexa,fastqillumina,fastqsanger.gz,fastqsolexa.gz,fastqillumina.gz,fastqsanger.bz2,fastqsolexa.bz2,fastqillumina.bz2"/>
						</when>
					</conditional>
					
					<conditional name="cbMinOverlap">
						<param name="select" type="select" label="Change minimum overlap" help="default: barcode length">
							<option value="no" selected="true">No</option>
							<option value="yes">Yes</option>
						</param>
						<when value="no">
						</when>
						<when value="yes">
							<param name="bMinOverlap" size="4" type="integer" value="" label="Minimum overlap"/>
						</when>
					</conditional>
					
					<param name="bKeep" type="select" label="Remove barcodes within reads">
						<option value="" selected="true">Yes</option>
						<option value="--barcode-keep">No</option>
					</param>
					
					<param name="bUnassigned" type="select" label="Include unassigned reads">
						<option value="" selected="true">No</option>
						<option value="--barcode-unassigned">Yes</option>
					</param>
					
					<conditional name="cbTailLen">
						<param name="select" type="select" label="Change tail length">
							<option value="no" selected="true">No</option>
							<option value="yes">Yes</option>
						</param>
						<when value="no">
						</when>
						<when value="yes">
							<param name="bTailLen" size="4" type="integer" value="" label="Tail length"/>
						</when>
					</conditional>
					
					<conditional name="cbAlignScores">
						<param name="select" type="select" label="Modify alignment scores">
							<option value="no" selected="true">No</option>
							<option value="yes">Yes</option>
						</param>
						<when value="no">
						</when>
						<when value="yes">
							<param name="bMatch"    size="3" type="integer" value="1"  label="Match"/>
							<param name="bMismatch" size="3" type="integer" value="-1" label="Mismatch"/>
							<param name="bGap"      size="3" type="integer" value="-9" label="Gap"/>
						</when>
					</conditional>
				</section>
			</when>
		</conditional>
		
		
		<conditional name="cAdapters">
			<param name="select" type="select" label="5) Adapter removal">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<conditional name="ccAdapters">
					<param name="select" type="select" label="Adapter source">
						<option value="file" selected="true">Adapter file</option>
						<option value="files">Two adapter files</option>
						<option value="preset">Illumina preset</option>
						<option value="seq">Single sequence</option>
					</param>
					<when value="file">
						<param format="fasta" name="adapterFile" type="data" label="Fasta adapter file"/>
					</when>
					<when value="files">
						<param format="fasta" name="adapterFile1" type="data" label="Fasta adapter file for reads 1"/>
						<param format="fasta" name="adapterFile2" type="data" label="Fasta adapter file for reads 2"/>
					</when>
					<when value="preset">
						<param name="adapterPreset" type="select" label="Adapter preset">
							<option value="TruSeq" selected="true">TruSeq LT and HT-based kits</option>
							<option value="SmallRNA">TruSeq Small RNA</option>
							<option value="Methyl">TruSeq DNA Methylation and ScriptSeq</option>
							<option value="Ribo">TruSeq Ribo Profile</option>
							<option value="Nextera">Nextera, AmpliSeq, and TruSight</option>
							<option value="NexteraMP">Nextera Mate Pair</option>
						</param>
					</when>
					<when value="seq">
						<param name="adapterSeq" size="40" label="Adapter sequence" type="text" value=""/>
					</when>
				</conditional>
				
				<param name="aMinOverlap" size="4" type="integer" value="3" label="Minimum overlap"/>
				<param name="aThresh" size="4" type="float" value="0.1" label="Error rate" help="allowed fraction of mismatches and indels"/>
				
				<param name="aTrimEnd" type="select" label="Trim-end mode">
					<option value="RIGHT" selected="true">Right</option>
					<option value="LEFT">Left</option>
					<option value="RTAIL">Right tail</option>
					<option value="LTAIL">Left tail</option>
					<option value="ANY">Any</option>
				</param>
				
				<conditional name="cPairOverlap">
					<param name="select" type="select" label="Pair overlap detection">
						<option value="off" selected="true">Off</option>
						<option value="on">On</option>
					</param>
					<when value="off">
					</when>
					<when value="on">
						<param name="aPairOverlap" type="select" label="Detection mode">
							<option value="ON" selected="true">Standard</option>
							<option value="SHORT">Trim short</option>
						</param>
						<param name="aMinPoverlap" size="4" type="integer" value="40" label="Minimum pair overlap"/>
					</when>
				</conditional>
				
				<section name="aAdvanced" title="Advanced options" expanded="false">
					
					<conditional name="caTailLen">
						<param name="select" type="select" label="Change tail length">
							<option value="no" selected="true">No</option>
							<option value="yes">Yes</option>
						</param>
						<when value="no">
						</when>
						<when value="yes">
							<param name="aTailLen" size="4" type="integer" value="" label="Tail length"/>
						</when>
					</conditional>
					
					<conditional name="cRevComp">
						<param name="select" type="select" label="Reverse complements of adapters">
							<option value="off" selected="true">Off</option>
							<option value="on">On</option>
							<option value="only">Only</option>
						</param>
						<when value="off">
						</when>
						<when value="on">
							<param name="aRevCompEnd" type="select" label="Different trim-end for reverse complements">
								<option value="off" selected="true">Off</option>
								<option value="RIGHT">Right</option>
								<option value="LEFT">Left</option>
								<option value="RTAIL">Right tail</option>
								<option value="LTAIL">Left tail</option>
								<option value="ANY">Any</option>
							</param>
						</when>
					</conditional>
					
					
					<param name="aReadSet" type="select" label="Removal for single read set">
						<option value="" selected="true">Off</option>
						<option value="--adapter-read-set 1">1st</option>
						<option value="--adapter-read-set 2">2nd</option>
					</param>
					
					<param name="aCycles" size="4" type="integer" value="1" label="Number of removal cycles"/>
					
					<conditional name="caAlignScores">
						<param name="select" type="select" label="Modify alignment scores">
							<option value="no" selected="true">No</option>
							<option value="yes">Yes</option>
						</param>
						<when value="no">
						</when>
						<when value="yes">
							<param name="aMatch"    size="3" type="integer" value="1"  label="Match"/>
							<param name="aMismatch" size="3" type="integer" value="-1" label="Mismatch"/>
							<param name="aGap"      size="3" type="integer" value="-6" label="Gap"/>
						</when>
					</conditional>
				</section>
			</when>
		</conditional>
		
		
		<conditional name="hTrim">
			<param name="select" type="select" label="6) Trimming of homopolymers">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<param name="hTrimLeft" size="4" label="Trim homopolymers on left end" type="text" value="" optional="true"/>
				<param name="hTrimRight" size="4" label="Trim homopolymers on right end" type="text" value="" optional="true" help="for example AT"/>
				
				<param name="hMinLength" size="4" type="integer" value="3" label="Minimum length"/>
				<param name="hErrorRate" size="4" type="float" value="0.1" label="Error rate"/>
				
				<section name="hAdvanced" title="Advanced options" expanded="false">
					
					<param name="hMaxLength" size="4" type="integer" value="" label="Maximum length" optional="true"/>
					
					<param name="hMaxFirst" type="select" label="Maximum length only for first one">
						<option value="" selected="true">Off</option>
						<option value="--htrim-max-first">On</option>
					</param>
					
					<param name="hMinLength2" size="4" type="integer" value="" label="Minimum length after first one" optional="true"/>
					
					<param name="hTrimAdapter" type="select" label="Only in case of adapter on same side">
						<option value="" selected="true">Off</option>
						<option value="--htrim-adapter">On</option>
					</param>
				</section>
			</when>
		</conditional>
		
		
		<conditional name="cTrimLen">
			<param name="select" type="select" label="7) Trimming to length">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<param name="trimLen" size="4" type="integer" value="" label="Length" help="trim reads to certain length from right"/>
			</when>
		</conditional>
		
		<param name="minReadLen"  size="4" type="integer" value="20" label="8) Minimum read length"/>
		
		<conditional name="cAddOptions">
			<param name="select" type="select" label="Additional options">
				<option value="hide" selected="true">Hide</option>
				<option value="show">Show</option>
			</param>
			<when value="hide">
			</when>
			<when value="show">
				<param name="logLevel" type="select" label="Alignment logging">
					<option value="" selected="true">Off</option>
					<option value="--align-log ALL">All</option>
					<option value="--align-log MOD">Modified</option>
					<option value="--align-log TAB">Tabular</option>
				</param>
				
				<param name="numTags" type="select" label="Number tags">
					<option value="" selected="true">Off</option>
					<option value="--number-tags">On</option>
				</param>
				
				<param name="remTags" type="select" label="Removal tags">
					<option value="" selected="true">Off</option>
					<option value="--removal-tags">On</option>
				</param>
				
				<param name="rndTags" type="select" label="UMI tags">
					<option value="" selected="true">Off</option>
					<option value="--umi-tags">On</option>
				</param>
				
				<param name="singleReadsP" type="select" label="Single reads as paired">
					<option value="" selected="true">Off</option>
					<option value="--single-reads-paired">On</option>
				</param>
				
				<conditional name="cReadBundle">
					<param name="select" type="select" label="Read bundle options">
						<option value="hide" selected="true">Hide</option>
						<option value="show">Show</option>
					</param>
					<when value="hide">
					</when>
					<when value="show">
						<param name="bundle"  size="4" type="integer" value="256" label="Number of paired reads per bundle"/>
						<param name="bundles"  size="4" type="integer" value="" optional="true" label="Only certain number of bundles for testing"/>
					</when>
				</conditional>
			</when>
		</conditional>
		
  	</inputs>
	
	<outputs>
	    <data name="outlog" format="txt" label="Flexbar log for ${on_string}"/>
		
		<data name="rsout" label="Flexbar on ${reads.rs.name}" format_source="rs">
			<filter>reads['mode'] == 'se'</filter>
			<filter>cBarcodes['select'] == "off"</filter>
		</data>
		
		<data name="r1out" label="Flexbar on ${reads.r1.name}" format_source="r1">
			<filter>reads['mode'] == "pe"</filter>
			<filter>cBarcodes['select'] == "off"</filter>
		</data>
		<data name="r2out" label="Flexbar on ${reads.r2.name}" format_source="r2">
			<filter>reads['mode'] == "pe"</filter>
			<filter>cBarcodes['select'] == "off"</filter>
		</data>
		
		<collection name="rcout" type="paired" label="Flexbar on ${on_string}">
			<filter>reads['mode'] == "pc"</filter>
			<filter>cBarcodes['select'] == "off"</filter>
			<data name="forward" label="Flexbar on ${reads.rc.forward.name}" format_source="rc['forward']"/>
			<data name="reverse" label="Flexbar on ${reads.rc.reverse.name}" format_source="rc['reverse']"/>
		</collection>
		
		<collection type="list" label="Flexbar on ${on_string}" name="barcoded">
			<filter>cBarcodes['select'] == "on"</filter>
			<discover_datasets pattern="__designation_and_ext__" directory="flexbar_barcoded" visible="true"/>
		</collection>
		
	</outputs>
	
	<help>

**Description**

The program Flexbar preprocesses high-throughput sequencing data efficiently. It demultiplexes barcoded runs and removes adapter sequences. Moreover, trimming and filtering features are provided. Flexbar increases read mapping rates and improves genome as well as transcriptome assemblies. Unique molecular identifiers can be extracted in a flexible way. The program supports sequencing data in fastq format, e.g. from the Illumina platform. Flexbar is available on the project_ page.

.. _project: https://github.com/seqan/flexbar

------

**Trim-end modes**

**Any:** longer side of read remains after overlap removal

**Left:** right side remains after removal, align before or at read end

**Right:** left part remains after removal, align after or at read start

**Left tail:** consider first n bases of reads in alignment

**Right tail:** use only last n bases, see tail-length options

------

**Documentation**

Further documentation is available on the `manual`__ page and via the command line help screen.

.. __: https://github.com/seqan/flexbar/wiki

------

**References**

Johannes T. Roehr, Christoph Dieterich, Knut Reinert:  
Flexbar 3.0 – SIMD and multicore parallelization. Bioinformatics 2017.

Matthias Dodt, Johannes T. Roehr, Rina Ahmed, Christoph Dieterich:  
Flexbar – flexible barcode and adapter processing for next-generation sequencing platforms. Biology 2012.

	</help>

</tool>