From b5dab3a63f6f778df340b427c7614c3b03147fab Mon Sep 17 00:00:00 2001 From: Kelly Vincent Date: Fri, 22 Jan 2010 10:49:38 -0500 Subject: [PATCH] Removed SOLiD option from BWA, cleaned up Bowtie and BWA wrapper interfaces, and changed name of BWA index loc file --- buildbot_setup.sh | 3 +- tool-data/bwa_index.loc.sample | 29 ++ tools/sr_mapping/bowtie_color_wrapper.xml | 149 +++++---- tools/sr_mapping/bowtie_wrapper.py | 10 +- tools/sr_mapping/bowtie_wrapper.xml | 145 +++++---- tools/sr_mapping/bwa_wrapper.py | 196 ++++++------ tools/sr_mapping/bwa_wrapper.xml | 353 ++++++++-------------- 7 files changed, 458 insertions(+), 427 deletions(-) create mode 100644 tool-data/bwa_index.loc.sample diff --git a/buildbot_setup.sh b/buildbot_setup.sh index 8c1fe87c13e..1d778fb8c7d 100644 --- a/buildbot_setup.sh +++ b/buildbot_setup.sh @@ -21,6 +21,7 @@ LINKS=" /depot/data2/galaxy/blastdb.loc /depot/data2/galaxy/bowtie_indices.loc /depot/data2/galaxy/bowtie_indices_color.loc +/depot/data2/galaxy/bwa_index.loc /depot/data2/galaxy/encode_datasets.loc /galaxy/home/universe/encode_feature_partitions /depot/data2/galaxy/lastz_seqs.loc @@ -32,8 +33,6 @@ LINKS=" /depot/data2/galaxy/quality_scores.loc /depot/data2/galaxy/regions.loc /depot/data2/galaxy/sam_fa_indices.loc -/depot/data2/galaxy/sequence_index_base.loc -/depot/data2/galaxy/sequence_index_color.loc /depot/data2/galaxy/taxonomy /depot/data2/galaxy/twobit.loc " diff --git a/tool-data/bwa_index.loc.sample b/tool-data/bwa_index.loc.sample new file mode 100644 index 00000000000..5500d8460fe --- /dev/null +++ b/tool-data/bwa_index.loc.sample @@ -0,0 +1,29 @@ +#This is a sample file distributed with Galaxy that enables tools +#to use a directory of BWA indexed sequences data files. You will need +#to create these data files and then create a bwa_index.loc file +#similar to this one (store it in this directory) that points to +#the directories in which those files are stored. The bwa_index.loc +#file has this format (white space characters are TAB characters): +# +# +# +#So, for example, if you had phiX indexed stored in +#/depot/data2/galaxy/phiX/base/, +#then the bwa_index.loc entry would look like this: +# +#phiX /depot/data2/galaxy/phiX/base/phiX.fa +# +#and your /depot/data2/galaxy/phiX/base/ directory +#would contain phiX.fa.* files: +# +#-rw-r--r-- 1 james universe 830134 2005-09-13 10:12 phiX.fa.amb +#-rw-r--r-- 1 james universe 527388 2005-09-13 10:12 phiX.fa.ann +#-rw-r--r-- 1 james universe 269808 2005-09-13 10:12 phiX.fa.bwt +#...etc... +# +#Your bwa_index.loc file should include an entry per line for each +#index set you have stored. The "file" in the path does not actually +#exist, but it is the prefix for the actual index files. For example: +# +#phiX /depot/data2/galaxy/phiX/base/phiX.fa +#hg18 /depot/data2/galaxy/hg18/base/hg18.fa diff --git a/tools/sr_mapping/bowtie_color_wrapper.xml b/tools/sr_mapping/bowtie_color_wrapper.xml index d393de8e19c..de2e9b9abe9 100644 --- a/tools/sr_mapping/bowtie_color_wrapper.xml +++ b/tools/sr_mapping/bowtie_color_wrapper.xml @@ -205,9 +205,9 @@ - + - + @@ -220,7 +220,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -309,7 +309,7 @@ - + @@ -384,7 +384,7 @@ - + @@ -392,7 +392,7 @@ - + @@ -533,6 +533,8 @@ Bowtie_ is a short read aligner designed to be ultrafast and memory-efficient. It is developed by Ben Langmead and Cole Trapnell. Please cite: Langmead B, Trapnell C, Pop M, Salzberg SL. Ultrafast and memory-efficient alignment of short DNA sequences to the human genome. Genome Biology 10:R25. +This tool uses Bowtie version 0.12.1. + .. _Bowtie: http://bowtie-bio.sourceforge.net/index.shtml ------ @@ -541,7 +543,7 @@ Bowtie_ is a short read aligner designed to be ultrafast and memory-efficient. I .. class:: warningmark -There is no such thing (yet) as automated gearshift in short read mapping. It is all like stick-shift driving in San Francisco. In other words = running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading `documentation`__ and experimenting. Fortunaly, Galaxy makes experimenting easy. +There is no such thing (yet) as an automated gearshift in short read mapping. It is all like stick-shift driving in San Francisco. In other words = running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading the `documentation`__ and experimenting. Fortunately, Galaxy makes experimenting easy. .. __: http://bowtie-bio.sourceforge.net/index.shtml @@ -549,7 +551,7 @@ There is no such thing (yet) as automated gearshift in short read mapping. It is **Input formats** -Bowtie accepts files in Sanger FASTQ format. +Bowtie accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare your files. ------ @@ -605,52 +607,93 @@ All of the options have a default value. You can change any of them. Most of the 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/--dcv/--packed parameters according to the memory available. [off] - -p 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] - --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] - -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] - --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] + --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] diff --git a/tools/sr_mapping/bowtie_wrapper.py b/tools/sr_mapping/bowtie_wrapper.py index 40409f2674d..a03132c6b36 100644 --- a/tools/sr_mapping/bowtie_wrapper.py +++ b/tools/sr_mapping/bowtie_wrapper.py @@ -186,7 +186,7 @@ def __main__(): inoref, options.ioffrate, iftab, intoa, iendian, iseed, icutoff, colorspace ) except ValueError: - indexing_cmds = '' + indexing_cmds = '%s' % colorspace try: shutil.copy( options.ref, tmp_index_dir ) except Exception, e: @@ -311,10 +311,10 @@ def __main__(): snpphred = '--snpphred %s' % options.snpphred else: snpphred = '' - if options.snpfrac != 'None' and float( options.snpfrac ) >= 0: - snpfrac = '--snpfrac %s' % options.snpfrac - else: - snpfrac = '' + if options.snpfrac != 'None' and float( options.snpfrac ) >= 0: + snpfrac = '--snpfrac %s' % options.snpfrac + else: + snpfrac = '' if options.keepends != 'None' and options.keepends == 'doKeepends': keepends = '--col-keepends' else: diff --git a/tools/sr_mapping/bowtie_wrapper.xml b/tools/sr_mapping/bowtie_wrapper.xml index 97c3c00503c..2361b8d7911 100644 --- a/tools/sr_mapping/bowtie_wrapper.xml +++ b/tools/sr_mapping/bowtie_wrapper.xml @@ -199,9 +199,9 @@ - + - + @@ -214,7 +214,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -374,7 +374,7 @@ - + @@ -506,6 +506,8 @@ Bowtie_ is a short read aligner designed to be ultrafast and memory-efficient. It is developed by Ben Langmead and Cole Trapnell. Please cite: Langmead B, Trapnell C, Pop M, Salzberg SL. Ultrafast and memory-efficient alignment of short DNA sequences to the human genome. Genome Biology 10:R25. +This tool uses Bowtie version 0.12.1. + .. _Bowtie: http://bowtie-bio.sourceforge.net/index.shtml ------ @@ -514,7 +516,7 @@ Bowtie_ is a short read aligner designed to be ultrafast and memory-efficient. I .. class:: warningmark -There is no such thing (yet) as automated gearshift in short read mapping. It is all like stick-shift driving in San Francisco. In other words = running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading `documentation`__ and experimenting. Fortunaly, Galaxy makes experimenting easy. +There is no such thing (yet) as an automated gearshift in short read mapping. It is all like stick-shift driving in San Francisco. In other words = running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading the `documentation`__ and experimenting. Fortunately, Galaxy makes experimenting easy. .. __: http://bowtie-bio.sourceforge.net/index.shtml @@ -522,7 +524,7 @@ There is no such thing (yet) as automated gearshift in short read mapping. It is **Input formats** -Bowtie accepts files in Sanger FASTQ format. +Bowtie accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare your files. ------ @@ -578,52 +580,93 @@ All of the options have a default value. You can change any of them. Most of the 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/--dcv/--packed parameters according to the memory available. [off] - -p 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] - --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] - -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] - --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] + --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] diff --git a/tools/sr_mapping/bwa_wrapper.py b/tools/sr_mapping/bwa_wrapper.py index 184b9ff5024..57198586327 100644 --- a/tools/sr_mapping/bwa_wrapper.py +++ b/tools/sr_mapping/bwa_wrapper.py @@ -3,6 +3,35 @@ """ Runs BWA on single-end or paired-end data. Produces a SAM file containing the mappings. +Works with BWA version 0.5.3. + +usage: bwa_wrapper.py [options] + -t, --threads=t: The number of threads to use + -r, --ref=r: The reference genome to use or index + -f, --fastq=f: The (forward) fastq file to use for the mapping + -F, --rfastq=F: The reverse fastq file to use for mapping if paired-end data + -u, --output=u: The file to save the output (SAM format) + -g, --genAlignType=g: The type of pairing (single or paired) + -p, --params=p: Parameter setting to use (pre_set or full) + -s, --fileSource=s: Whether to use a previously indexed reference sequence or one from history (indexed or history) + -n, --maxEditDist=n: Maximum edit distance if integer + -m, --fracMissingAligns=m: Fraction of missing alignments given 2% uniform base error rate if fraction + -o, --maxGapOpens=o: Maximum number of gap opens + -e, --maxGapExtens=e: Maximum number of gap extensions + -d, --disallowLongDel=d: Disallow a long deletion within specified bps + -i, --disallowIndel=i: Disallow indel within specified bps + -l, --seed=l: Take the first specified subsequences + -k, --maxEditDistSeed=k: Maximum edit distance to the seed + -M, --mismatchPenalty=M: Mismatch penalty + -O, --gapOpenPenalty=O: Gap open penalty + -E, --gapExtensPenalty=E: Gap extension penalty + -R, --suboptAlign=R: Proceed with suboptimal alignments even if the top hit is a repeat + -N, --noIterSearch=N: Disable iterative search + -T, --outputTopN=T: Output top specified hits + -S, --maxInsertSize=S: Maximum insert size for a read pair to be considered mapped good + -P, --maxOccurPairing=P: Maximum occurrences of a read for pairings + -D, --dbkey=D: Dbkey for reference genome + -H, --suppressHeader=h: Suppress header """ import optparse, os, shutil, sys, tempfile @@ -14,138 +43,133 @@ def stop_err( msg ): def __main__(): #Parse Command Line parser = optparse.OptionParser() - parser.add_option('', '--threads', dest='threads', help='The number of threads to use') - parser.add_option('', '--ref', dest='ref', help='The reference genome to use or index') - parser.add_option('', '--fastq', dest='fastq', help='The (forward) fastq file to use for the mapping') - parser.add_option('', '--rfastq', dest='rfastq', help='The reverse fastq file to use for mapping if paired-end data') - parser.add_option('', '--output', dest='output', help='The file to save the output (SAM format)') - parser.add_option('', '--genAlignType', dest='genAlignType', help='The type of pairing (single or paired)') - parser.add_option('', '--params', dest='params', help='Parameter setting to use (pre_set or full)') - parser.add_option('', '--fileType', dest='fileType', help='Type of reference sequence file (solid or solexa)') - parser.add_option('', '--fileSource', dest='fileSource', help='Whether to use a previously indexed reference sequence or one form history (indexed or history)') - parser.add_option('-n', '--maxEditDist', dest='maxEditDist', help='Maximum edit distance if integer') - parser.add_option('', '--fracMissingAligns', dest='fracMissingAligns', help='Fraction of missing alignments given 2% uniform base error rate if fraction') - parser.add_option('-o', '--maxGapOpens', dest='maxGapOpens', help='Maximum number of gap opens') - parser.add_option('-e', '--maxGapExtens', dest='maxGapExtens', help='Maximum number of gap extensions') - parser.add_option('-d', '--disallowLongDel', dest='disallowLongDel', help='Disallow a long deletion within specified bps') - parser.add_option('-i', '--disallowIndel', dest='disallowIndel', help='Disallow indel within specified bps') - parser.add_option('-l', '--seed', dest='seed', help='Take the first specified subsequences') - parser.add_option('-k', '--maxEditDistSeed', dest='maxEditDistSeed', help='Maximum edit distance to the seed') - parser.add_option('-M', '--mismatchPenalty', dest='mismatchPenalty', help='Mismatch penalty') - parser.add_option('-O', '--gapOpenPenalty', dest='gapOpenPenalty', help='Gap open penalty') - parser.add_option('-E', '--gapExtensPenalty', dest='gapExtensPenalty', help='Gap extension penalty') - parser.add_option('-c', '--colorSpaceRev', dest='colorSpaceRev', help="Reverse query but don't complement it") - parser.add_option('-R', '--suboptAlign', dest='suboptAlign', help='Proceed with suboptimal alignments even if the top hit is a repeat') - parser.add_option('-N', '--noIterSearch', dest='noIterSearch', help='Disable iterative search') - parser.add_option('', '--outputTopN', dest='outputTopN', help='Output top specified hits') - parser.add_option('', '--maxInsertSize', dest='maxInsertSize', help='Maximum insert size for a read pair to be considered mapped good') - parser.add_option('', '--maxOccurPairing', dest='maxOccurPairing', help='Maximum occurrences of a read for pairings') - parser.add_option('', '--dbkey', dest='dbkey', help='') - parser.add_option('', '--suppressHeader', dest='suppressHeader', help='Suppress header') + parser.add_option( '-t', '--threads', dest='threads', help='The number of threads to use' ) + parser.add_option( '-r', '--ref', dest='ref', help='The reference genome to use or index' ) + parser.add_option( '-f', '--fastq', dest='fastq', help='The (forward) fastq file to use for the mapping' ) + parser.add_option( '-F', '--rfastq', dest='rfastq', help='The reverse fastq file to use for mapping if paired-end data' ) + parser.add_option( '-u', '--output', dest='output', help='The file to save the output (SAM format)' ) + parser.add_option( '-g', '--genAlignType', dest='genAlignType', help='The type of pairing (single or paired)' ) + parser.add_option( '-p', '--params', dest='params', help='Parameter setting to use (pre_set or full)' ) + parser.add_option( '-s', '--fileSource', dest='fileSource', help='Whether to use a previously indexed reference sequence or one form history (indexed or history)' ) + parser.add_option( '-n', '--maxEditDist', dest='maxEditDist', help='Maximum edit distance if integer' ) + parser.add_option( '-m', '--fracMissingAligns', dest='fracMissingAligns', help='Fraction of missing alignments given 2% uniform base error rate if fraction' ) + parser.add_option( '-o', '--maxGapOpens', dest='maxGapOpens', help='Maximum number of gap opens' ) + parser.add_option( '-e', '--maxGapExtens', dest='maxGapExtens', help='Maximum number of gap extensions' ) + parser.add_option( '-d', '--disallowLongDel', dest='disallowLongDel', help='Disallow a long deletion within specified bps' ) + parser.add_option( '-i', '--disallowIndel', dest='disallowIndel', help='Disallow indel within specified bps' ) + parser.add_option( '-l', '--seed', dest='seed', help='Take the first specified subsequences' ) + parser.add_option( '-k', '--maxEditDistSeed', dest='maxEditDistSeed', help='Maximum edit distance to the seed' ) + parser.add_option( '-M', '--mismatchPenalty', dest='mismatchPenalty', help='Mismatch penalty' ) + parser.add_option( '-O', '--gapOpenPenalty', dest='gapOpenPenalty', help='Gap open penalty' ) + parser.add_option( '-E', '--gapExtensPenalty', dest='gapExtensPenalty', help='Gap extension penalty' ) + parser.add_option( '-R', '--suboptAlign', dest='suboptAlign', help='Proceed with suboptimal alignments even if the top hit is a repeat' ) + parser.add_option( '-N', '--noIterSearch', dest='noIterSearch', help='Disable iterative search' ) + parser.add_option( '-T', '--outputTopN', dest='outputTopN', help='Output top specified hits' ) + parser.add_option( '-S', '--maxInsertSize', dest='maxInsertSize', help='Maximum insert size for a read pair to be considered mapped good' ) + parser.add_option( '-P', '--maxOccurPairing', dest='maxOccurPairing', help='Maximum occurrences of a read for pairings' ) + parser.add_option( '-D', '--dbkey', dest='dbkey', help='Dbkey for reference genome' ) + parser.add_option( '-H', '--suppressHeader', dest='suppressHeader', help='Suppress header' ) (options, args) = parser.parse_args() # make temp directory for placement of indices and copy reference file there tmp_index_dir = tempfile.mkdtemp() # index if necessary if options.fileSource == 'history': try: - shutil.copy(options.ref, tmp_index_dir) - except Exception, erf: - stop_err('Error creating temp directory for indexing purposes\n' + str(erf)) + shutil.copy( options.ref, tmp_index_dir ) + except Exception, e: + stop_err( 'Error creating temp directory for indexing purposes\n' + str( e ) ) try: - size = os.stat(options.ref).st_size + size = os.stat( options.ref ).st_size if size <= 2**30: indexingAlg = 'is' else: indexingAlg = 'bwtsw' except: indexingAlg = 'is' - if options.fileType == 'solid': - indexing_cmds = '-c -a %s' % indexingAlg - else: - indexing_cmds = '-a %s' % indexingAlg - options.ref = os.path.join(tmp_index_dir,os.path.split(options.ref)[1]) - cmd1 = 'bwa index %s %s 2> /dev/null' % (indexing_cmds, options.ref) + indexing_cmds = '-a %s' % indexingAlg + options.ref = os.path.join( tmp_index_dir, os.path.split( options.ref )[1] ) + cmd1 = 'bwa index %s %s 2> /dev/null' % ( indexing_cmds, options.ref ) try: - os.chdir(tmp_index_dir) - os.system(cmd1) - except Exception, erf: - stop_err('Error indexing reference sequence\n' + str(erf)) + os.chdir( tmp_index_dir ) + os.system( cmd1 ) + except Exception, e: + stop_err( 'Error indexing reference sequence\n' + str( e ) ) # set up aligning and generate aligning command options if options.params == 'pre_set': - if options.fileType == 'solid': - aligning_cmds = '-c -t %s' % options.threads - else: - aligning_cmds = '-t %s' % options.threads + aligning_cmds = '-t %s' % options.threads gen_alignment_cmds = '' else: - aligning_cmds = '-n %s -o %s -e %s -d %s -i %s %s -k %s -t %s -M %s -O %s -E %s %s %s %s' % \ - ((options.fracMissingAligns, options.maxEditDist)[options.maxEditDist != '0'], - options.maxGapOpens, options.maxGapExtens, options.disallowLongDel, - options.disallowIndel, ('',' -l %s'%options.seed)[options.seed!='-1'], - options.maxEditDistSeed, options.threads, options.mismatchPenalty, - options.gapOpenPenalty, options.gapExtensPenalty, ('',' -c')[options.colorSpaceRev=='true'], - ('',' -R')[options.suboptAlign=='true'], ('',' -N')[options.noIterSearch=='true']) + if options.maxEditDist != '0': + editDist = options.maxEditDist + else: + editDist = options.fracMissingAligns + if options.seed != '-1': + seed = '-l %s' % options.seed + else: + seed = '' + if options.suboptAlign == 'true': + suboptAlign = '-R' + else: + suboptAlign = '' + if options.noIterSearch == 'true': + noIterSearch = '-N' + else: + noIterSearch = '' + aligning_cmds = '-n %s -o %s -e %s -d %s -i %s %s -k %s -t %s -M %s -O %s -E %s %s %s' % \ + ( editDist, options.maxGapOpens, options.maxGapExtens, options.disallowLongDel, + options.disallowIndel, seed, options.maxEditDistSeed, options.threads, + options.mismatchPenalty, options.gapOpenPenalty, options.gapExtensPenalty, + suboptAlign, noIterSearch ) if options.genAlignType == 'single': gen_alignment_cmds = '-n %s' % options.outputTopN elif options.genAlignType == 'paired': - gen_alignment_cmds = '-a %s -o %s' % (options.maxInsertSize, options.maxOccurPairing) + gen_alignment_cmds = '-a %s -o %s' % ( options.maxInsertSize, options.maxOccurPairing ) # print 'options.genAlignType: %s and commands: %s' % (options.genAlignType, gen_alignment_cmds) # set up output files tmp_align_out = tempfile.NamedTemporaryFile() tmp_align_out2 = tempfile.NamedTemporaryFile() # prepare actual aligning and generate aligning commands - cmd2 = 'bwa aln %s %s %s > %s 2> /dev/null' % (aligning_cmds, options.ref, options.fastq, tmp_align_out.name) + cmd2 = 'bwa aln %s %s %s > %s 2> /dev/null' % ( aligning_cmds, options.ref, options.fastq, tmp_align_out.name ) cmd2b = '' if options.genAlignType == 'paired': - cmd2b = 'bwa aln %s %s %s > %s 2> /dev/null' % (aligning_cmds, options.ref, options.rfastq, tmp_align_out2.name) - cmd3 = 'bwa sampe %s %s %s %s %s %s >> %s 2> /dev/null' % (gen_alignment_cmds, options.ref, tmp_align_out.name, tmp_align_out2.name, options.fastq, options.rfastq, options.output) + cmd2b = 'bwa aln %s %s %s > %s 2> /dev/null' % ( aligning_cmds, options.ref, options.rfastq, tmp_align_out2.name ) + cmd3 = 'bwa sampe %s %s %s %s %s %s >> %s 2> /dev/null' % ( gen_alignment_cmds, options.ref, tmp_align_out.name, tmp_align_out2.name, options.fastq, options.rfastq, options.output ) else: - cmd3 = 'bwa samse %s %s %s %s >> %s 2> /dev/null' % (gen_alignment_cmds, options.ref, tmp_align_out.name, options.fastq, options.output) + cmd3 = 'bwa samse %s %s %s %s >> %s 2> /dev/null' % ( gen_alignment_cmds, options.ref, tmp_align_out.name, options.fastq, options.output ) # align try: - os.system(cmd2) - except Exception, erf: - stop_err("Error aligning sequence\n" + str(erf)) + os.system( cmd2 ) + except Exception, e: + stop_err( 'Error aligning sequence\n' + str( e ) ) # and again if paired data try: if cmd2b: - os.system(cmd2b) + os.system( cmd2b ) except Exception, erf: - stop_err("Error aligning second sequence\n" + str(erf)) + stop_err( 'Error aligning second sequence\n' + str( e ) ) # generate align try: - os.system(cmd3) - except Exception, erf: - stop_err("Error sequence aligning sequence\n" + str(erf)) + os.system( cmd3 ) + except Exception, e: + stop_err( 'Error sequence aligning sequence\n' + str( e ) ) # clean up temp files tmp_align_out.close() tmp_align_out2.close() # remove header if necessary if options.suppressHeader == 'true': tmp_out = tempfile.NamedTemporaryFile() - cmd4 = 'cp %s %s' % (options.output, tmp_out.name) try: - os.system(cmd4) - except Exception, erf: - stop_err("Error copying output file before removing headers\n" + str(erf)) - output = file(tmp_out.name, 'r') - fout = file(options.output, 'w') - header = True - line = output.readline() - while line.strip() != '': - if header: - if line.startswith('@HD') or line.startswith('@SQ') or line.startswith('@RG') or line.startswith('@PG') or line.startswith('@CO'): - pass - else: - header = False - fout.write(line) - else: - fout.write(line) - line = output.readline() + shutil.move( options.output, tmp_out.name ) + except Exception, e: + stop_err( 'Error moving output file before removing headers\n' + str( e ) ) + fout = file( options.output, 'w' ) + for line in file( tmp_out.name, 'r' ): + if not ( line.startswith( '@HD' ) or line.startswith( '@SQ' ) or line.startswith( '@RG' ) or line.startswith( '@PG' ) or line.startswith( '@CO' ) ): + fout.write( line ) fout.close() tmp_out.close() # clean up temp dir - if os.path.exists(tmp_index_dir): - shutil.rmtree(tmp_index_dir) + if os.path.exists( tmp_index_dir ): + shutil.rmtree( tmp_index_dir ) if __name__=="__main__": __main__() diff --git a/tools/sr_mapping/bwa_wrapper.xml b/tools/sr_mapping/bwa_wrapper.xml index 06321e86d6f..39f82be598f 100644 --- a/tools/sr_mapping/bwa_wrapper.xml +++ b/tools/sr_mapping/bwa_wrapper.xml @@ -1,112 +1,48 @@ - + - - bwa_wrapper.py - --threads="4" - #if $solidOrSolexa.solidRefGenomeSource.refGenomeSource == "history": - --ref=$solidOrSolexa.solidRefGenomeSource.ownFile - #else: - --ref=$solidOrSolexa.solidRefGenomeSource.indices.value - #end if - --fastq=$paired.input1 - #if $paired.sPaired == "paired": - --rfastq=$paired.input2 - #else: - --rfastq="None" - #end if - --output=$output - --genAlignType=$paired.sPaired - --params=$params.source_select - --fileType=$solidOrSolexa.solidSolexa - --fileSource=$solidOrSolexa.solidRefGenomeSource.refGenomeSource - #if $params.source_select == "pre_set": - --maxEditDist="None" - --fracMissingAligns="None" - --maxGapOpens="None" - --maxGapExtens="None" - --disallowLongDel="None" - --disallowIndel="None" - --seed="None" - --maxEditDistSeed="None" - --mismatchPenalty="None" - --gapOpenPenalty="None" - --gapExtensPenalty="None" - --colorSpaceRev="None" - --suboptAlign="None" - --noIterSearch="None" - --outputTopN="None" - --maxInsertSize="None" - --maxOccurPairing="None" - #else: - --maxEditDist=$params.maxEditDist - --fracMissingAligns=$params.fracMissingAligns - --maxGapOpens=$params.maxGapOpens - --maxGapExtens=$params.maxGapExtens - --disallowLongDel=$params.disallowLongDel - --disallowIndel=$params.disallowIndel - --seed=$params.seed - --maxEditDistSeed=$params.maxEditDistSeed - --mismatchPenalty=$params.mismatchPenalty - --gapOpenPenalty=$params.gapOpenPenalty - --gapExtensPenalty=$params.gapExtensPenalty - --colorSpaceRev=$params.colorSpaceRev - --suboptAlign=$params.suboptAlign - --noIterSearch=$params.noIterSearch - --outputTopN=$params.outputTopN - --maxInsertSize=$params.maxInsertSize - --maxOccurPairing=$params.maxOccurPairing - #end if - #if $solidOrSolexa.solidRefGenomeSource.refGenomeSource == "history": - --dbkey=$dbkey - #else: - --dbkey="None" - #end if - --suppressHeader=$suppressHeader + bwa_wrapper.py +--threads="4" +#if $genomeSource.refGenomeSource == "history": +--ref=$genomeSource.ownFile +#else: +--ref=$genomeSource.indices.value +#end if +--fastq=$paired.input1 +#if $paired.sPaired == "paired": +--rfastq=$paired.input2 +#else: +--rfastq="None" +#end if +--output=$output --genAlignType=$paired.sPaired --params=$params.source_select --fileSource=$genomeSource.refGenomeSource +#if $params.source_select == "pre_set": +--maxEditDist="None" --fracMissingAligns="None" --maxGapOpens="None" --maxGapExtens="None" --disallowLongDel="None" --disallowIndel="None" --seed="None" --maxEditDistSeed="None" --mismatchPenalty="None" --gapOpenPenalty="None" --gapExtensPenalty="None" --suboptAlign="None" --noIterSearch="None" --outputTopN="None" --maxInsertSize="None" --maxOccurPairing="None" +#else: +--maxEditDist=$params.maxEditDist --fracMissingAligns=$params.fracMissingAligns --maxGapOpens=$params.maxGapOpens --maxGapExtens=$params.maxGapExtens --disallowLongDel=$params.disallowLongDel --disallowIndel=$params.disallowIndel --seed=$params.seed --maxEditDistSeed=$params.maxEditDistSeed --mismatchPenalty=$params.mismatchPenalty --gapOpenPenalty=$params.gapOpenPenalty --gapExtensPenalty=$params.gapExtensPenalty --suboptAlign=$params.suboptAlign --noIterSearch=$params.noIterSearch --outputTopN=$params.outputTopN --maxInsertSize=$params.maxInsertSize --maxOccurPairing=$params.maxOccurPairing +#end if +#if $genomeSource.refGenomeSource == "history": +--dbkey=$dbkey +#else: +--dbkey="None" +#end if +--suppressHeader=$suppressHeader - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + @@ -122,32 +58,28 @@ - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -157,85 +89,32 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -249,22 +128,27 @@ - - + - + - - + + @@ -277,21 +161,22 @@ - - + **What it does** -BWA is a fast light-weighted tool that aligns relatively short sequences (queries) to a sequence database (large), such as the human reference genome. It is developed by Heng Li at the Sanger Insitute. +BWA is a fast light-weighted tool that aligns relatively short sequences (queries) to a sequence database (large), such as the human reference genome. It is developed by Heng Li at the Sanger Insitute. Li H. and Durbin R. (2009) Fast and accurate short read alignment with Burrows-Wheeler transform. Bioinformatics, 25, 1754-60. + +This tool uses BWA version 0.5.3. ------ @@ -299,7 +184,7 @@ BWA is a fast light-weighted tool that aligns relatively short sequences (querie .. class:: warningmark -There is no such thing (yet) as automated gearshift in short read mapping. It is all like stick-shift driving in San Francisco. In other words = running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading `documentation`__ and experimenting. Fortunaly, Galaxy makes experimenting easy. +There is no such thing (yet) as an automated gearshift in short read mapping. It is all like stick-shift driving in San Francisco. In other words = running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading the `documentation`__ and experimenting. Fortunately, Galaxy makes experimenting easy. .. __: http://bio-bwa.sourceforge.net/ @@ -307,7 +192,7 @@ There is no such thing (yet) as automated gearshift in short read mapping. It is **Input formats** -BWA accepts files in Sanger FASTQ format. +BWA accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare your files. ------ @@ -315,31 +200,35 @@ BWA accepts files in Sanger FASTQ format. The output is in SAM format, and has the following columns:: - 1 QNAME - Query (pair) NAME - 2 FLAG - bitwise FLAG - 3 RNAME - Reference sequence NAME - 4 POS - 1-based leftmost POSition/coordinate of clipped sequence - 5 MAPQ - MAPping Quality (Phred-scaled) - 6 CIGAR - extended CIGAR string - 7 MRNM - Mate Reference sequence NaMe ('=' if same as RNAME) - 8 MPOS - 1-based Mate POSition - 9 ISIZE - Inferred insert SIZE - 10 SEQ - query SEQuence on the same strand as the reference - 11 QUAL - query QUALity (ASCII-33 gives the Phred base quality) - 12 OPT - variable OPTional fields in the format TAG:VTYPE:VALU + Column Description + -------- -------------------------------------------------------- + 1 QNAME Query (pair) NAME + 2 FLAG bitwise FLAG + 3 RNAME Reference sequence NAME + 4 POS 1-based leftmost POSition/coordinate of clipped sequence + 5 MAPQ MAPping Quality (Phred-scaled) + 6 CIGAR extended CIGAR string + 7 MRNM Mate Reference sequence NaMe ('=' if same as RNAME) + 8 MPOS 1-based Mate POSition + 9 ISIZE Inferred insert SIZE + 10 SEQ query SEQuence on the same strand as the reference + 11 QUAL query QUALity (ASCII-33 gives the Phred base quality) + 12 OPT variable OPTional fields in the format TAG:VTYPE:VALU The flags are as follows:: - Flag - Description - 0x0001 - the read is paired in sequencing - 0x0002 - the read is mapped in a proper pair - 0x0004 - the query sequence itself is unmapped - 0x0008 - the mate is unmapped - 0x0010 - strand of the query (1 for reverse) - 0x0020 - strand of the mate - 0x0040 - the read is the first read in a pair - 0x0080 - the read is the second read in a pair - 0x0100 - the alignment is not primary + Flag Description + ------ ------------------------------------- + Flag Description + 0x0001 the read is paired in sequencing + 0x0002 the read is mapped in a proper pair + 0x0004 the query sequence itself is unmapped + 0x0008 the mate is unmapped + 0x0010 strand of the query (1 for reverse) + 0x0020 strand of the mate + 0x0040 the read is the first read in a pair + 0x0080 the read is the second read in a pair + 0x0100 the alignment is not primary It looks like this (scroll sideways to see the entire example):: @@ -393,13 +282,17 @@ For **aln**:: For **samse**:: -n INT Output up to INT top hits. Value -1 to disable outputting multiple - hits. [-1] + hits. NOTE: Entering a value other than -1 will result in output that + is not in SAM format, and therefore not usable further down the + pipeline. Check the BWA documentation for details on the format of + the output. [-1] For **sampe**:: -a INT Maximum insert size for a read pair to be considered as being mapped - properly. Since 0.4.5, this option is only used when there are not - enough good alignment to infer the distribution of insert sizes. [500] + properly. Since version 0.4.5, this option is only used when there + are not enough good alignment to infer the distribution of insert + sizes. [500] -o INT Maximum occurrences of a read for pairing. A read with more occurrences will be treated as a single-end read. Reducing this parameter helps faster pairing. [100000]