view flexbar.xml @ 32:c554e6d251fd draft

Uploaded
author jtilman
date Tue, 19 Jun 2018 10:00:20 -0400
parents d43903772a88
children 4a095317caca
line wrap: on
line source


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


<tool id="flexbar" name="Flexbar" version="3.4" force_history_refresh="True">
	
	<description>flexible barcode and adapter removal</description>
    
	<requirements>
        <requirement type="binary" version="3.4">flexbar</requirement>
    </requirements>
	
	<version_command>flexbar --versions</version_command>
	
	<command interpreter="perl">
		
		flexbar.pl flexbar
		
		--threads \${GALAXY_SLOTS:-1}
		
		--reads $reads
		
		#if $cReads2.select == "on":
			#if $cReads2.reads2.ext == $reads.ext:
				--reads2 $cReads2.reads2
			#end if
		#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 $cTrimPhred.select == "on":
			--qtrim TAIL --qtrim-threshold $cTrimPhred.trimPhred
			
			#if $reads.ext == "fastqsanger":
				--qtrim-format sanger
			#end if
			#if $reads.ext == "fastqsolexa":
				--qtrim-format solexa
			#end if
			#if $reads.ext == "fastqillumina":
				--qtrim-format i1.3
			#end if
		#end if
		
		#if $cTrimLen.select == "on":
			--post-trim-length $cTrimLen.trimLen
		#end if
		
		
		#if $cBarcodes.select == "on":
			--barcodes $cBarcodes.barcodes
			
			#if $cBarcodes.cbReads.select == "yes":
				--barcode-reads $cBarcodes.cbReads.bReads
			#end if
			
			#if $cBarcodes.cbReads.select == "no":
				$cBarcodes.cbReads.bKeep
			#end if
			
			$cBarcodes.bUnassigned
			
			--barcode-trim-end $cBarcodes.bTrimEnd
			
			#if $cBarcodes.cbTailLen.select == "yes":
				--barcode-tail-length $cBarcodes.cbTailLen.bTailLen
			#end if
			
			#if $cBarcodes.cbMinOverlap.select == "yes":
				--barcode-min-overlap $cBarcodes.cbMinOverlap.bMinOverlap
			#end if
			
			--barcode-error-rate $cBarcodes.bThresh
			
			#if $cBarcodes.cbAlignScores.select == "yes":
				--barcode-match    $bMatch
				--barcode-mismatch $bMismatch
				--barcode-gap      $bGap
			#end if
		#end if
		
		
		#if $cAdapters.select == "on":
			
			#if $cAdapters.ccAdapters.select == "data":
				--adapters $cAdapters.ccAdapters.adaptersData
			#end if
			
			#if $cAdapters.ccAdapters.select == "seq":
				--adapter-seq $cAdapters.ccAdapters.adapterSeq
			#end if
			
			--adapter-trim-end $cAdapters.aTrimEnd
			
			#if $cAdapters.caTailLen.select == "yes":
				--adapter-tail-length $cAdapters.caTailLen.aTailLen
			#end if
			
			$cAdapters.aReadSet
			
			--adapter-min-overlap $cAdapters.aMinOverlap
			--adapter-error-rate  $cAdapters.aThresh
			
			#if $cAdapters.caAlignScores.select == "yes":
				--adapter-match    $aMatch
				--adapter-mismatch $aMismatch
				--adapter-gap      $aGap
			#end if
		#end if
		
		
		#if $cOutput.select == "show":
			$cOutput.fastaOutput
			$cOutput.lenDist
			$cOutput.singleReads
		#end if
		
		#if $cLogging.select == "show":
			$cLogging.logLevel
			$cLogging.numTags
			$cLogging.remTags
			$cLogging.rndTags
		#end if
		
		
		$output $output.id $__new_file_path__ $reads.ext
		
	</command>
	
	
	<inputs>
		
		<param format="fastq,fastqsanger,fastqsolexa,fastqillumina" name="reads" type="data" label="Reads fastq file" optional="false"/>
		
		
		<conditional name="cReads2">
			<param name="select" type="select" label="Paired reads file">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<param format="fastq,fastqsanger,fastqsolexa,fastqillumina" name="reads2" type="data" label="Reads 2" optional="false" help="same format as first read set"/>
			</when>
		</conditional>
		
		
		<param name="maxUncalled" size="4" type="integer" value="0"  label="1) Max uncalled" optional="false" help="allowed uncalled bases per read"/>
		
		<conditional name="trimEnds">
			<param name="select" type="select" label="2) Trimming of 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" optional="false"/>
				<param name="trimRight" size="4" type="integer" value="0" label="Right" optional="false" help="trims specified number of bases from read ends"/>
			</when>
		</conditional>
		
		<conditional name="cTrimPhred">
			<param name="select" type="select" label="3) Quality-based trimming">
				<option value="off" selected="true">Off</option>
				<option value="on">On</option>
			</param>
			<when value="off">
			</when>
			<when value="on">
				<param name="trimPhred" size="4" type="integer" value="10" label="Threshold" optional="false" help="trim right end until specified or higher quality reached"/>
			</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">
				<param format="fasta" name="barcodes" type="data" label="Barcodes" optional="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="yes">
						<param format="fastq,fastqsanger,fastqsolexa,fastqillumina" name="bReads" type="data" label="Separate barcode reads" optional="false"/>
					</when>
					<when value="no">
						<param name="bKeep" type="select" label="Remove barcodes within reads">
							<option value="" selected="true">Yes</option>
							<option value="--barcode-keep">No</option>
						</param>
					</when>
				</conditional>
				
				<param name="bUnassigned" type="select" label="Include unassigned reads">
					<option value="" selected="true">No</option>
					<option value="--barcode-unassigned">Yes</option>
				</param>
				
				<param name="bTrimEnd" type="select" label="Trim-end mode" optional="false">
					<option value="ANY" selected="true">Any</option>
					<option value="RIGHT">Right</option>
					<option value="RTAIL">Right tail</option>
					<option value="LEFT">Left</option>
					<option value="LTAIL">Left tail</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="10" label="Tail length" optional="false"/>
					</when>
				</conditional>
				
				<conditional name="cbMinOverlap">
					<param name="select" type="select" label="Change min-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="8" label="Min-overlap" optional="false"/>
					</when>
				</conditional>
				
				<param name="bThresh" size="4" type="integer" value="1" label="Threshold" optional="false" help="allowed mismatches and indels per 10 bases"/>
				
				<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" optional="false"/>
						<param name="bMismatch" size="3" type="integer" value="-1" label="Mismatch" optional="false"/>
						<param name="bGap"      size="3" type="integer" value="-9" label="Gap" optional="false"/>
					</when>
				</conditional>
			</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="data" selected="true">Fasta</option>
						<option value="seq">Sequence</option>
						<!-- <option value="file">File</option> -->
					</param>
					<when value="data">
						<param format="fasta" name="adaptersData" type="data" label="Adapters" optional="false"/>
					</when>
					<when value="seq">
						<param name="adapterSeq" size="40" label="Adapter" type="text" value="AAAAAAAAAAAAAA" optional="false"/>
					</when>
					<!-- <when value="file">
						<param name="adaptersFile" type="file" label="Adapters file" optional="false"/>
					</when> -->
				</conditional>
				
				<param name="aTrimEnd" type="select" label="Trim-end mode" optional="false">
					<option value="ANY">Any</option>
					<option value="RIGHT" selected="true">Right</option>
					<option value="RTAIL">Right tail</option>
					<option value="LEFT">Left</option>
					<option value="LTAIL">Left tail</option>
				</param>
				
				<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="10" label="Tail length" optional="false"/>
					</when>
				</conditional>
				
				<param name="aReadSet" type="select" label="Removal for single read set">
					<option value="" selected="true">No</option>
					<option value="--adapter-read-set 1">1st</option>
					<option value="--adapter-read-set 2">2nd</option>
				</param>
				
				<param name="aMinOverlap" size="4" type="integer" value="1" label="Min-overlap" optional="false"/>
				<param name="aThresh" size="4" type="integer" value="3" label="Threshold" optional="false" help="allowed mismatches and indels per 10 bases"/>
				
				<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" optional="false"/>
						<param name="aMismatch" size="3" type="integer" value="-1" label="Mismatch" optional="false"/>
						<param name="aGap"      size="3" type="integer" value="-6" label="Gap" optional="false"/>
					</when>
				</conditional>
			</when>
		</conditional>
		
		
		<conditional name="cTrimLen">
			<param name="select" type="select" label="6) 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="30" label="Length" optional="false" help="trim reads to certain length from right"/>
			</when>
		</conditional>
		
		<param name="minReadLen"  size="4" type="integer" value="18" label="7) Minimum read length" optional="false" help="shorter reads are discarded"/>
		
		<conditional name="cOutput">
			<param name="select" type="select" label="Output selection">
				<option value="off" selected="true">Off</option>
				<option value="show">Show</option>
			</param>
			<when value="off">
			</when>
			<when value="show">
				<param name="fastaOutput" type="select" label="Fasta output">
					<option value="" selected="true">Off</option>
					<option value="--fasta-output">Always</option>
				</param>
				
				<param name="lenDist" type="select" label="Read length distribution">
					<option value="" selected="true">Off</option>
					<option value="--length-dist">On</option>
				</param>
				
				<param name="singleReads" type="select" label="Single reads">
					<option value="" selected="true">Off</option>
					<option value="--single-reads">On</option>
				</param>
			</when>
		</conditional>
		
		<conditional name="cLogging">
			<param name="select" type="select" label="Logging and tagging options">
				<option value="off" selected="true">Off</option>
				<option value="show">Show</option>
			</param>
			<when value="off">
			</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>
			</when>
		</conditional>
		
  	</inputs>
	
	<stdio>
	    <exit_code range="1:" level="fatal" description="Error!" />
	</stdio>
	
	<outputs>
	    <data format="txt" name="output" metadata_source="reads"/>
	</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>