Mercurial > repos > devteam > bowtie2
comparison bowtie2_wrapper.xml @ 0:96d2e31a3938
Imported from capsule None
author | devteam |
---|---|
date | Mon, 27 Jan 2014 09:25:15 -0500 |
parents | |
children | c1ec08cb34f9 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:96d2e31a3938 |
---|---|
1 <tool id="bowtie2" name="Bowtie2" version="0.2"> | |
2 <!-- Wrapper compatible with Bowtie version 2.0.0 --> | |
3 <description>is a short-read aligner</description> | |
4 <version_command>bowtie2 --version</version_command> | |
5 <requirements> | |
6 <requirement type="package" version="2.1.0">bowtie2</requirement> | |
7 <requirement type="package" version="0.1.18">samtools</requirement> | |
8 </requirements> | |
9 | |
10 <command> | |
11 ## prepare bowtie2 index | |
12 #set index_path = '' | |
13 #if str($reference_genome.source) == "history": | |
14 bowtie2-build "$reference_genome.own_file" genome; ln -s "$reference_genome.own_file" genome.fa; | |
15 #set index_path = 'genome' | |
16 #else: | |
17 #set index_path = $reference_genome.index.fields.path | |
18 #end if | |
19 | |
20 ## execute bowtie2 | |
21 bowtie2 | |
22 | |
23 ## number of threads | |
24 -p \${GALAXY_SLOTS:-4} | |
25 | |
26 ## index file path | |
27 -x $index_path | |
28 | |
29 ## check for single/pair-end | |
30 #if str( $library.type ) == "single" | |
31 ## prepare inputs | |
32 -U $library.input_1 | |
33 | |
34 #if $output_unaligned_reads_l | |
35 --un $output_unaligned_reads_l | |
36 #end if | |
37 #else | |
38 ## prepare inputs | |
39 -1 $library.input_1 | |
40 -2 $library.input_2 | |
41 -I $library.min_insert | |
42 -X $library.max_insert | |
43 | |
44 #if $output_unaligned_reads_l | |
45 --un-conc $output_unaligned_reads_l | |
46 #end if | |
47 #end if | |
48 | |
49 ## configure settings | |
50 #if str($params.full) == "yes": | |
51 ## add alignment type | |
52 $params.align_type | |
53 | |
54 ## add performance | |
55 $params.performance | |
56 | |
57 ## add time flag | |
58 $params.time | |
59 | |
60 ## add nofw/norc | |
61 $params.nofw_norc | |
62 | |
63 ## set gbar | |
64 --gbar $params.gbar | |
65 | |
66 ## check skip | |
67 #if str($params.skip) != "0": | |
68 -s $params.skip | |
69 #end if | |
70 | |
71 ## check upto | |
72 #if str($params.upto) != "0": | |
73 -u $params.upto | |
74 #end if | |
75 | |
76 ## check trim5 | |
77 #if str($params.trim5) != "0": | |
78 -5 $params.trim5 | |
79 #end if | |
80 | |
81 ## check trim3 | |
82 #if str($params.trim3) != "0": | |
83 -3 $params.trim3 | |
84 #end if | |
85 #end if | |
86 | |
87 ## read group information | |
88 #if str($read_group.selection) == "yes": | |
89 #if $read_group.rgid and $read_group.rglb and $read_group.rgpl and $read_group.rgsm: | |
90 --rg-id "$read_group.rgid" | |
91 --rg "LB:$read_group.rglb" | |
92 --rg "PL:$read_group.rgpl" | |
93 --rg "SM:$read_group.rgsm" | |
94 #end if | |
95 #end if | |
96 | |
97 ## view/sort and output file | |
98 | samtools view -Su - | samtools sort -o - - > $output | |
99 | |
100 ## rename unaligned sequence files | |
101 #if $library.type == "paired" and $output_unaligned_reads_l and $output_unaligned_reads_r: | |
102 #set left = str($output_unaligned_reads_l).replace( '.dat', '.1.dat' ) | |
103 #set right = str($output_unaligned_reads_l).replace( '.dat', '.2.dat' ) | |
104 | |
105 ; mv $left $output_unaligned_reads_l; | |
106 mv $right $output_unaligned_reads_r | |
107 #end if | |
108 </command> | |
109 | |
110 <!-- basic error handling --> | |
111 <stdio> | |
112 <exit_code range="1:" level="fatal" description="Tool exception" /> | |
113 </stdio> | |
114 | |
115 <inputs> | |
116 <!-- single/paired --> | |
117 <conditional name="library"> | |
118 <param name="type" type="select" label="Is this library mate-paired?"> | |
119 <option value="single">Single-end</option> | |
120 <option value="paired">Paired-end</option> | |
121 </param> | |
122 <when value="single"> | |
123 <param name="input_1" format="fastqsanger" type="data" label="FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33"/> | |
124 </when> | |
125 <when value="paired"> | |
126 <param name="input_1" format="fastqsanger" type="data" label="FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" /> | |
127 <param name="input_2" format="fastqsanger" type="data" label="FASTQ file" help="Nucleotide-space: Must have Sanger-scaled quality values with ASCII offset 33" /> | |
128 <param name="min_insert" type="integer" value="0" label="Minimum insert size for valid paired-end alignments" /> | |
129 <param name="max_insert" type="integer" value="250" label="Maximum insert size for valid paired-end alignments" /> | |
130 </when> | |
131 </conditional> | |
132 | |
133 <!-- unaligned file --> | |
134 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads to separate file(s)" /> | |
135 | |
136 <!-- reference genome --> | |
137 <conditional name="reference_genome"> | |
138 <param name="source" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options"> | |
139 <option value="indexed">Use a built-in index</option> | |
140 <option value="history">Use one from the history</option> | |
141 </param> | |
142 <when value="indexed"> | |
143 <param name="index" type="select" label="Select a reference genome" help="If your genome of interest is not listed, contact the Galaxy team"> | |
144 <options from_data_table="bowtie2_indexes"> | |
145 <filter type="sort_by" column="2"/> | |
146 <validator type="no_options" message="No indexes are available for the selected input dataset"/> | |
147 </options> | |
148 </param> | |
149 </when> | |
150 <when value="history"> | |
151 <param name="own_file" type="data" format="fasta" metadata_name="dbkey" label="Select the reference genome" /> | |
152 </when> | |
153 </conditional> | |
154 | |
155 <!-- group settings --> | |
156 <conditional name="read_group"> | |
157 <param name="selection" type="select" label="Specify the read group for this file?"> | |
158 <option value="yes">Yes</option> | |
159 <option value="no" selected="True">No</option> | |
160 </param> | |
161 <when value="yes"> | |
162 <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." /> | |
163 <param name="rglb" type="text" size="25" label="Library name (LB)" help="Required if RG specified" /> | |
164 <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" /> | |
165 <param name="rgsm" type="text" size="25" label="Sample (SM)" help="Required if RG specified. Use pool name where a pool is being sequenced" /> | |
166 </when> | |
167 <when value="no" /> | |
168 </conditional> | |
169 | |
170 <!-- full/advanced params. --> | |
171 <conditional name="params"> | |
172 <param name="full" type="select" label="Parameter Settings" help="You can use the default settings or set custom values for any of Bowtie's parameters."> | |
173 <option value="no">Use defaults</option> | |
174 <option value="yes">Full parameter list</option> | |
175 </param> | |
176 <when value="yes"> | |
177 <param name="align_type" type="select" label="Type of alignment"> | |
178 <option value="" selected="true">End to end</option> | |
179 <option value="--local">Local</option> | |
180 </param> | |
181 | |
182 <param name="performance" type="select" label="Preset option"> | |
183 <option value="">Default</option> | |
184 <option value="--very-fast">Very fast</option> | |
185 <option value="--fast">Fast</option> | |
186 <option value="--sensitive" selected="true">Sensitive</option> | |
187 <option value="--very-sensitive">Very sensitive</option> | |
188 </param> | |
189 | |
190 <param name="gbar" type="integer" value="4" label="Disallow gaps within n-positions of read" /> | |
191 | |
192 <param name="trim5" type="integer" value="0" label="Trim n-bases from 5' of each read" /> | |
193 | |
194 <param name="trim3" type="integer" value="0" label="Trim n-bases from 3' of each read" /> | |
195 | |
196 <param name="skip" type="integer" value="0" label="Skip the first n-reads" /> | |
197 | |
198 <param name="upto" type="integer" value="0" label="Number of reads to be aligned (0 = unlimited)" /> | |
199 | |
200 <param name="nofw_norc" type="select" label="Strand directions"> | |
201 <option value="">Both</option> | |
202 <option value="--nofw">Disable forward</option> | |
203 <option value="--norc">Disable reverse</option> | |
204 </param> | |
205 | |
206 <param name="time" type="select" label="Log mapping time"> | |
207 <option value="">No</option> | |
208 <option value="--time">Yes</option> | |
209 </param> | |
210 | |
211 </when> | |
212 <when value="no" /> | |
213 </conditional> | |
214 | |
215 </inputs> | |
216 | |
217 <!-- define outputs --> | |
218 <outputs> | |
219 <data format="fastqsanger" name="output_unaligned_reads_l" label="${tool.name} on ${on_string}: unaligned reads (L)" > | |
220 <filter>unaligned_file is True</filter> | |
221 <actions> | |
222 <action type="format"> | |
223 <option type="from_param" name="library.input_1" param_attribute="ext" /> | |
224 </action> | |
225 </actions> | |
226 </data> | |
227 <data format="fastqsanger" name="output_unaligned_reads_r" label="${tool.name} on ${on_string}: unaligned reads (R)"> | |
228 <filter>library['type'] == "paired" and unaligned_file is True</filter> | |
229 <actions> | |
230 <action type="format"> | |
231 <option type="from_param" name="library.input_1" param_attribute="ext" /> | |
232 </action> | |
233 </actions> | |
234 </data> | |
235 <data format="bam" name="output" label="${tool.name} on ${on_string}: aligned reads"> | |
236 <actions> | |
237 <conditional name="reference_genome.source"> | |
238 <when value="indexed"> | |
239 <action type="metadata" name="dbkey"> | |
240 <option type="from_data_table" name="bowtie2_indexes" column="1" offset="0"> | |
241 <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/> | |
242 <filter type="param_value" ref="reference_genome.index" column="0"/> | |
243 </option> | |
244 </action> | |
245 </when> | |
246 <when value="history"> | |
247 <action type="metadata" name="dbkey"> | |
248 <option type="from_param" name="reference_genome.own_file" param_attribute="dbkey" /> | |
249 </action> | |
250 </when> | |
251 </conditional> | |
252 </actions> | |
253 </data> | |
254 </outputs> | |
255 | |
256 <tests> | |
257 <test> | |
258 <!-- basic test on single paired default run --> | |
259 <param name="type" value="single"/> | |
260 <param name="selection" value="no"/> | |
261 <param name="full" value="no"/> | |
262 <param name="unaligned_file" value="false"/> | |
263 <param name="source" value="history" /> | |
264 <param name="input_1" value="bowtie2/phix_reads.fastq" ftype="fastqsanger"/> | |
265 <param name="own_file" value="bowtie2/phix_genome.fasta" /> | |
266 <output name="output" file="bowtie2/phix_mapped.bam" /> | |
267 </test> | |
268 </tests> | |
269 | |
270 <help> | |
271 **Bowtie2 Overview** | |
272 | |
273 Bowtie_ is an ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences. It is particularly good at aligning reads of about 50 up to 100s or 1,000s of characters to relatively long (e.g. mammalian) genomes. Bowtie 2 supports gapped, local, and paired-end alignment modes. Bowtie 2 outputs alignments in SAM format, enabling interoperation with a large number of other tools. | |
274 | |
275 *Please cite:* Langmead, B., Trapnell, C., Pop, M. and Salzberg, S.L. Ultrafast and memory-efficient alignment of short DNA sequences to the human genome. Genome Biology 10:R25 (2009) | |
276 | |
277 .. _Bowtie: http://bowtie-bio.sourceforge.net/bowtie2/ | |
278 | |
279 ------ | |
280 | |
281 **Inputs** | |
282 | |
283 Bowtie 2 accepts files in Sanger FASTQ format (single or pair-end). Use the FASTQ Groomer to prepare your files. | |
284 | |
285 ------ | |
286 | |
287 **Outputs** | |
288 | |
289 The mapped sequence reads are provided as BAM file, while unmapped reads are optionally available as SAM records. When Bowtie 2 finishes running, it prints messages summarizing what happened. These messages are printed to the "standard error" ("stderr") filehandle. For datasets consisting of unpaired reads, the summary might look like this:: | |
290 | |
291 20000 reads; of these: | |
292 20000 (100.00%) were unpaired; of these: | |
293 1247 (6.24%) aligned 0 times | |
294 18739 (93.69%) aligned exactly 1 time | |
295 14 (0.07%) aligned >1 times | |
296 93.77% overall alignment rate | |
297 | |
298 ------ | |
299 | |
300 **Alignment options** | |
301 | |
302 *--end-to-end/--local* | |
303 | |
304 By default, Bowtie 2 performs end-to-end read alignment. That is, it searches for alignments involving all of the read characters. This is also called an "untrimmed" or "unclipped" alignment. When the --local option is specified, Bowtie 2 performs local read alignment. In this mode, Bowtie 2 might "trim" or "clip" some read characters from one or both ends of the alignment if doing so maximizes the alignment score. | |
305 | |
306 End-to-end alignment example:: | |
307 | |
308 Read GACTGGGCGATCTCGACTTCG | |
309 ||||| |||||||||||||| | |
310 Reference GACTG--CGATCTCGACATCG | |
311 | |
312 Local alignment example:: | |
313 | |
314 Read ACGGTTGCGTTAA-TCCGCCACG | |
315 ||||||||| |||||| | |
316 Reference TAACTTGCGTTAAATCCGCCTGG | |
317 | |
318 *-s/--skip (default: 0)* | |
319 | |
320 Skip (i.e. do not align) the first n-reads or pairs in the input. | |
321 | |
322 *-u/--qupto (default: no limit)* | |
323 | |
324 Align the first n-reads or read pairs from the input (after the -s/--skip reads or pairs have been skipped), then stop. | |
325 | |
326 *-5/--trim5 (default: 0)* | |
327 | |
328 Trim n-bases from 5' (left) end of each read before alignment. | |
329 | |
330 *-3/--trim3 (default: 0)* | |
331 | |
332 Trim n-bases from 3' (right) end of each read before alignment. | |
333 | |
334 *--nofw/--norc (default: both strands enabled)* | |
335 | |
336 If --nofw is specified, Bowtie 2 will not attempt to align unpaired reads to the forward (Watson) reference strand. If --norc is specified, bowtie2 will not attempt to align unpaired reads against the reverse-complement (Crick) reference strand. In paired-end mode, --nofw and --norc pertain to the fragments; i.e. specifying --nofw causes Bowtie 2 to explore only those paired-end configurations corresponding to fragments from the reverse-complement (Crick) strand. Default: both strands enabled. | |
337 | |
338 *--gbar (default: 4)* | |
339 | |
340 Disallow gaps within n-positions of the beginning or end of the read. | |
341 | |
342 ------ | |
343 | |
344 **Paired-end options** | |
345 | |
346 *-I/--minins (default: 0)* | |
347 | |
348 The minimum fragment length for valid paired-end alignments. E.g. if -I 60 is specified and a paired-end alignment consists of two 20-bp alignments in the appropriate orientation with a 20-bp gap between them, that alignment is considered valid (as long as -X is also satisfied). A 19-bp gap would not be valid in that case. If trimming options -3 or -5 are also used, the -I constraint is applied with respect to the untrimmed mates. | |
349 | |
350 The larger the difference between -I and -X, the slower Bowtie 2 will run. This is because larger differences bewteen -I and -X require that Bowtie 2 scan a larger window to determine if a concordant alignment exists. For typical fragment length ranges (200 to 400 nucleotides), Bowtie 2 is very efficient. | |
351 | |
352 *-X/--maxins (default: 0)* | |
353 | |
354 The maximum fragment length for valid paired-end alignments. E.g. if -X 100 is specified and a paired-end alignment consists of two 20-bp alignments in the proper orientation with a 60-bp gap between them, that alignment is considered valid (as long as -I is also satisfied). A 61-bp gap would not be valid in that case. If trimming options -3 or -5 are also used, the -X constraint is applied with respect to the untrimmed mates, not the trimmed mates. | |
355 | |
356 The larger the difference between -I and -X, the slower Bowtie 2 will run. This is because larger differences bewteen -I and -X require that Bowtie 2 scan a larger window to determine if a concordant alignment exists. For typical fragment length ranges (200 to 400 nucleotides), Bowtie 2 is very efficient. | |
357 | |
358 ------ | |
359 | |
360 **SAM options** | |
361 | |
362 *--rg-id [text]* | |
363 | |
364 Set the read group ID to [text]. This causes the SAM @RG header line to be printed, with [text] as the value associated with the ID: tag. It also causes the RG:Z: extra field to be attached to each SAM output record, with value set to [text]. | |
365 | |
366 *--rg [text]* | |
367 | |
368 Add [text] as a field on the @RG header line. Note: in order for the @RG line to appear, --rg-id must also be specified. This is because the ID tag is required by the SAM Spec. Specify --rg multiple times to set multiple fields. See the SAM Spec for details about what fields are legal. | |
369 | |
370 ------ | |
371 | |
372 **Output options** | |
373 | |
374 *--un/--un-conc* | |
375 | |
376 Write reads that fail to align concordantly to file(s). These reads correspond to the SAM records. | |
377 | |
378 *-t/--time (default: off)* | |
379 | |
380 Print the wall-clock time required to load the index files and align the reads. This is printed to the "standard error" ("stderr") filehandle. | |
381 | |
382 </help> | |
383 </tool> |