Added --max and --un file output options to Bowtie and modified tests to test for them.

Made Bowtie test files longer (more than one test read).
Added explanation of canonical and full reference genome variants to BWA and Bowtie.
Added informative labels to output files for NGS tools.
This commit is contained in:
Kelly Vincent
2010-12-01 10:54:35 -05:00
parent bfb5eba0fa
commit f61d147034
14 changed files with 502 additions and 279 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<param name="input1" type="data" format="bam" label="BAM File to Convert" />
</inputs>
<outputs>
<data name="output1" format="sam" />
<data name="output1" format="sam" label="Converted SAM" />
</outputs>
<tests>
<test>
+1 -1
View File
@@ -10,7 +10,7 @@
</param>
</inputs>
<outputs>
<data format="interval" name="out_file1" />
<data format="interval" name="out_file1" label="Converted Interval" />
</outputs>
<tests>
<test>
+1 -1
View File
@@ -20,7 +20,7 @@
</repeat>
</inputs>
<outputs>
<data name="output1" format="bam" />
<data name="output1" format="bam" label="Merged BAM" />
</outputs>
<tests>
<!-- TODO: add ability to test framework to test without at least
+1 -1
View File
@@ -73,7 +73,7 @@
</conditional>
</inputs>
<outputs>
<data format="tabular" name="output1" />
<data format="tabular" name="output1" label="Converted Pileup" />
</outputs>
<tests>
<test>
+1 -1
View File
@@ -34,7 +34,7 @@
</conditional>
</inputs>
<outputs>
<data name="output1" format="bam"/>
<data name="output1" format="bam" label="Converted BAM" />
</outputs>
<tests>
<test>
+3 -3
View File
@@ -159,11 +159,11 @@
</param>
</inputs>
<outputs>
<data name="output" format="sam"/>
<data name="unmappedReadOut" format="fastqsanger">
<data name="output" format="sam" label="Mapped Reads" />
<data name="unmappedReadOut" format="fastqsanger" label="Unmapped Reads">
<filter>bUnmappedRead == "true" and s["space"] == "base"</filter>
</data>
<data name="unmappedReadOutCS" format="fastqcssanger">
<data name="unmappedReadOutCS" format="fastqcssanger" label="Unmapped Reads">
<filter>bUnmappedRead == "true" and s["space"] == "color"</filter>
</data>
</outputs>
+1 -1
View File
@@ -157,7 +157,7 @@
<param name="suppressHeader" type="boolean" truevalue="--suppressHeader" falsevalue="" checked="True" label="Suppress the header in the output SAM file" help="BFAST produces SAM with several lines of header information" />
</inputs>
<outputs>
<data format="sam" name="output" >
<data format="sam" name="output" label="Unmapped Reads" >
<actions>
<conditional name="refGenomeSource.refGenomeSource_type">
<when value="indexed">
+113 -26
View File
@@ -3,9 +3,29 @@
<description></description>
<command interpreter="python">
bowtie_wrapper.py
## Hackish setting of number of threads
--threads="4"
## Outputs
--output=$output
#if $singlePaired == "single"
#if $output_unmapped_reads_l
--output_unmapped_reads=$output_unmapped_reads_l
#end if
#if $output_suppressed_reads_l
--output_suppressed_reads=$output_suppressed_reads_l
#end if
#else
#if $output_unmapped_reads_l and $output_unmapped_reads_r
--output_unmapped_reads_l=$output_unmapped_reads_l
--output_unmapped_reads_r=$output_unmapped_reads_r
#end if
#if $output_suppressed_reads_l and $output_suppressed_reads_l
--output_suppressed_reads_l=$output_suppressed_reads_l
--output_suppressed_reads_r=$output_suppressed_reads_r
#end if
#end if
## Inputs
--dataType="solid"
--output=$output
--suppressHeader=$suppressHeader
--genomeSource=$refGenomeSource.genomeSource
#if $refGenomeSource.genomeSource == "history":
@@ -166,10 +186,10 @@
</param>
<param name="seed" type="integer" value="-1" label="Seed for the pseudorandom number generator (--seed)" help="Use -1 to use default" />
<param name="cutoff" type="integer" value="-1" label="Number of first bases of the reference sequence to index (--cutoff)" help="Use -1 to use default" />
</when> <!-- cIndexFull -->
</conditional> <!-- cIndexParams -->
</when> <!-- cHistory -->
</conditional> <!-- cRefGenomeSource -->
</when> <!-- indexFull -->
</conditional> <!-- indexParams -->
</when> <!-- history -->
</conditional> <!-- refGenomeSource -->
<conditional name="singlePaired">
<param name="sPaired" type="select" label="Is this library mate-paired?">
<option value="single">Single-end</option>
@@ -206,6 +226,8 @@
<option value="doAllValAligns">Report all valid alignments</option>
</param>
<param name="sSuppressAlign" type="integer" value="-1" label="Suppress all alignments for a read if more than n reportable alignments exist (-m)" help="-1 for no limit" />
<param name="sMaxFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads with a number of valid alignments exceeding the limit set with the -m option to a file (--max)" />
<param name="sUnmappedFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads that could not be aligned to a file (--un)" />
<conditional name="sBestOption">
<param name="sBest" type="select" label="Whether or not to make Bowtie guarantee that reported singleton alignments are 'best' in terms of stratum and in terms of the quality values at the mismatched positions (--best)" help="Removes all strand bias. Only affects which alignments are reported by Bowtie. Runs slower with best option">
<option value="noBest">Do not use best</option>
@@ -221,7 +243,7 @@
<option value="doStrata">Use strata option</option>
</param>
</when>
</conditional> <!-- csBestOption -->
</conditional> <!-- sBestOption -->
<param name="sOffrate" type="integer" value="-1" label="Override the offrate of the index to n (-o)" help="-1 for default" />
<param name="sSeed" type="integer" value="-1" label="Seed for pseudo-random number generator (--seed)" help="-1 for default" />
<param name="sSnpphred" type="integer" value="-1" label="SNP penalty (ratio of SNPs per base in the subject genome) (--snpphred)" help="Enter this OR Ratio of SNPs per base" />
@@ -230,9 +252,9 @@
<option value="doKeepends">Keep ends</option>
<option value="noKeepends">Trim ends</option>
</param>
</when> <!-- csFull -->
</conditional> <!-- csParams -->
</when> <!-- cSingle -->
</when> <!-- full -->
</conditional> <!-- sParams -->
</when> <!-- single -->
<when value="paired">
<param name="pInput1" type="data" format="fastqcssanger" label="FASTQ file" help="Must have Sanger-scaled quality values with ASCII offset 33"/>
<param name="pInput2" type="data" format="fastqcssanger" label="Reverse FASTQ file" help="Must have Sanger-scaled quality values with ASCII offset 33"/>
@@ -281,6 +303,8 @@
<option value="doAllValAligns">Report all valid alignments</option>
</param>
<param name="pSuppressAlign" type="integer" value="-1" label="Suppress all alignments for a pair if more than n reportable alignments exist (-m)" help="-1 for no limit" />
<param name="pMaxFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads with a number of valid alignments exceeding the limit set with the -m option to a file (--max)" />
<param name="pUnmappedFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads that could not be aligned to a file (--un)" />
<conditional name="pBestOption">
<param name="pBest" type="select" label="Whether or not to make Bowtie guarantee that reported singleton alignments are 'best' in terms of stratum and in terms of the quality values at the mismatched positions (--best)" help="Removes all strand bias. Only affects which alignments are reported by Bowtie. Runs slower with best option">
<option value="noBest">Do not use best</option>
@@ -296,7 +320,7 @@
<option value="doStrata">Use strata option</option>
</param>
</when>
</conditional> <!-- cpBestOption -->
</conditional> <!-- pBestOption -->
<param name="pOffrate" type="integer" value="-1" label="Override the offrate of the index to n (-o)" help="-1 for default" />
<param name="pSeed" type="integer" value="-1" label="Seed for pseudo-random number generator (--seed)" help="-1 for default" />
<param name="pSnpphred" type="integer" value="-1" label="SNP penalty (ratio of SNPs per base in the subject genome) (--snpphred)" help="Enter this OR Ratio of SNPs per base" />
@@ -305,33 +329,77 @@
<option value="doKeepends">Keep ends</option>
<option value="noKeepends">Trim ends</option>
</param>
</when> <!-- cpFull -->
</conditional> <!-- cpParams -->
</when> <!-- cPaired -->
</conditional> <!-- cSinglePaired -->
</when> <!-- full -->
</conditional> <!-- pParams -->
</when> <!-- paired -->
</conditional> <!-- singlePaired -->
<param name="suppressHeader" type="boolean" truevalue="true" falsevalue="false" checked="true" label="Suppress the header in the output SAM file" help="Bowtie produces SAM with several lines of header information by default" />
</inputs>
<outputs>
<data format="sam" name="output" >
<data format="sam" name="output" label="Mapped Reads">
<actions>
<conditional name="refGenomeSource.genomeSource">
<when value="indexed">
<action type="metadata" name="dbkey">
<option type="from_file" name="bowtie_indices_color.loc" column="1" offset="0">
<option type="from_file" name="bowtie_indices_color.loc" column="0" offset="0">
<filter type="param_value" column="0" value="#" filter_by="startswith" keep="False"/>
<filter type="param_value" ref="refGenomeSource.index" column="0"/>
<filter type="param_value" ref="refGenomeSource.index" column="1"/>
</option>
</action>
</when>
</conditional>
<!-- Special casing equCab2chrM to equCab2 -->
<action type="metadata" name="dbkey">
<option type="from_param" name="refGenomeSource.genomeSource" column="0" offset="0">
<filter type="insert_column" column="0" value="equCab2chrM"/>
<filter type="insert_column" column="0" value="equCab2"/>
<filter type="metadata_value" ref="output" name="dbkey" column="1" />
</option>
</action>
</actions>
</data>
<data format="fastqcssanger" name="output_suppressed_reads_l" label="Suppressed Reads">
<filter>((
singlePaired['sPaired'] == "single" and
singlePaired['sParams']['sSettingsType'] == "full" and
singlePaired['sParams']['sMaxFile'] is True
) or (
singlePaired['sPaired'] == "paired" and
singlePaired['pParams']['pSettingsType'] == "full" and
singlePaired['pParams']['pMaxFile'] is True
))
</filter>
</data>
<data format="fastqcssanger" name="output_suppressed_reads_r" label="Suppressed Reads (R)">
<filter>singlePaired['sPaired'] == "paired"</filter>
<filter>singlePaired['pParams']['pSettingsType'] == "full"</filter>
<filter>singlePaired['pParams']['pMaxFile'] is True</filter>
</data>
<data format="fastqcssanger" name="output_unmapped_reads_l" label="Unmapped Reads (L)">
<filter>
((
singlePaired['sPaired'] == "single" and
singlePaired['sParams']['sSettingsType'] == "full" and
singlePaired['sParams']['sUnmappedFile'] is True
) or (
singlePaired['sPaired'] == "paired" and
singlePaired['pParams']['pSettingsType'] == "full" and
singlePaired['pParams']['pUnmappedFile'] is True
))
</filter>
</data>
<data format="fastqcssanger" name="output_unmapped_reads_r" label="Unmapped Reads (R)">
<filter>singlePaired['sPaired'] == "paired"</filter>
<filter>singlePaired['pParams']['pSettingsType'] == "full"</filter>
<filter>singlePaired['pParams']['pUnmappedFile'] is True</filter>
</data>
</outputs>
<tests>
<test>
<!--
Bowtie command:
bowtie -p 4 -S +sam-nohead -q -C chrM_color test-data/bowtie_in1.fastqcssanger > test-data/bowtie_out1.sam
bowtie -q -p 4 -S +sam-nohead -C chrM_color test-data/bowtie_in1.fastqcssanger > bowtie_out1_u.sam
sort bowtie_out1_u.sam > bowtie_out1.sam
-p is the number of threads, which is hardcoded above. You need to replace the + with 2 dashes.
chrM_color needs to be the base location/name of the index files.
-->
@@ -342,13 +410,18 @@
<param name="sInput1" ftype="fastqcssanger" value="bowtie_in1.fastqcssanger" />
<param name="sSettingsType" value="preSet" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out1.sam" />
<output name="output" ftype="sam" file="bowtie_out1.sam" sort="True" />
</test>
<test>
<!--
Bowtie command:
bowtie-build -f -C test-data/chr_m.fasta chrM_color
bowtie -X 1000 +ff -n 2 -e 70 -l 28 -X 250 +pairtries 100 +maxbts 125 -k 1 -C +snpfrac 0.001 +col-keepends -p 4 -S +sam-nohead -q chrM_color -1 test-data/bowtie_in3.fastqcssanger -2 test-data/bowtie_in4.fastqcssanger > test-data/bowtie_out3.sam
bowtie-build -C -f test-data/chr_m.fasta chrM_color
bowtie -q -X 1000 +ff -p 4 -S +sam-nohead -C -n 2 -e 70 -l 28 -X 250 +pairtries 100 +maxbts 125 -k 1 +snpfrac 0.001 +col-keepends +un bowtie_out3_u.fastq chrM_color -1 test-data/bowtie_in3.fastqcssanger -2 test-data/bowtie_in4.fastqcssanger > bowtie_out2_u.sam
sort bowtie_out2_u.sam > bowtie_out2.sam
sort bowtie_out3_u_1.sam > bowtie_out3_1.sam
sort bowtie_out3_u_2.sam > bowtie_out3_2.sam
Then also need to modify bowtie_out3_1.sam and bowtie_out3_2.sam so that all @ lines come before sequence lines.
The two unmapped output files will be named bowtie_out4_1.fastq and bowtie_out4_2.fastq
-p is the number of threads, hardcoded above. You need to replace the + with 2 dashes.
chrM_base is the index files' location/base name.
-->
@@ -378,6 +451,8 @@
<param name="pValAlign" value="1" />
<param name="pAllValAligns" value="noAllValAligns" />
<param name="pSuppressAlign" value="-1" />
<param name="pUnmappedFile" value="true" />
<param name="pMaxFile" value="false" />
<param name="pBest" value="noBest" />
<param name="pnMaxBacktracks" value="125" />
<param name="pOffrate" value="-1" />
@@ -386,12 +461,15 @@
<param name="pSnpfrac" value="0.001" />
<param name="pKeepends" value="doKeepends" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out3.sam" />
<output name="output" ftype="sam" file="bowtie_out2.sam" sort="True" />
<output name="output_unmapped_reads_l" ftype="fastqcssanger" file="bowtie_out3_1.fastq" sort="True" />
<output name="output_unmapped_reads_r" ftype="fastqcssanger" file="bowtie_out3_2.fastq" sort="True" />
</test>
<test>
<!--
Bowtie command:
bowtie -n 2 -e 70 -l 28 +maxbts 125 -k 1 -C +snpfrac 0.001 +col-keepends -p 4 -S +sam-nohead -q chrM_color test-data/bowtie_in1.fastqcssanger > test-data/bowtie_out5.sam
bowtie -q -p 4 -S +sam-nohead -C -n 2 -e 70 -l 28 +maxbts 125 -k 1 +snpfrac 0.001 +col-keepends chrM_color test-data/bowtie_in1.fastqcssanger > bowtie_out4_u.sam
sort bowtie_out4_u.sam > bowtie_out4.sam
-p is the number of threads, hardcoded above. You need to replace the + with 2 dashes.
chrM_base is the index files' location/base name.
-->
@@ -414,6 +492,8 @@
<param name="sValAlign" value="1" />
<param name="sAllValAligns" value="noAllValAligns" />
<param name="sSuppressAlign" value="-1" />
<param name="sUnmappedFile" value="false" />
<param name="sMaxFile" value="false" />
<param name="sBest" value="noBest" />
<param name="snMaxBacktracks" value="125" />
<param name="sOffrate" value="-1" />
@@ -422,13 +502,14 @@
<param name="sSnpfrac" value="0.001" />
<param name="sKeepends" value="doKeepends" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out5.sam" />
<output name="output" ftype="sam" file="bowtie_out4.sam" sort="True" />
</test>
<test>
<!--
Bowtie command:
bowtie-build +noauto +bmaxdivn 4 +dcv 1024 +offrate 5 +ftabchars 10 +little -C -f test-data/chr_m.fasta chrM_color
bowtie -X 1000 +ff -p 4 -S +sam-nohead -q -C chrM_color -1 test-data/bowtie_in3.fastqcssanger -2 test-data/bowtie_in4.fastqcssanger > test-data/bowtie_out7.sam
bowtie -q -X 1000 +ff -p 4 -S +sam-nohead -C chrM_color -1 test-data/bowtie_in3.fastqcssanger -2 test-data/bowtie_in4.fastqcssanger > bowtie_out5_u.sam
sort bowtie_out5_u.sam > bowtie_out5.sam
-p is the number of threads, hardcoded above. You need to replace the + with 2 dashes.
chrM_base is the index files' location/base name.
-->
@@ -455,7 +536,7 @@
<param name="pMateOrient" value="ff" />
<param name="pSettingsType" value="preSet" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out7.sam" />
<output name="output" ftype="sam" file="bowtie_out5.sam" sort="True" />
</test>
</tests>
@@ -485,6 +566,12 @@ Bowtie accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare yo
------
**A Note on Built-in Reference Genomes**
Some genomes have multiple variants. If only one "type" of genome is listed, it is the Full version, which means that everything that came in the original genome data download (possibly with mitochondrial and plasmid DNA added if it wasn't already included). The Full version is available for every genome. Some genomes also come in the Canonical variant, which contains only the "canonical" (well-defined) chromosomes or segments, such as chr1-chr22, chrX, chrY, and chrM for human. Other variations include gender. These will come in the canonical form only, so the general Canonical variant is actually Canonical Female and the other is Canonical Male (identical to female excluding chrX).
------
**Outputs**
The output is in SAM format, and has the following columns::
+76 -38
View File
@@ -6,9 +6,15 @@ For use with Bowtie v. 0.12.3
usage: bowtie_wrapper.py [options]
-t, --threads=t: The number of threads to run
-o, --output=o: The output file
--output_unmapped_reads=: File name for unmapped reads (single-end)
--output_unmapped_reads_l=: File name for unmapped reads (left, paired-end)
--output_unmapped_reads_r=: File name for unmapped reads (right, paired-end)
--output_suppressed_reads=: File name for suppressed reads because of max setting (single-end)
--output_suppressed_reads_l=: File name for suppressed reads because of max setting (left, paired-end)
--output_suppressed_reads_r=: File name for suppressed reads because of max setting (right, paired-end)
-i, --input1=i: The (forward or single-end) reads file in Sanger FASTQ format
-I, --input2=I: The reverse reads file in Sanger FASTQ format
-o, --output=o: The output file
-4, --dataType=4: The type of data (SOLiD or Solexa)
-2, --paired=2: Whether the data is single- or paired-end
-g, --genomeSource=g: The type of reference provided
@@ -69,10 +75,16 @@ def __main__():
#Parse Command Line
parser = optparse.OptionParser()
parser.add_option( '-t', '--threads', dest='threads', help='The number of threads to run' )
parser.add_option( '-o', '--output', dest='output', help='The output file' )
parser.add_option( '', '--output_unmapped_reads', dest='output_unmapped_reads', help='File name for unmapped reads (single-end)' )
parser.add_option( '', '--output_unmapped_reads_l', dest='output_unmapped_reads_l', help='File name for unmapped reads (left, paired-end)' )
parser.add_option( '', '--output_unmapped_reads_r', dest='output_unmapped_reads_r', help='File name for unmapped reads (right, paired-end)' )
parser.add_option( '', '--output_suppressed_reads', dest='output_suppressed_reads', help='File name for suppressed reads because of max setting (single-end)' )
parser.add_option( '', '--output_suppressed_reads_l', dest='output_suppressed_reads_l', help='File name for suppressed reads because of max setting (left, paired-end)' )
parser.add_option( '', '--output_suppressed_reads_r', dest='output_suppressed_reads_r', help='File name for suppressed reads because of max setting (right, paired-end)' )
parser.add_option( '-4', '--dataType', dest='dataType', help='The type of data (SOLiD or Solexa)' )
parser.add_option( '-i', '--input1', dest='input1', help='The (forward or single-end) reads file in Sanger FASTQ format' )
parser.add_option( '-I', '--input2', dest='input2', help='The reverse reads file in Sanger FASTQ format' )
parser.add_option( '-o', '--output', dest='output', help='The output file' )
parser.add_option( '-2', '--paired', dest='paired', help='Whether the data is single- or paired-end' )
parser.add_option( '-g', '--genomeSource', dest='genomeSource', help='The type of reference provided' )
parser.add_option( '-r', '--ref', dest='ref', help='The reference genome to use or index' )
@@ -123,25 +135,6 @@ def __main__():
(options, args) = parser.parse_args()
stdout = ''
# output version # of tool
try:
tmp = tempfile.NamedTemporaryFile().name
tmp_stdout = open( tmp, 'wb' )
proc = subprocess.Popen( args='bowtie --version', shell=True, stdout=tmp_stdout )
tmp_stdout.close()
returncode = proc.wait()
stdout = None
for line in open( tmp_stdout.name, 'rb' ):
if line.lower().find( 'version' ) >= 0:
stdout = line.strip()
break
if stdout:
sys.stdout.write( '%s\n' % stdout )
else:
raise Exception
except:
sys.stdout.write( 'Could not determine Bowtie version\n' )
# make temp directory for placement of indices and copy reference file there if necessary
tmp_index_dir = tempfile.mkdtemp()
# get type of data (solid or solexa)
@@ -248,6 +241,8 @@ def __main__():
ref_file_name = options.ref
# set up aligning and generate aligning command options
# automatically set threads in both cases
tmp_suppressed_file_name = None
tmp_unmapped_file_name = None
if options.suppressHeader == 'true':
suppressHeader = '--sam-nohead'
else:
@@ -261,7 +256,7 @@ def __main__():
else:
mateOrient = ''
if options.params == 'preSet':
aligning_cmds = '%s %s -p %s -S %s -q %s ' % \
aligning_cmds = '-q %s %s -p %s -S %s %s ' % \
( maxInsert, mateOrient, options.threads, suppressHeader, colorspace )
else:
try:
@@ -281,6 +276,10 @@ def __main__():
trimL = '-3 %s' % options.trimL
else:
trimL = ''
if options.maqSoapAlign != '-1' and int( options.maqSoapAlign ) >= 0:
maqSoapAlign = '-v %s' % options.maqSoapAlign
else:
maqSoapAlign = ''
if options.mismatchSeed and (options.mismatchSeed == '0' or options.mismatchSeed == '1' \
or options.mismatchSeed == '2' or options.mismatchSeed == '3'):
mismatchSeed = '-n %s' % options.mismatchSeed
@@ -298,10 +297,6 @@ def __main__():
rounding = '--nomaqround'
else:
rounding = ''
if options.maqSoapAlign != '-1' and int( options.maqSoapAlign ) >= 0:
maqSoapAlign = '-v %s' % options.maqSoapAlign
else:
maqSoapAlign = ''
if options.minInsert and int( options.minInsert ) > 0:
minInsert = '-I %s' % options.minInsert
else:
@@ -355,26 +350,50 @@ def __main__():
seed = '--seed %s' % options.seed
else:
seed = ''
if options.paired == 'paired':
if options.output_unmapped_reads_l and options.output_unmapped_reads_r:
tmp_unmapped_file = tempfile.NamedTemporaryFile( dir=tmp_index_dir, suffix='.fastq' )
tmp_unmapped_file_name = tmp_unmapped_file.name
tmp_unmapped_file.close()
output_unmapped_reads = '--un %s' % tmp_unmapped_file_name
else:
output_unmapped_reads = ''
if options.output_suppressed_reads:
tmp_suppressed_file = tempfile.NamedTemporaryFile( dir=tmp_index_dir, suffix='.fastq' )
tmp_suppressed_file_name = tmp_suppressed_file.name
tmp_suppressed_file.close()
output_suppressed_reads = '--max %s' % tmp_suppressed_file_name
else:
output_suppressed_reads = ''
else:
if options.output_unmapped_reads:
output_unmapped_reads = '--un %s' % options.output_unmapped_reads
else:
output_unmapped_reads = ''
if options.output_suppressed_reads:
output_suppressed_reads = '--max %s' % options.output_suppressed_reads
else:
output_suppressed_reads = ''
snpfrac = ''
if options.snpphred and int( options.snpphred ) >= 0:
snpphred = '--snpphred %s' % options.snpphred
else:
snpphred = ''
if options.snpfrac and float( options.snpfrac ) >= 0:
snpfrac = '--snpfrac %s' % options.snpfrac
else:
snpfrac = ''
if options.keepends and options.keepends == 'doKeepends':
keepends = '--col-keepends'
else:
keepends = ''
aligning_cmds = '%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s ' \
'%s %s %s %s %s %s %s %s %s %s %s -p %s -S %s -q' % \
( skip, alignLimit, trimH, trimL, mismatchSeed, mismatchQual,
seedLen, rounding, maqSoapAlign, minInsert, maxInsert,
mateOrient, maxAlignAttempt, forwardAlign, reverseAlign,
maxBacktracks, tryHard, valAlign, allValAligns, suppressAlign,
best, strata, offrate, seed, colorspace, snpphred, snpfrac,
keepends, options.threads, suppressHeader )
aligning_cmds = '-q %s %s -p %s -S %s %s %s %s %s %s %s %s %s %s %s %s ' \
'%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s' % \
( maxInsert, mateOrient, options.threads, suppressHeader,
colorspace, skip, alignLimit, trimH, trimL, maqSoapAlign,
mismatchSeed, mismatchQual, seedLen, rounding, minInsert,
maxAlignAttempt, forwardAlign, reverseAlign, maxBacktracks,
tryHard, valAlign, allValAligns, suppressAlign, best,
strata, offrate, seed, snpphred, snpfrac, keepends,
output_unmapped_reads, output_suppressed_reads )
except ValueError, e:
# clean up temp dir
if os.path.exists( tmp_index_dir ):
@@ -383,7 +402,7 @@ def __main__():
try:
# have to nest try-except in try-finally to handle 2.4
try:
# prepare actual aligning commands
# prepare actual mapping commands
if options.paired == 'paired':
cmd2 = 'bowtie %s %s -1 %s -2 %s > %s' % ( aligning_cmds, ref_file_name, options.input1, options.input2, options.output )
else:
@@ -408,9 +427,28 @@ def __main__():
tmp_stderr.close()
if returncode != 0:
raise Exception, stderr
# get suppressed and unmapped reads output files in place if appropriate
if options.paired == 'paired' and tmp_suppressed_file_name and \
options.output_suppressed_reads_l and options.output_suppressed_reads_r:
try:
left = tmp_suppressed_file_name.replace( '.fastq', '_1.fastq' )
right = tmp_suppressed_file_name.replace( '.fastq', '_1.fastq' )
shutil.move( left, options.output_suppressed_reads_l )
shutil.move( right, options.output_suppressed_reads_r )
except Exception, e:
sys.stdout.write( 'Error producing the suppressed output file.\n' )
if options.paired == 'paired' and tmp_unmapped_file_name and \
options.output_unmapped_reads_l and options.output_unmapped_reads_r:
try:
left = tmp_unmapped_file_name.replace( '.fastq', '_1.fastq' )
right = tmp_unmapped_file_name.replace( '.fastq', '_2.fastq' )
shutil.move( left, options.output_unmapped_reads_l )
shutil.move( right, options.output_unmapped_reads_r )
except Exception, e:
sys.stdout.write( 'Error producing the unmapped output file.\n' )
# check that there are results in the output file
if os.path.getsize( options.output ) == 0:
raise Exception, 'The output file is empty, there may be an error with your input file or settings.' + '\nextra: ' + str(extra)
raise Exception, 'The output file is empty, there may be an error with your input file or settings.'
except Exception, e:
stop_err( 'Error aligning sequence. ' + str( e ) )
finally:
+294 -202
View File
@@ -3,107 +3,127 @@
<description></description>
<parallelism method="basic"></parallelism>
<command interpreter="python">
bowtie_wrapper.py
--threads="4"
--dataType="solexa"
--output=$output
--suppressHeader=$suppressHeader
--genomeSource=$refGenomeSource.genomeSource
#if $refGenomeSource.genomeSource == "history":
##index already exists
#if $refGenomeSource.ownFile.extension.startswith( 'bowtie_' ):
##user previously built
--ref="${refGenomeSource.ownFile.extra_files_path}/${refGenomeSource.ownFile.metadata.base_name}"
--do_not_build_index
#else:
##build index on the fly
--ref=$refGenomeSource.ownFile
--indexSettings=$refGenomeSource.indexParams.indexSettings
#if $refGenomeSource.indexParams.indexSettings == "indexFull":
--iautoB=$refGenomeSource.indexParams.autoBehavior.autoB
#if $refGenomeSource.indexParams.autoBehavior.autoB == "set":
--ipacked=$refGenomeSource.indexParams.autoBehavior.packed
--ibmax=$refGenomeSource.indexParams.autoBehavior.bmax
--ibmaxdivn=$refGenomeSource.indexParams.autoBehavior.bmaxdivn
--idcv=$refGenomeSource.indexParams.autoBehavior.dcv
bowtie_wrapper.py
## Hackish setting of number of threads
--threads="4"
## Outputs
--output=$output
#if $singlePaired == "single"
#if $output_unmapped_reads_l
--output_unmapped_reads=$output_unmapped_reads_l
#end if
#if $output_suppressed_reads_l
--output_suppressed_reads=$output_suppressed_reads_l
#end if
#else
#if $output_unmapped_reads_l and $output_unmapped_reads_r
--output_unmapped_reads_l=$output_unmapped_reads_l
--output_unmapped_reads_r=$output_unmapped_reads_r
#end if
#if $output_suppressed_reads_l and $output_suppressed_reads_l
--output_suppressed_reads_l=$output_suppressed_reads_l
--output_suppressed_reads_r=$output_suppressed_reads_r
#end if
#end if
## Inputs
--dataType="solexa"
--suppressHeader=$suppressHeader
--genomeSource=$refGenomeSource.genomeSource
#if $refGenomeSource.genomeSource == "history":
##index already exists
#if $refGenomeSource.ownFile.extension.startswith( 'bowtie_' ):
##user previously built
--ref="${refGenomeSource.ownFile.extra_files_path}/${refGenomeSource.ownFile.metadata.base_name}"
--do_not_build_index
#else:
##build index on the fly
--ref=$refGenomeSource.ownFile
--indexSettings=$refGenomeSource.indexParams.indexSettings
#if $refGenomeSource.indexParams.indexSettings == "indexFull":
--iautoB=$refGenomeSource.indexParams.autoBehavior.autoB
#if $refGenomeSource.indexParams.autoBehavior.autoB == "set":
--ipacked=$refGenomeSource.indexParams.autoBehavior.packed
--ibmax=$refGenomeSource.indexParams.autoBehavior.bmax
--ibmaxdivn=$refGenomeSource.indexParams.autoBehavior.bmaxdivn
--idcv=$refGenomeSource.indexParams.autoBehavior.dcv
#end if
--inodc=$refGenomeSource.indexParams.nodc
--inoref=$refGenomeSource.indexParams.noref
--ioffrate=$refGenomeSource.indexParams.offrate
--iftab=$refGenomeSource.indexParams.ftab
--intoa=$refGenomeSource.indexParams.ntoa
--iendian=$refGenomeSource.indexParams.endian
--iseed=$refGenomeSource.indexParams.seed
--icutoff=$refGenomeSource.indexParams.cutoff
#end if
--inodc=$refGenomeSource.indexParams.nodc
--inoref=$refGenomeSource.indexParams.noref
--ioffrate=$refGenomeSource.indexParams.offrate
--iftab=$refGenomeSource.indexParams.ftab
--intoa=$refGenomeSource.indexParams.ntoa
--iendian=$refGenomeSource.indexParams.endian
--iseed=$refGenomeSource.indexParams.seed
--icutoff=$refGenomeSource.indexParams.cutoff
#end if
#else
##use pre-built index
--ref="${ filter( lambda x: str( x[0] ) == str( $refGenomeSource.index ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] }"
#end if
--paired=$singlePaired.sPaired
#if $singlePaired.sPaired == "single":
--input1=$singlePaired.sInput1
--params=$singlePaired.sParams.sSettingsType
#if $singlePaired.sParams.sSettingsType == "full":
--skip=$singlePaired.sParams.sSkip
--alignLimit=$singlePaired.sParams.sAlignLimit
--trimH=$singlePaired.sParams.sTrimH
--trimL=$singlePaired.sParams.sTrimL
--mismatchSeed=$singlePaired.sParams.sMismatchSeed
--mismatchQual=$singlePaired.sParams.sMismatchQual
--seedLen=$singlePaired.sParams.sSeedLen
--rounding=$singlePaired.sParams.sRounding
--maqSoapAlign=$singlePaired.sParams.sMaqSoapAlign
--tryHard=$singlePaired.sParams.sTryHard
--valAlign=$singlePaired.sParams.sValAlign
--allValAligns=$singlePaired.sParams.sAllValAligns
--suppressAlign=$singlePaired.sParams.sSuppressAlign
--best=$singlePaired.sParams.sBestOption.sBest
#if $singlePaired.sParams.sBestOption.sBest == "doBest":
--maxBacktracks=$singlePaired.sParams.sBestOption.sdMaxBacktracks
--strata=$singlePaired.sParams.sBestOption.sdStrata
#else:
--maxBacktracks=$singlePaired.sParams.sBestOption.snMaxBacktracks
#end if
--offrate=$singlePaired.sParams.sOffrate
--seed=$singlePaired.sParams.sSeed
#end if
#else:
--input1=$singlePaired.pInput1
--input2=$singlePaired.pInput2
--maxInsert=$singlePaired.pMaxInsert
--mateOrient=$singlePaired.pMateOrient
--params=$singlePaired.pParams.pSettingsType
#if $singlePaired.pParams.pSettingsType == "full":
--skip=$singlePaired.pParams.pSkip
--alignLimit=$singlePaired.pParams.pAlignLimit
--trimH=$singlePaired.pParams.pTrimH
--trimL=$singlePaired.pParams.pTrimL
--mismatchSeed=$singlePaired.pParams.pMismatchSeed
--mismatchQual=$singlePaired.pParams.pMismatchQual
--seedLen=$singlePaired.pParams.pSeedLen
--rounding=$singlePaired.pParams.pRounding
--maqSoapAlign=$singlePaired.pParams.pMaqSoapAlign
--minInsert=$singlePaired.pParams.pMinInsert
--maxAlignAttempt=$singlePaired.pParams.pMaxAlignAttempt
--forwardAlign=$singlePaired.pParams.pForwardAlign
--reverseAlign=$singlePaired.pParams.pReverseAlign
--tryHard=$singlePaired.pParams.pTryHard
--valAlign=$singlePaired.pParams.pValAlign
--allValAligns=$singlePaired.pParams.pAllValAligns
--suppressAlign=$singlePaired.pParams.pSuppressAlign
--best=$singlePaired.pParams.pBestOption.pBest
#if $singlePaired.pParams.pBestOption.pBest == "doBest":
--maxBacktracks=$singlePaired.pParams.pBestOption.pdMaxBacktracks
--strata=$singlePaired.pParams.pBestOption.pdStrata
#else:
--maxBacktracks=$singlePaired.pParams.pBestOption.pnMaxBacktracks
#end if
--offrate=$singlePaired.pParams.pOffrate
--seed=$singlePaired.pParams.pSeed
#end if
#end if
#else
##use pre-built index
--ref="${ filter( lambda x: str( x[0] ) == str( $refGenomeSource.index ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] }"
#end if
--paired=$singlePaired.sPaired
#if $singlePaired.sPaired == "single":
--input1=$singlePaired.sInput1
--params=$singlePaired.sParams.sSettingsType
#if $singlePaired.sParams.sSettingsType == "full":
--skip=$singlePaired.sParams.sSkip
--alignLimit=$singlePaired.sParams.sAlignLimit
--trimH=$singlePaired.sParams.sTrimH
--trimL=$singlePaired.sParams.sTrimL
--mismatchSeed=$singlePaired.sParams.sMismatchSeed
--mismatchQual=$singlePaired.sParams.sMismatchQual
--seedLen=$singlePaired.sParams.sSeedLen
--rounding=$singlePaired.sParams.sRounding
--maqSoapAlign=$singlePaired.sParams.sMaqSoapAlign
--tryHard=$singlePaired.sParams.sTryHard
--valAlign=$singlePaired.sParams.sValAlign
--allValAligns=$singlePaired.sParams.sAllValAligns
--suppressAlign=$singlePaired.sParams.sSuppressAlign
--best=$singlePaired.sParams.sBestOption.sBest
#if $singlePaired.sParams.sBestOption.sBest == "doBest":
--maxBacktracks=$singlePaired.sParams.sBestOption.sdMaxBacktracks
--strata=$singlePaired.sParams.sBestOption.sdStrata
#else:
--maxBacktracks=$singlePaired.sParams.sBestOption.snMaxBacktracks
#end if
--offrate=$singlePaired.sParams.sOffrate
--seed=$singlePaired.sParams.sSeed
#end if
#else:
--input1=$singlePaired.pInput1
--input2=$singlePaired.pInput2
--maxInsert=$singlePaired.pMaxInsert
--mateOrient=$singlePaired.pMateOrient
--params=$singlePaired.pParams.pSettingsType
#if $singlePaired.pParams.pSettingsType == "full":
--skip=$singlePaired.pParams.pSkip
--alignLimit=$singlePaired.pParams.pAlignLimit
--trimH=$singlePaired.pParams.pTrimH
--trimL=$singlePaired.pParams.pTrimL
--mismatchSeed=$singlePaired.pParams.pMismatchSeed
--mismatchQual=$singlePaired.pParams.pMismatchQual
--seedLen=$singlePaired.pParams.pSeedLen
--rounding=$singlePaired.pParams.pRounding
--maqSoapAlign=$singlePaired.pParams.pMaqSoapAlign
--minInsert=$singlePaired.pParams.pMinInsert
--maxAlignAttempt=$singlePaired.pParams.pMaxAlignAttempt
--forwardAlign=$singlePaired.pParams.pForwardAlign
--reverseAlign=$singlePaired.pParams.pReverseAlign
--tryHard=$singlePaired.pParams.pTryHard
--valAlign=$singlePaired.pParams.pValAlign
--allValAligns=$singlePaired.pParams.pAllValAligns
--suppressAlign=$singlePaired.pParams.pSuppressAlign
--best=$singlePaired.pParams.pBestOption.pBest
#if $singlePaired.pParams.pBestOption.pBest == "doBest":
--maxBacktracks=$singlePaired.pParams.pBestOption.pdMaxBacktracks
--strata=$singlePaired.pParams.pBestOption.pdStrata
#else:
--maxBacktracks=$singlePaired.pParams.pBestOption.pnMaxBacktracks
#end if
--offrate=$singlePaired.pParams.pOffrate
--seed=$singlePaired.pParams.pSeed
#end if
#end if
</command>
<inputs>
<conditional name="refGenomeSource">
@@ -201,6 +221,8 @@
<option value="doAllValAligns">Report all valid alignments</option>
</param>
<param name="sSuppressAlign" type="integer" value="-1" label="Suppress all alignments for a read if more than n reportable alignments exist (-m)" help="-1 for no limit" />
<param name="sMaxFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads with a number of valid alignments exceeding the limit set with the -m option to a file (--max)" />
<param name="sUnmappedFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads that could not be aligned to a file (--un)" />
<conditional name="sBestOption">
<param name="sBest" type="select" label="Whether or not to make Bowtie guarantee that reported singleton alignments are 'best' in terms of stratum and in terms of the quality values at the mismatched positions (--best)" help="Removes all strand bias. Only affects which alignments are reported by Bowtie. Runs slower with best option">
<option value="noBest">Do not use best</option>
@@ -270,6 +292,8 @@
<option value="doAllValAligns">Report all valid alignments</option>
</param>
<param name="pSuppressAlign" type="integer" value="-1" label="Suppress all alignments for a pair if more than n reportable alignments exist (-m)" help="-1 for no limit" />
<param name="pMaxFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads with a number of valid alignments exceeding the limit set with the -m option to a file (--max)" />
<param name="pUnmappedFile" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write all reads that could not be aligned to a file (--un)" />
<conditional name="pBestOption">
<param name="pBest" type="select" label="Whether or not to make Bowtie guarantee that reported singleton alignments are 'best' in terms of stratum and in terms of the quality values at the mismatched positions (--best)" help="Removes all strand bias. Only affects which alignments are reported by Bowtie. Runs slower with best option">
<option value="noBest">Do not use best</option>
@@ -292,56 +316,106 @@
</conditional> <!-- pParams -->
</when> <!-- paired -->
</conditional> <!-- singlePaired -->
<param name="suppressHeader" type="boolean" truevalue="true" falsevalue="false" checked="true" label="Suppress the header in the output SAM file" help="Bowtie produces SAM with several lines of header information by default" />
<param name="suppressHeader" type="boolean" truevalue="true" falsevalue="false" checked="True" label="Suppress the header in the output SAM file" help="Bowtie produces SAM with several lines of header information by default" />
</inputs>
<outputs>
<data format="sam" name="output" >
<data format="sam" name="output" label="Mapped Reads">
<actions>
<conditional name="refGenomeSource.genomeSource">
<when value="indexed">
<action type="metadata" name="dbkey">
<option type="from_file" name="bowtie_indices.loc" column="1" offset="0">
<option type="from_file" name="bowtie_indices.loc" column="0" offset="0">
<filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
<filter type="param_value" ref="refGenomeSource.index" column="0"/>
<filter type="param_value" ref="refGenomeSource.index" column="1"/>
</option>
</action>
</when>
</conditional>
<!-- Special casing equCab2chrM to equCab2 -->
<action type="metadata" name="dbkey">
<option type="from_param" name="refGenomeSource.genomeSource" column="0" offset="0">
<filter type="insert_column" column="0" value="equCab2chrM"/>
<filter type="insert_column" column="0" value="equCab2"/>
<filter type="metadata_value" ref="output" name="dbkey" column="1" />
</option>
</action>
</actions>
</data>
<data format="fastqsanger" name="output_suppressed_reads_l" label="Suppressed Reads">
<filter>((
singlePaired['sPaired'] == "single" and
singlePaired['sParams']['sSettingsType'] == "full" and
singlePaired['sParams']['sMaxFile'] is True
) or (
singlePaired['sPaired'] == "paired" and
singlePaired['pParams']['pSettingsType'] == "full" and
singlePaired['pParams']['pMaxFile'] is True
))
</filter>
</data>
<data format="fastqsanger" name="output_suppressed_reads_r" label="Suppressed Reads (R)">
<filter>singlePaired['sPaired'] == "paired"</filter>
<filter>singlePaired['pParams']['pSettingsType'] == "full"</filter>
<filter>singlePaired['pParams']['pMaxFile'] is True</filter>
</data>
<data format="fastqsanger" name="output_unmapped_reads_l" label="Unmapped Reads (L)">
<filter>
((
singlePaired['sPaired'] == "single" and
singlePaired['sParams']['sSettingsType'] == "full" and
singlePaired['sParams']['sUnmappedFile'] is True
) or (
singlePaired['sPaired'] == "paired" and
singlePaired['pParams']['pSettingsType'] == "full" and
singlePaired['pParams']['pUnmappedFile'] is True
))
</filter>
</data>
<data format="fastqsanger" name="output_unmapped_reads_r" label="Unmapped Reads (R)">
<filter>singlePaired['sPaired'] == "paired"</filter>
<filter>singlePaired['pParams']['pSettingsType'] == "full"</filter>
<filter>singlePaired['pParams']['pUnmappedFile'] is True</filter>
</data>
</outputs>
<tests>
<test>
<!--
Bowtie command:
bowtie -p 4 -S +sam-nohead -q chrM_base test-data/bowtie_in2.fastqsanger > test-data/bowtie_out2.sam
bowtie -q -p 4 -S +sam-nohead chrM_base test-data/bowtie_in2.fastqsanger > bowtie_out6_u.sam
sort bowtie_out6_u.sam > bowtie_out6.sam
-p is the number of threads, which is hardcoded above. You need to replace the + with 2 dashes.
chrM_base needs to be the base location/name of the index files.
-->
<param name="genomeSource" value="indexed" />
<param name="index" value="equCab2chrM" />
<!-- this is the backwards-compatible "unique value" for this index, not an actual path -->
<param name="index" value="/galaxy/data/equCab2_chrM/bowtie_index/chrM" />
<param name="sPaired" value="single" />
<param name="sInput1" ftype="fastqsanger" value="bowtie_in2.fastqsanger" />
<param name="sSettingsType" value="preSet" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out2.sam" />
<output name="output" ftype="sam" file="bowtie_out6.sam" sort="True" />
</test>
<test>
<!--
Bowtie command:
bowtie-build -f test-data/chr_m.fasta chrM_base
bowtie -X 1000 +fr -n 2 -e 70 -l 28 +pairtries 100 +maxbts 800 -k 1 +best -p 4 -S +sam-nohead -q chrM_base -1 test-data/bowtie_in5.fastqsanger -2 test-data/bowtie_in6.fastqsanger > test-data/bowtie_out4.sam
bowtie-build -f test-data/phiX.fasta phiX_base
bowtie -q -X 1000 +ff -p 4 -S +sam-nohead -n 2 -e 70 -l 28 +pairtries 100 +maxbts 800 +best +un bowtie_out8_u.fastq phiX_base -1 test-data/bowtie_in5.fastqsanger -2 test-data/bowtie_in6.fastqsanger > bowtie_out7_u.sam
sort bowtie_out7_u.sam > bowtie_out7.sam
sort bowtie_out8_u_1.sam > bowtie_out8_1.sam
sort bowtie_out8_u_2.sam > bowtie_out8_2.sam
Then also need to modify bowtie_out8_1.sam and bowtie_out8_2.sam so that all @ lines come before sequence lines.
-p is the number of threads, hardcoded above. You need to replace the + with 2 dashes.
The two unmapped output files will be named bowtie_out8_1.fastq and bowtie_out8_2.fastq.
chrM_base is the index files' location/base name.
-->
<param name="genomeSource" value="history" />
<param name="ownFile" value="chr_m.fasta" />
<param name="ownFile" value="phiX.fasta" />
<param name="indexSettings" value="indexPreSet" />
<param name="sPaired" value="paired" />
<param name="pInput1" ftype="fastqsanger" value="bowtie_in5.fastqsanger" />
<param name="pInput2" ftype="fastqsanger" value="bowtie_in6.fastqsanger" />
<param name="pMaxInsert" value="1000" />
<param name="pMateOrient" value="fr" />
<param name="pMateOrient" value="ff" />
<param name="pSettingsType" value="full" />
<param name="pSkip" value="0" />
<param name="pAlignLimit" value="-1" />
@@ -360,23 +434,29 @@
<param name="pValAlign" value="1" />
<param name="pAllValAligns" value="noAllValAligns" />
<param name="pSuppressAlign" value="-1" />
<param name="pUnmappedFile" value="true" />
<param name="pMaxFile" value="false" />
<param name="pBest" value="doBest" />
<param name="pdMaxBacktracks" value="800" />
<param name="pdStrata" value="noStrata" />
<param name="pOffrate" value="-1" />
<param name="pSeed" value="-1" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out4.sam" />
<output name="output" ftype="sam" file="bowtie_out7.sam" sort="True" />
<output name="output_unmapped_reads_l" ftype="fastqsanger" file="bowtie_out8_1.fastq" sort="True" />
<output name="output_unmapped_reads_r" ftype="fastqsanger" file="bowtie_out8_2.fastq" sort="True" />
</test>
<test>
<!--
Bowtie command:
bowtie -n 2 -e 70 -l 28 -k 1 +maxbts 125 -y -p 4 -S +sam-nohead -q chrM_base test-data/bowtie_in2.fastqsanger > test-data/bowtie_out6.sam
bowtie -q -p 4 -S +sam-nohead -n 2 -e 70 -l 28 +maxbts 125 -y -k 1 chrM_base test-data/bowtie_in2.fastqsanger > bowtie_out9_u.sam
sort bowtie_out9_u.sam > bowtie_out9.sam
-p is the number of threads, hardcoded above. You need to replace the + with 2 dashes.
chrM_base is the index files' location/base name.
-->
<param name="genomeSource" value="indexed" />
<param name="index" value="equCab2chrM" />
<!-- this is the backwards-compatible "unique value" for this index, not an actual path -->
<param name="index" value="/galaxy/data/equCab2_chrM/bowtie_index/chrM" />
<param name="sPaired" value="single" />
<param name="sInput1" ftype="fastqsanger" value="bowtie_in2.fastqsanger" />
<param name="sSettingsType" value="full" />
@@ -393,23 +473,26 @@
<param name="sValAlign" value="1" />
<param name="sAllValAligns" value="noAllValAligns" />
<param name="sSuppressAlign" value="-1" />
<param name="sUnmappedFile" value="false" />
<param name="sMaxFile" value="false" />
<param name="sBest" value="noBest" />
<param name="snMaxBacktracks" value="125" />
<param name="sOffrate" value="-1" />
<param name="sSeed" value="-1" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out6.sam" />
<output name="output" ftype="sam" file="bowtie_out9.sam" sort="True" />
</test>
<test>
<!--
Bowtie command:
bowtie-build +offrate 5 +ftabchars 10 +little -f test-data/chr_m.fasta chrM_base
bowtie -X 1000 +fr -p 4 -S +sam-nohead -q chrM_base -1 test-data/bowtie_in5.fastqsanger -2 test-data/bowtie_in6.fastqsanger > test-data/bowtie_out8.sam
bowtie-build +offrate 5 +ftabchars 10 +little -f test-data/phiX.fasta phiX_base
bowtie -q -X 1000 +ff -p 4 -S +sam-nohead phiX_base -1 test-data/bowtie_in5.fastqsanger -2 test-data/bowtie_in6.fastqsanger > bowtie_out10_u.sam
sort bowtie_out10_u.sam > bowtie_out10.sam
-p is the number of threads, hardcoded above. You need to replace the + with 2 dashes.
chrM_base is the index files' location/base name.
-->
<param name="genomeSource" value="history" />
<param name="ownFile" value="chr_m.fasta" />
<param name="ownFile" value="phiX.fasta" />
<param name="indexSettings" value="indexFull" />
<param name="autoB" value="auto" />
<param name="nodc" value="dc" />
@@ -424,12 +507,12 @@
<param name="pInput1" ftype="fastqsanger" value="bowtie_in5.fastqsanger" />
<param name="pInput2" ftype="fastqsanger" value="bowtie_in6.fastqsanger" />
<param name="pMaxInsert" value="1000" />
<param name="pMateOrient" value="fr" />
<param name="pMateOrient" value="ff" />
<param name="pSettingsType" value="preSet" />
<param name="suppressHeader" value="true" />
<output name="output" ftype="sam" file="bowtie_out8.sam" />
<output name="output" ftype="sam" file="bowtie_out10.sam" sort="True" />
</test>
</tests>
</tests>
<help>
@@ -457,6 +540,12 @@ Bowtie accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare yo
------
**A Note on Built-in Reference Genomes**
Some genomes have multiple variants. If only one "type" of genome is listed, it is the Full version, which means that everything that came in the original genome data download (possibly with mitochondrial and plasmid DNA added if it wasn't already included). The Full version is available for every genome. Some genomes also come in the Canonical variant, which contains only the "canonical" (well-defined) chromosomes or segments, such as chr1-chr22, chrX, chrY, and chrM for human. Other variations include gender. These will come in the canonical form only, so the general Canonical variant is actually Canonical Female and the other is Canonical Male (identical to female excluding chrX).
------
**Outputs**
The output is in SAM format, and has the following columns::
@@ -510,92 +599,95 @@ This is an exhaustive list of Bowtie options:
For indexing (bowtie-build)::
-a No auto behavior. Disable the default behavior where bowtie automatically
selects values for --bmax/--bmaxdivn/--dcv/--packed parameters according
to the memory available. [off]
--packed Packing. Use a packed representation for DNA strings. [auto]
--bmax INT Suffix maximum. The maximum number of suffixes allowed in a block. [auto]
--bmaxdivn INT Suffix maximum fraction. The maximum number of suffixes allowed in a block
expressed as a fraction of the length of the reference. [4]
--dcv INT Difference-cover sample. Use INT as the period for the difference-cover
sample. [1024]
--nodc INT No difference-cover sample. Disable the difference-cover sample. [off]
-r No reference indexes. Do not build the NAME.3.ebwt and NAME.4.ebwt portions
of the index. Used only for paired-end alignment. [off]
-o Offrate. How many Burrows-Wheeler rows get marked by the indexer. The
indexer will mark every 2^INT rows. The marked rows correspond to rows on
the genome. [5]
-t INT Ftab. The lookup table used to calculate an initial Burrows-Wheeler range
with respect to the first INT characters of the query. Ftab is 4^INT+1
bytes. [10]
--ntoa N conversion. Convert Ns to As before building the index. Otherwise, Ns are
simply excluded from the index and Bowtie will not find alignments that
overlap them. [off]
--big Endianness. Endianness to use when serializing integers to the index file. [off]
--little Endianness. [--little]
--seed INT Random seed. Use INT as the seed for the pseudo-random number generator. [off]
--cutoff INT Cutoff. Index only the first INT bases of the reference sequences (cumulative
across sequences) and ignore the rest. [off]
-a No auto behavior. Disable the default behavior where bowtie automatically
selects values for --bmax/--bmaxdivn/--dcv/--packed parameters according
to the memory available. [off]
--packed Packing. Use a packed representation for DNA strings. [auto]
--bmax INT Suffix maximum. The maximum number of suffixes allowed in a block. [auto]
--bmaxdivn INT Suffix maximum fraction. The maximum number of suffixes allowed in a block
expressed as a fraction of the length of the reference. [4]
--dcv INT Difference-cover sample. Use INT as the period for the difference-cover
sample. [1024]
--nodc INT No difference-cover sample. Disable the difference-cover sample. [off]
-r No reference indexes. Do not build the NAME.3.ebwt and NAME.4.ebwt portions
of the index. Used only for paired-end alignment. [off]
-o Offrate. How many Burrows-Wheeler rows get marked by the indexer. The
indexer will mark every 2^INT rows. The marked rows correspond to rows on
the genome. [5]
-t INT Ftab. The lookup table used to calculate an initial Burrows-Wheeler range
with respect to the first INT characters of the query. Ftab is 4^INT+1
bytes. [10]
--ntoa N conversion. Convert Ns to As before building the index. Otherwise, Ns are
simply excluded from the index and Bowtie will not find alignments that
overlap them. [off]
--big Endianness. Endianness to use when serializing integers to the index file. [off]
--little Endianness. [--little]
--seed INT Random seed. Use INT as the seed for the pseudo-random number generator. [off]
--cutoff INT Cutoff. Index only the first INT bases of the reference sequences (cumulative
across sequences) and ignore the rest. [off]
For aligning (bowtie)::
-s INT Skip. Do not align the first INT reads or pairs in the input. [off]
-u INT Align limit. Only align the first INT reads/pairs from the input. [no limit]
-5 INT High-quality trim. Trim INT bases from the high-quality (left) end of each
read before alignment. [0]
-3 INT Low-quality trim. Trim INT bases from the low-quality (right) end of each
read before alignment. [0]
-n INT Mismatch seed. Maximum number of mismatches permitted in the seed (defined
with seed length option). Can be 0, 1, 2, or 3. [2]
-e INT Mismatch quality. Maximum permitted total of quality values at mismatched
read positions. Bowtie rounds quality values to the nearest 10 and saturates
at 30. [70]
-l INT Seed length. The number of bases on the high-quality end of the read to
which the -n ceiling applies. Must be at least 5. [28]
--nomaqround Suppress MAQ rounding. Values are internally rounded to the nearest 10 and
saturate at 30. This options turns off that rounding. [off]
-v INT MAQ- or SOAP-like alignment policy. This option turns off the default
MAQ-like alignment policy in favor of a SOAP-like one. End-to-end alignments
with at most INT mismatches. [off]
-I INT Minimum insert. The minimum insert size for valid paired-end alignments.
Does checking on untrimmed reads if -5 or -3 is used. [0]
-X INT Maximum insert. The maximum insert size for valid paired-end alignments.
Does checking on untrimmed reads if -5 or -3 is used. [250]
--fr Mate orientation. The upstream/downstream mate orientations for a valid
paired-end alignment against the forward reference strand. [--fr]
--rf Mate orientation. [off]
--ff Mate orientation. [off]
--pairtries INT Maximum alignment attempts for paired-end data. [100]
--nofw No forward aligning. Choosing this option means that Bowtie will not attempt
to align against the forward reference strand. [off]
--norc No reverse-complement aligning. Setting this will mean that Bowtie will not
attempt to align against the reverse-complement reference strand. [off]
--maxbts INT Maximum backtracks. The maximum number of backtracks permitted when aligning
a read in -n 2 or -n 3 mode. [125 without --best] [800 with --best]
-y Try hard. Try as hard as possible to find valid alignments when they exist,
including paired-end alignments. [off]
--chunkmbs INT Thread memory. The number of megabytes of memory a given thread is given to
store path descriptors in --best mode. [32]
-k INT Valid alignments. The number of valid alignments per read or pair. [off]
-a All valid alignments. Choosing this means that all valid alignments per read
or pair will be reported. [off]
-m INT Suppress alignments. Suppress all alignments for a particular read or pair
if more than INT reportable alignments exist for it. [no limit]
--best Best mode. Make Bowtie guarantee that reported singleton alignments are
"best" in terms of stratum (the number of mismatches) and quality values at
mismatched position. [off]
--strata Best strata. When running in best mode, report alignments that fall into the
best stratum if there are ones falling into more than one. [off]
-o INT Offrate override. Override the offrate of the index with INT. Some row
markings are discarded when index read into memory. INT must be greater than
the value used to build the index (default: 5). [off]
--seed INT Random seed. Use INT as the seed for the pseudo-random number generator. [off]
--snpphred INT Use INT as the SNP penalty for decoding colorspace alignments. True ratio of
SNPs per base in the subject genome. [see --snpfrac]
--snpfrac DEC Use DEC as the estimated ratio of SNPs per base when decoding colorspace
alignments. [0.001]
--col-keepends Keep the extreme-end nucleotides and qualities when decoding colorspace
alignments. [off]
-s INT Skip. Do not align the first INT reads or pairs in the input. [off]
-u INT Align limit. Only align the first INT reads/pairs from the input. [no limit]
-5 INT High-quality trim. Trim INT bases from the high-quality (left) end of each
read before alignment. [0]
-3 INT Low-quality trim. Trim INT bases from the low-quality (right) end of each
read before alignment. [0]
-n INT Mismatch seed. Maximum number of mismatches permitted in the seed (defined
with seed length option). Can be 0, 1, 2, or 3. [2]
-e INT Mismatch quality. Maximum permitted total of quality values at mismatched
read positions. Bowtie rounds quality values to the nearest 10 and saturates
at 30. [70]
-l INT Seed length. The number of bases on the high-quality end of the read to
which the -n ceiling applies. Must be at least 5. [28]
--nomaqround Suppress MAQ rounding. Values are internally rounded to the nearest 10 and
saturate at 30. This options turns off that rounding. [off]
-v INT MAQ- or SOAP-like alignment policy. This option turns off the default
MAQ-like alignment policy in favor of a SOAP-like one. End-to-end alignments
with at most INT mismatches. [off]
-I INT Minimum insert. The minimum insert size for valid paired-end alignments.
Does checking on untrimmed reads if -5 or -3 is used. [0]
-X INT Maximum insert. The maximum insert size for valid paired-end alignments.
Does checking on untrimmed reads if -5 or -3 is used. [250]
--fr Mate orientation. The upstream/downstream mate orientations for a valid
paired-end alignment against the forward reference strand. [--fr]
--rf Mate orientation. [off]
--ff Mate orientation. [off]
--pairtries INT Maximum alignment attempts for paired-end data. [100]
--nofw No forward aligning. Choosing this option means that Bowtie will not attempt
to align against the forward reference strand. [off]
--norc No reverse-complement aligning. Setting this will mean that Bowtie will not
attempt to align against the reverse-complement reference strand. [off]
--un FILENAME Write all reads that could not be aligned to file [off]
--max FILENAME Write all reads with a number of valid alignments exceeding the limit
set with the -m option to file [off]
--maxbts INT Maximum backtracks. The maximum number of backtracks permitted when aligning
a read in -n 2 or -n 3 mode. [125 without --best] [800 with --best]
-y Try hard. Try as hard as possible to find valid alignments when they exist,
including paired-end alignments. [off]
--chunkmbs INT Thread memory. The number of megabytes of memory a given thread is given to
store path descriptors in --best mode. [32]
-k INT Valid alignments. The number of valid alignments per read or pair. [off]
-a All valid alignments. Choosing this means that all valid alignments per read
or pair will be reported. [off]
-m INT Suppress alignments. Suppress all alignments for a particular read or pair
if more than INT reportable alignments exist for it. [no limit]
--best Best mode. Make Bowtie guarantee that reported singleton alignments are
"best" in terms of stratum (the number of mismatches) and quality values at
mismatched position. [off]
--strata Best strata. When running in best mode, report alignments that fall into the
best stratum if there are ones falling into more than one. [off]
-o INT Offrate override. Override the offrate of the index with INT. Some row
markings are discarded when index read into memory. INT must be greater than
the value used to build the index (default: 5). [off]
--seed INT Random seed. Use INT as the seed for the pseudo-random number generator. [off]
--snpphred INT Use INT as the SNP penalty for decoding colorspace alignments. True ratio of
SNPs per base in the subject genome. [see --snpfrac]
--snpfrac DEC Use DEC as the estimated ratio of SNPs per base when decoding colorspace
alignments. [0.001]
--col-keepends Keep the extreme-end nucleotides and qualities when decoding colorspace
alignments. [off]
</help>
</tool>
+7 -1
View File
@@ -100,7 +100,7 @@
<param name="suppressHeader" type="boolean" truevalue="true" falsevalue="false" checked="true" label="Suppress the header in the output SAM file" help="BWA produces SAM with several lines of header information" />
</inputs>
<outputs>
<data format="sam" name="output">
<data format="sam" name="output" label="Mapped Reads">
<actions>
<conditional name="genomeSource.refGenomeSource">
<when value="indexed">
@@ -226,6 +226,12 @@ BWA accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare your
------
**A Note on Built-in Reference Genomes**
Some genomes have multiple variants. If only one "type" of genome is listed, it is the Full version, which means that everything that came in the original genome data download (possibly with mitochondrial and plasmid DNA added if it wasn't already included). The Full version is available for every genome. Some genomes also come in the Canonical variant, which contains only the "canonical" (well-defined) chromosomes or segments, such as chr1-chr22, chrX, chrY, and chrM for human. Other variations include gender. These will come in the canonical form only, so the general Canonical variant is actually Canonical Female and the other is Canonical Male (identical to female excluding chrX).
------
**Outputs**
The output is in SAM format, and has the following columns::
@@ -47,7 +47,7 @@
</conditional>
</inputs>
<outputs>
<data format="sam" name="output1" />
<data format="sam" name="output1" label="Mapped Reads" />
</outputs>
<requirements>
<requirement type="package">lastz</requirement>
+1 -1
View File
@@ -129,7 +129,7 @@
</param>
</inputs>
<outputs>
<data format="tabular" name="output1">
<data format="tabular" name="output1" label="Mapped Reads">
<change_format>
<when input="out_format" value="sam" format="sam" />
</change_format>
+1 -1
View File
@@ -61,7 +61,7 @@
</conditional>
</inputs>
<outputs>
<data format="bam" name="output">
<data format="bam" name="output" label="Re-aligned Reads">
<actions>
<conditional name="refGenomeSource.refGenomeSource_type">
<when value="built-in">