view bwa_color_wrapper.xml @ 2:3a001705dc94 draft default tip

Uploaded
author evan
date Fri, 06 Jun 2014 12:55:09 -0400
parents 8d92246f41bb
children
line wrap: on
line source

<tool id="bwa_color_wrapper" name="Map with BWA for SOLiD" version="1.0.2">
  <requirements>
    <requirement type="package" version="0.5.9">bwa</requirement>
  </requirements>
  <description></description>
  <parallelism method="basic"></parallelism>
  <command interpreter="python">
    bwa_wrapper.py 
      --threads="\${GALAXY_SLOTS:-4}"
      --color-space

      ## reference source
      --fileSource="${genomeSource.refGenomeSource}"
      #if $genomeSource.refGenomeSource == "history":
        ##build index on the fly
        --ref="${genomeSource.ownFile}"
        --dbkey="${dbkey}"
      #else:
        ##use precomputed indexes
        --ref="${genomeSource.indices.fields.path}"
        --do_not_build_index
      #end if

      ## input file(s)
      --input1="${paired.input1}"
      #if $paired.sPaired == "paired":
        --input2="${paired.input2}"
      #end if

      ## output file
      --output="${output}"

      ## run parameters
      --genAlignType="${paired.sPaired}"
      --params="${params.source_select}"
      #if $params.source_select != "pre_set":
        --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}"
        --outputTopNDisc="${params.outputTopNDisc}"
        --maxInsertSize="${params.maxInsertSize}"
        --maxOccurPairing="${params.maxOccurPairing}"
        #if $params.readGroup.specReadGroup == "yes"
          --rgid="${params.readGroup.rgid}"
          --rgcn="${params.readGroup.rgcn}"
          --rgds="${params.readGroup.rgds}"
          --rgdt="${params.readGroup.rgdt}"
          --rgfo="${params.readGroup.rgfo}"
          --rgks="${params.readGroup.rgks}"
          --rglb="${params.readGroup.rglb}"
          --rgpg="${params.readGroup.rgpg}"
          --rgpi="${params.readGroup.rgpi}"
          --rgpl="${params.readGroup.rgpl}"
          --rgpu="${params.readGroup.rgpu}"
          --rgsm="${params.readGroup.rgsm}"
        #end if
      #end if

      ## suppress output SAM header
      --suppressHeader="${suppressHeader}"
  </command>
  <requirements>
    <requirement type="package">bwa</requirement>
  </requirements>
  <inputs>
    <conditional name="genomeSource">
      <param name="refGenomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?">
        <option value="indexed">Use a built-in index</option>
        <option value="history">Use one from the history</option>
      </param>
      <when value="indexed">
        <param name="indices" type="select" label="Select a reference genome">
          <options from_data_table="bwa_indexes_color">
            <filter type="sort_by" column="2" />
            <validator type="no_options" message="No indexes are available for the selected input dataset" />
          </options>
        </param>
      </when>
      <when value="history">
        <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select a reference from history" />
      </when>
    </conditional>
    <conditional name="paired">
      <param name="sPaired" type="select" label="Is this library mate-paired?">
        <option value="single">Single-end</option>
        <option value="paired">Paired-end</option>
      </param>
      <when value="single">
        <param name="input1" type="data" format="fastqcssanger" label="FASTQ file (Nucleotide-space recoded from color-space)">
          <help>Convert color-space data to nucleotide-space (see help section below for steps). Must have Sanger-scaled quality values with ASCII offset 33</help>
        </param>
      </when>
      <when value="paired">
        <param name="input1" type="data" format="fastqcssanger" label="Forward FASTQ file (Nucleotide-space recoded from color-space)" help="Must have Sanger-scaled quality values with ASCII offset 33">
          <help>Convert color-space data to nucleotide-space (see help section below for steps). Must have Sanger-scaled quality values with ASCII offset 33</help>
        </param>
        <param name="input2" type="data" format="fastqcssanger" label="Reverse FASTQ file (Nucleotide-space recoded from color-space)" help="Must have Sanger-scaled quality values with ASCII offset 33">
          <help>Convert color-space data to nucleotide-space (see help section below for steps). Must have Sanger-scaled quality values with ASCII offset 33</help>
        </param>
      </when>
    </conditional>
    <conditional name="params">
      <param name="source_select" type="select" label="BWA settings to use" help="For most mapping needs use Commonly Used settings. If you want full control use Full Parameter List">
        <option value="pre_set">Commonly Used</option>
        <option value="full">Full Parameter List</option>
      </param>
      <when value="pre_set" />
      <when value="full">
        <param name="maxEditDist" type="integer" value="0" label="Maximum edit distance (aln -n)" help="Enter this value OR a fraction of missing alignments, not both" />
        <param name="fracMissingAligns" type="float" value="0.04" label="Fraction of missing alignments given 2% uniform base error rate (aln -n)" help="Enter this value OR maximum edit distance, not both" />
        <param name="maxGapOpens" type="integer" value="1" label="Maximum number of gap opens (aln -o)" />
        <param name="maxGapExtens" type="integer" value="-1" label="Maximum number of gap extensions (aln -e)" help="-1 for k-difference mode (disallowing long gaps)" />
        <param name="disallowLongDel" type="integer" value="16" label="Disallow long deletion within [value] bp towards the 3'-end (aln -d)" />
        <param name="disallowIndel" type="integer" value="5" label="Disallow insertion/deletion within [value] bp towards the end (aln -i)" />
        <param name="seed" type="integer" value="-1" label="Number of first subsequences to take as seed (aln -l)" help="Enter -1 for infinity" />
        <param name="maxEditDistSeed" type="integer" value="2" label="Maximum edit distance in the seed (aln -k)" />
        <param name="mismatchPenalty" type="integer" value="3" label="Mismatch penalty (aln -M)" help="BWA will not search for suboptimal hits with a score lower than [value]" />
        <param name="gapOpenPenalty" type="integer" value="11" label="Gap open penalty (aln -O)" />
        <param name="gapExtensPenalty" type="integer" value="4" label="Gap extension penalty (aln -E)" />
        <param name="suboptAlign" type="integer" optional="True" label="Proceed with suboptimal alignments if there are no more than INT equally best hits. (aln -R)" help="For paired-end reads only. By default, BWA only searches for suboptimal alignments if the top hit is unique. Using this option has no effect on accuracy for single-end reads. It is mainly designed for improving the alignment accuracy of paired-end reads. However, the pairing procedure will be slowed down, especially for very short reads (~32bp)" />
        <param name="noIterSearch" type="boolean" truevalue="true" falsevalue="false" checked="no" label="Disable iterative search (aln -N)" help="All hits with no more than maxDiff differences will be found. This mode is much slower than the default" />
        <param name="outputTopN" type="integer" value="3" label="Maximum number of alignments to output in the XA tag for reads paired properly (samse/sampe -n)" help="If a read has more than INT hits, the XA tag will not be written" />
        <param name="outputTopNDisc" type="integer" value="10" label="Maximum number of alignments to output in the XA tag for disconcordant read pairs (excluding singletons) (sampe -N)" help="For paired-end reads only. If a read has more than INT hits, the XA tag will not be written" />
        <param name="maxInsertSize" type="integer" value="500" label="Maximum insert size for a read pair to be considered as being mapped properly (sampe -a)" help="For paired-end reads only. Only used when there are not enough good alignments to infer the distribution of insert sizes" />
        <param name="maxOccurPairing" type="integer" value="100000" label="Maximum occurrences of a read for pairing (sampe -o)" help="For paired-end reads only. A read with more occurrences will be treated as a single-end read. Reducing this parameter helps faster pairing" />
        <conditional name="readGroup">
          <param name="specReadGroup" type="select" label="Specify the read group for this file? (samse/sampe -r)">
            <option value="yes">Yes</option>
            <option value="no" selected="True">No</option>
          </param>
          <when value="yes">
            <param name="rgid" type="text" size="25" label="Read group identifier (ID). Each @RG line must have a unique ID. The value of ID is used in the RG 
