Mercurial > repos > cmonjeau > stacks
diff bwa_wrapper.xml @ 0:d6ba40f6c824
first commit
author | cmonjeau |
---|---|
date | Mon, 24 Aug 2015 09:29:12 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bwa_wrapper.xml Mon Aug 24 09:29:12 2015 +0000 @@ -0,0 +1,339 @@ +<tool id="bwa_wrapper_stacks" name="Map with BWA for STACKS" version="1.2.3"> + <description>from zip file with fastqsanger files</description> + <requirements> + <requirement type="package" version="0.6.2">bwa</requirement> + </requirements> + <description></description> + <parallelism method="basic"></parallelism> + <command interpreter="python"> + bwa_wrapper.py + --threads="4" + + #if $input1.ext == "fastqillumina": + --illumina1.3 + #end if + + ## 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}" + + ## output file + --output="${output}" + + ## run parameters + --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> + <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"> + <filter type="sort_by" column="2" /> + <validator type="no_options" message="No indexes are available" /> + </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> + </param> + <when value="single"> + <param name="input1" type="data" format="zip" label="Zip file" help="Zip file with several FASTQ with either Sanger-scaled quality values (fastqsanger) or Illumina-scaled quality values (fastqillumina)" /> + </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="zip" name="output" label="${tool.name} on ${on_string}: mapped reads"/> + </outputs> + <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/ + + +Instructions to add the functionality of archives management in Galaxy on the `eBiogenouest HUB wiki <https://www.e-biogenouest.org/wiki/ManArchiveGalaxy>`_ . + +------ + +**Input formats** + +BWA accepts files in either Sanger FASTQ format (galaxy type *fastqsanger*) or Illumina FASTQ format (galaxy type *fastqillumina*). Use the FASTQ Groomer to prepare your files. + +------ + +**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> + <citations> + <citation type="doi">10.1111/mec.12354</citation> + <citation type="doi">10.1111/mec.12330</citation> + <citation type="doi">10.1534/g3.111.000240</citation> + <citation type="doi">10.1534/genetics.111.127324</citation> + <citation type="doi">10.1111/j.1755-0998.2010.02967.x</citation> + <citation type="doi">10.1073/pnas.1006538107</citation> + + <citation type="bibtex">@INPROCEEDINGS{JOBIM2013, + author = {Le Bras, Y. and ROULT, A. and Monjeaud, C. and Bahin, M. and Quenez, O. and Heriveau, C. and Bretaudeau, A. and Sallou, O. and Collin, O.}, + title = {Towards a Life Sciences Virtual Research Environment: An e-Science initiative in Western France}, + booktitle = {JOBIM 2013 Proceedings}, + year = {2013}, + url = {https://www.e-biogenouest.org/resources/128}, + pages = {97-106} + }</citation> +</citations> +</tool> + +