tags of alignment records. Must be unique among all read groups in header section." help="Required if RG specified. Read group 
IDs may be modified when merging SAM files in order to handle collisions." />
            <param name="rgcn" type="text" size="25" label="Sequencing center that produced the read (CN)" help="Optional" />
            <param name="rgds" type="text" size="25" label="Description (DS)" help="Optional" />
            <param name="rgdt" type="text" size="25" label="Date that run was produced (DT)" help="Optional. ISO8601 format date or date/time, like YYYY-MM-DD" />
            <param name="rgfo" type="text" size="25" label="Flow order (FO). The array of nucleotide bases that correspond to the nucleotides used for each 
flow of each read." help="Optional. Multi-base flows are encoded in IUPAC format, and non-nucleotide flows by 
various other characters. Format : /\*|[ACMGRSVTWYHKDBN]+/" />
            <param name="rgks" type="text" size="25" label="The array of nucleotide bases that correspond to the key sequence of each read (KS)" help="Optional" />
            <param name="rglb" type="text" size="25" label="Library name (LB)" help="Required if RG specified" />
            <param name="rgpg" type="text" size="25" label="Programs used for processing the read group (PG)" help="Optional" />
            <param name="rgpi" type="text" size="25" label="Predicted median insert size (PI)" help="Optional" />
            <param name="rgpl" type="text" size="25" label="Platform/technology used to produce the reads (PL)" help="Required if RG specified. Valid values : CAPILLARY, LS454, ILLUMINA, 
SOLID, HELICOS, IONTORRENT and PACBIO" />
            <param name="rgpu" type="text" size="25" label="Platform unit (PU)" help="Optional. Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" />
            <param name="rgsm" type="text" size="25" label="Sample (SM)" help="Required if RG specified. Use pool name where a pool is being sequenced" />
          </when>
          <when value="no" />
        </conditional>
      </when>
    </conditional>
    <param name="suppressHeader" type="boolean" truevalue="true" falsevalue="false" checked="False" 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" label="${tool.name} on ${on_string}: mapped reads">
      <actions>
        <conditional name="genomeSource.refGenomeSource">
          <when value="indexed">
            <action type="metadata" name="dbkey">
              <option type="from_data_table" name="bwa_indexes_color" column="1">
                <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
                <filter type="param_value" ref="genomeSource.indices" column="0" />
              </option>
            </action>
          </when>
          <when value="history">
            <action type="metadata" name="dbkey">
              <option type="from_param" name="genomeSource.ownFile" param_attribute="dbkey" />
            </action>
          </when>
        </conditional>
      </actions>
    </data>
  </outputs>
  <tests>
    <test>
      <!--
      BWA commands:
      cp test-data/hg19chrX_midpart.fasta hg19chrX_midpart.fasta
      bwa index -c -a is hg19chrX_midpart.fasta
      bwa aln -t 4 -c hg19chrX_midpart.fasta test-data/bwa_wrapper_in4.fastqcssanger > bwa_wrapper_out4.sai
      bwa samse hg19chrX_midpart.fasta bwa_wrapper_out4.sai test-data/bwa_wrapper_in4.fastqcssanger > bwa_wrapper_out4.u.sam
      hg19chrX_midpart.fasta is the prefix for the reference files (hg19chrX_midpart.fasta.amb, hg19chrX_midpart.fasta.ann, hg19chrX_midpart.fasta.bwt, ...)
      It's just part of hg19 chrX, from the middle of the chromosome
      plain old sort doesn't handle underscores like python:
      python -c "import sys; lines=file(sys.argv[1],'rb').readlines(); lines.sort(); file(sys.argv[2],'wb').write(''.join(lines))" bwa_wrapper_out4.u.sam bwa_wrapper_out4.sam
      -->
      <param name="refGenomeSource" value="history" />
      <param name="ownFile" value="hg19chrX_midpart.fasta" />
      <param name="sPaired" value="single" />
      <param name="input1" value="bwa_wrapper_in4.fastqcssanger" ftype="fastqcssanger" />
      <param name="source_select" value="pre_set" />
      <param name="suppressHeader" value="false" />
      <output name="output" file="bwa_wrapper_out4.sam" ftype="sam" sort="True" lines_diff="2" />
    </test>
    <test>
      <!--
      BWA commands:
      bwa aln -t 4 -c equCab2chrM_cs.fa test-data/bwa_wrapper_in5.fastqcssanger > bwa_wrapper_out5a.sai
      bwa aln -t 4 -c equCab2chrM_cs.fa test-data/bwa_wrapper_in6.fastqcssanger > bwa_wrapper_out5b.sai
      bwa sampe equCab2chrM_cs.fa bwa_wrapper_out5a.sai bwa_wrapper_out5b.sai test-data/bwa_wrapper_in5.fastqcssanger test-data/bwa_wrapper_in6.fastqcssanger > bwa_wrapper_out5.u.sam
      equCab2chrM_cs.fa is the prefix of the index files (equCab2chrM_cs.fa.amb, equCab2chrM_cs.fa.ann, ...)
      remove the comment lines (beginning with '@') from the resulting sam file
      plain old sort doesn't handle underscores like python:
      python -c "import sys; lines=file(sys.argv[1],'rb').readlines(); lines.sort(); file(sys.argv[2],'wb').write(''.join(lines))" bwa_wrapper_out5.u.sam bwa_wrapper_out5.sam
      -->
      <param name="refGenomeSource" value="indexed" />
      <param name="indices" value="equCab2chrM" />
      <param name="sPaired" value="paired" />
      <param name="input1" value="bwa_wrapper_in5.fastqcssanger" ftype="fastqcssanger" />
      <param name="input2" value="bwa_wrapper_in6.fastqcssanger" ftype="fastqcssanger" />
      <param name="source_select" value="pre_set" />
      <param name="suppressHeader" value="true" />
      <output name="output" file="bwa_wrapper_out5.sam" ftype="sam" sort="True" />
    </test>
    <test>
      <!--
      BWA commands:
      bwa aln -n 0.04 -o 1 -e -1 -d 16 -i 5 -k 2 -t 4 -M 3 -O 11 -E 4 -R -N -c hg19chrX_midpart.fasta test-data/bwa_wrapper_in4.fastqcssanger > bwa_wrapper_out6.sai
      bwa samse -n 3 -r "@RG\tID:474747\tDS:description\tDT:2011-03-14\tLB:lib-child-1-A\tPI:200\tPL:SOLID\tSM:child-1" hg19chrX_midpart.fasta bwa_wrapper_out6.sai test-data/bwa_wrapper_in4.fastqcssanger > bwa_wrapper_out6.u.sam
      hg19chrX_midpart_cs.fa is the prefix of the index files (hg19chrX_midpart.fa.amb, hg19chrX_midpart.fa.ann, ...)
      (It's just part of hg19 chrX, from the middle of the chromosome)
      plain old sort doesn't handle underscores like python:
      python -c "import sys; lines=file(sys.argv[1],'rb').readlines(); lines.sort(); file(sys.argv[2],'wb').write(''.join(lines))" bwa_wrapper_out6.u.sam bwa_wrapper_out6.sam
      -->
      <param name="refGenomeSource" value="indexed" />
      <param name="indices" value="hg19chrX_midpart" />
      <param name="sPaired" value="single" />
      <param name="input1" value="bwa_wrapper_in4.fastqcssanger" ftype="fastqcssanger" />
      <param name="source_select" value="full" />
      <param name="maxEditDist" value="0" />  
      <param name="fracMissingAligns" value="0.04" />
      <param name="maxGapOpens" value="1" />
      <param name="maxGapExtens" value="-1" />
      <param name="disallowLongDel" value="16" />
      <param name="disallowIndel" value="5" />
      <param name="seed" value="-1" />
      <param name="maxEditDistSeed" value="2" />
      <param name="mismatchPenalty" value="3" />
      <param name="gapOpenPenalty" value="11" />
      <param name="gapExtensPenalty" value="4" />
      <param name="suboptAlign" value="" />
      <param name="noIterSearch" value="true" />
      <param name="outputTopN" value="3" />
      <param name="outputTopNDisc" value="10" />
      <param name="maxInsertSize" value="500" />
      <param name="maxOccurPairing" value="100000" />
      <param name="specReadGroup" value="yes" />
      <param name="rgid" value="474747" />
      <param name="rgcn" value="" />
      <param name="rgds" value="description" />
      <param name="rgdt" value="2011-03-14" />
      <param name="rgfo" value="" />
      <param name="rgks" value="" />
      <param name="rglb" value="lib-child-1-A" />
      <param name="rgpg" value="" />
      <param name="rgpi" value="200" />
      <param name="rgpl" value="SOLID" />
      <param name="rgpu" value="" />
      <param name="rgsm" value="child-1" />
      <param name="suppressHeader" value="false" />
      <output name="output" file="bwa_wrapper_out6.sam" ftype="sam" sort="True" lines_diff="2" />
    </test>
    <test>
      <!--
      BWA commands:
      cp test-data/chr_m.fasta chr_m.fasta
      bwa index -c -a is chr_m.fasta
      bwa aln -n 0.04 -o 1 -e -1 -d 16 -i 5 -k 2 -t 4 -M 3 -O 11 -E 4 -R -N -c chr_m.fasta test-data/bwa_wrapper_in5.fastqcssanger > bwa_wrapper_out7a.sai
      bwa aln -n 0.04 -o 1 -e -1 -d 16 -i 5 -k 2 -t 4 -M 3 -O 11 -E 4 -R -N -c chr_m.fasta test-data/bwa_wrapper_in6.fastqcssanger > bwa_wrapper_out7b.sai
      bwa sampe -a 100 -o 2 -n 3 -N 10 chr_m.fasta bwa_wrapper_out7a.sai bwa_wrapper_out7b.sai test-data/bwa_wrapper_in5.fastqcssanger test-data/bwa_wrapper_in6.fastqcssanger > bwa_wrapper_out7.u.sam
      chr_m.fasta is the prefix of the index files (chr_m.fasta.amb, chr_m.fasta.ann, ...)
      plain old sort doesn't handle underscores like python:
      python -c "import sys; lines=file(sys.argv[1],'rb').readlines(); lines.sort(); file(sys.argv[2],'wb').write(''.join(lines))" bwa_wrapper_out7.u.sam bwa_wrapper_out7.sam
      -->
      <param name="refGenomeSource" value="history" />
      <param name="ownFile" value="chr_m.fasta" />
      <param name="sPaired" value="paired" />
      <param name="input1" value="bwa_wrapper_in5.fastqcssanger" ftype="fastqcssanger" />
      <param name="input2" value="bwa_wrapper_in6.fastqcssanger" ftype="fastqcssanger" />
      <param name="source_select" value="full" />
      <param name="maxEditDist" value="0" />  
      <param name="fracMissingAligns" value="0.04" />
      <param name="maxGapOpens" value="1" />
      <param name="maxGapExtens" value="-1" />
      <param name="disallowLongDel" value="16" />
      <param name="disallowIndel" value="5" />
      <param name="seed" value="-1" />
      <param name="maxEditDistSeed" value="2" />
      <param name="mismatchPenalty" value="3" />
      <param name="gapOpenPenalty" value="11" />
      <param name="gapExtensPenalty" value="4" />
      <param name="suboptAlign" value="" />
      <param name="noIterSearch" value="true" />
      <param name="outputTopN" value="3" />
      <param name="outputTopNDisc" value="10" />
      <param name="maxInsertSize" value="100" />
      <param name="maxOccurPairing" value="2" />
      <param name="specReadGroup" value="no" />
      <param name="suppressHeader" value="false" />
      <output name="output" file="bwa_wrapper_out7.sam" ftype="sam" sort="True" lines_diff="2" />
    </test>
  </tests> 
  <help>

**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. Li H. and Durbin R. (2009) Fast and accurate short read alignment with Burrows-Wheeler transform. Bioinformatics, 25, 1754-60. 

------

**Know what you are doing**

.. class:: warningmark

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/

------

**Input formats**

BWA accepts files in Sanger FASTQ format. Use the FASTQ Groomer to prepare your files, set to either FASTQ Sanger or FASTQ Color Space Sanger as appropriate. 

If you have Color Space Sanger, it must be converted to nucleotide-space first. To do this, use the Manipulate FASTQ tool under NGS: QC and manipulation, with the following settings:
    Manipulate reads on Sequence Content, choosing Change Adapter Base, and having the text box empty.
    Manipulate reads on Sequence Content, doing a String Translate from "01234." to "ACGTN".


------

**A Note on Built-in Reference Genomes**

The default variant for all genomes is "Full", defined as all primary chromosomes (or scaffolds/contigs) including mitochondrial plus associated unmapped, plasmid, and other segments. When only one version of a genome is available in this tool, it represents the default "Full" variant. Some genomes will have more than one variant available. The "Canonical Male" or sometimes simply "Canonical" variant contains the primary chromosomes for a genome. For example a human "Canonical" variant contains chr1-chr22, chrX, chrY, and chrM. The "Canonical Female" variant contains the primary chromosomes excluding chrY.

------

**Outputs**

The output is in SAM format, and has the following columns::

    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

It looks like this (scroll sideways to see the entire example)::

  QNAME	FLAG	RNAME	POS	MAPQ	CIAGR	MRNM	MPOS	ISIZE	SEQ	QUAL	OPT
  HWI-EAS91_1_30788AAXX:1:1:1761:343	4	*	0	0	*	*	0	0	AAAAAAANNAAAAAAAAAAAAAAAAAAAAAAAAAAACNNANNGAGTNGNNNNNNNGCTTCCCACAGNNCTGG	hhhhhhh;;hhhhhhhhhhh^hOhhhhghhhfhhhgh;;h;;hhhh;h;;;;;;;hhhhhhghhhh;;Phhh
  HWI-EAS91_1_30788AAXX:1:1:1578:331	4	*	0	0	*	*	0	0	GTATAGANNAATAAGAAAAAAAAAAATGAAGACTTTCNNANNTCTGNANNNNNNNTCTTTTTTCAGNNGTAG	hhhhhhh;;hhhhhhhhhhhhhhhhhhhhhhhhhhhh;;h;;hhhh;h;;;;;;;hhhhhhhhhhh;;hhVh

-------

**BWA settings**

All of the options have a default value. You can change any of them. All of the options in BWA have been implemented here.

------

**BWA parameter list**

This is an exhaustive list of BWA options:

For **aln**::

  -n NUM  Maximum edit distance if the value is INT, or the fraction of missing
          alignments given 2% uniform base error rate if FLOAT. In the latter
          case, the maximum edit distance is automatically chosen for different 
          read lengths. [0.04]
  -o INT  Maximum number of gap opens [1]
  -e INT  Maximum number of gap extensions, -1 for k-difference mode
          (disallowing long gaps) [-1]
  -d INT  Disallow a long deletion within INT bp towards the 3'-end [16]
  -i INT  Disallow an indel within INT bp towards the ends [5]
  -l INT  Take the first INT subsequence as seed. If INT is larger than the
          query sequence, seeding will be disabled. For long reads, this option 
          is typically ranged from 25 to 35 for '-k 2'. [inf]
  -k INT  Maximum edit distance in the seed [2]
  -t INT  Number of threads (multi-threading mode) [1]
  -M INT  Mismatch penalty. BWA will not search for suboptimal hits with a score
          lower than (bestScore-misMsc). [3]
  -O INT  Gap open penalty [11]
  -E INT  Gap extension penalty [4]
  -c      Reverse query but not complement it, which is required for alignment
          in the color space.
  -R      Proceed with suboptimal alignments even if the top hit is a repeat. By
          default, BWA only searches for suboptimal alignments if the top hit is
          unique. Using this option has no effect on accuracy for single-end
          reads. It is mainly designed for improving the alignment accuracy of
          paired-end reads. However, the pairing procedure will be slowed down,
          especially for very short reads (~32bp).
  -N      Disable iterative search. All hits with no more than maxDiff
          differences will be found. This mode is much slower than the default.

For **samse**::

  -n INT  Maximum number of alignments to output in the XA tag for reads paired
          properly. If a read has more than INT hits, the XA tag will not be
          written. [3]
  -r STR  Specify the read group in a format like '@RG\tID:foo\tSM:bar' [null]

For **sampe**::

  -a INT  Maximum insert size for a read pair to be considered as being mapped
          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]
  -n INT  Maximum number of alignments to output in the XA tag for reads paired
          properly. If a read has more than INT hits, the XA tag will not be
          written. [3]
  -N INT  Maximum number of alignments to output in the XA tag for disconcordant
          read pairs (excluding singletons). If a read has more than INT hits,
          the XA tag will not be written. [10]
  -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]
  -r STR  Specify the read group in a format like '@RG\tID:foo\tSM:bar' [null]

For specifying the read group in **samse** or **sampe**, use the following::

  @RG   Read group. Unordered multiple @RG lines are allowed. 
  ID    Read group identifier. Each @RG line must have a unique ID. The value of
        ID is used in the RG tags of alignment records. Must be unique among all
        read groups in header section. Read group IDs may be modified when
        merging SAM files in order to handle collisions. 
  CN    Name of sequencing center producing the read. 
  DS    Description. 
  DT    Date the run was produced (ISO8601 date or date/time). 
  FO    Flow order. The array of nucleotide bases that correspond to the
        nucleotides used for each flow of each read. Multi-base flows are encoded
        in IUPAC format, and non-nucleotide flows by various other characters.
        Format : /\*|[ACMGRSVTWYHKDBN]+/ 
  KS    The array of nucleotide bases that correspond to the key sequence of each read. 
  LB    Library. 
  PG    Programs used for processing the read group. 
  PI    Predicted median insert size. 
  PL    Platform/technology used to produce the reads. Valid values : CAPILLARY,
        LS454, ILLUMINA, SOLID, HELICOS, IONTORRENT and PACBIO. 
  PU    Platform unit (e.g. flowcell-barcode.lane for Illumina or slide for
        SOLiD). Unique identifier. 
  SM    Sample. Use pool name where a pool is being sequenced. 

  </help>
</tool>