comparison bowtie2_wrapper.xml @ 10:a9d4f71dbfb0 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/bowtie2 commit 320f7fb84d2fda19f6cccdb38b4ef49edec4169d
author devteam
date Tue, 22 Mar 2016 14:58:55 -0400
parents 82414e16b6bd
children b4e9cf5f2ae8
comparison
equal deleted inserted replaced
9:019c2a81547a 10:a9d4f71dbfb0
1 <tool id="bowtie2" name="Bowtie2" version="2.2.6"> 1 <tool id="bowtie2" name="Bowtie2" version="2.2.6.2">
2 <description>- map reads against reference genome</description> 2 <description>- map reads against reference genome</description>
3 <macros> 3 <macros>
4 <import>read_group_macros.xml</import> 4 <import>read_group_macros.xml</import>
5 </macros> 5 </macros>
6 <version_command>bowtie2 --version</version_command> 6 <version_command>bowtie2 --version</version_command>
7 <requirements> 7 <requirements>
8 <requirement type="package" version="2.2.6">bowtie2</requirement> 8 <requirement type="package" version="2.2.6">bowtie2</requirement>
9 <requirement type="package" version="1.2">samtools</requirement> 9 <requirement type="package" version="1.2">samtools</requirement>
10 </requirements> 10 </requirements>
11 <command> 11 <command>
12
13 ## prepare bowtie2 index 12 ## prepare bowtie2 index
14 #set index_path = '' 13 #set index_path = ''
15 #if str($reference_genome.source) == "history": 14 #if str($reference_genome.source) == "history":
16 bowtie2-build "$reference_genome.own_file" genome &amp;&amp; 15 bowtie2-build "$reference_genome.own_file" genome &amp;&amp;
17 ln -s "$reference_genome.own_file" genome.fa &amp;&amp; 16 ln -s "$reference_genome.own_file" genome.fa &amp;&amp;
33 ## Fastq inputs 32 ## Fastq inputs
34 #if str( $library.type ) == "single": 33 #if str( $library.type ) == "single":
35 -U "${library.input_1}" 34 -U "${library.input_1}"
36 #if str( $library.unaligned_file ) == "true": 35 #if str( $library.unaligned_file ) == "true":
37 --un $output_unaligned_reads_l 36 --un $output_unaligned_reads_l
37 #end if
38 #if str( $library.aligned_file ) == "true":
39 --al $output_aligned_reads_l
38 #end if 40 #end if
39 #elif str( $library.type ) == "paired": 41 #elif str( $library.type ) == "paired":
40 -1 "${library.input_1}" 42 -1 "${library.input_1}"
41 -2 "${library.input_2}" 43 -2 "${library.input_2}"
42 #if str( $library.paired_options.paired_options_selector ) == "yes": 44 #if str( $library.paired_options.paired_options_selector ) == "yes":
49 ${library.paired_options.no_contain} 51 ${library.paired_options.no_contain}
50 ${library.paired_options.no_overlap} 52 ${library.paired_options.no_overlap}
51 #end if 53 #end if
52 #if str( $library.unaligned_file ) == "true": 54 #if str( $library.unaligned_file ) == "true":
53 --un-conc $output_unaligned_reads_l 55 --un-conc $output_unaligned_reads_l
56 #end if
57 #if str( $library.aligned_file ) == "true":
58 --al-conc $output_aligned_reads_l
54 #end if 59 #end if
55 #else 60 #else
56 ## prepare collection 61 ## prepare collection
57 -1 $library.input_1.forward 62 -1 $library.input_1.forward
58 -2 $library.input_1.reverse 63 -2 $library.input_1.reverse
165 170
166 #elif str( $analysis_type.analysis_type_selector ) == "cline": 171 #elif str( $analysis_type.analysis_type_selector ) == "cline":
167 ${analysis_type.cline} 172 ${analysis_type.cline}
168 #end if 173 #end if
169 174
175 ## mapping stats (i.e. stderr from bowtie2)
176 #if $save_mapping_stats
177 2&gt; "$mapping_stats"
178 #end if
179
170 ## output file 180 ## output file
171 #if ( str( $analysis_type.analysis_type_selector ) != "full" or str( $analysis_type.sam_opt ) != "true" ): 181 #if ( str( $analysis_type.analysis_type_selector ) != "full" or str( $analysis_type.sam_opt ) != "true" ):
172 | samtools view -Su - | samtools sort -o - - &gt; $output 182 | samtools view -Su - | samtools sort -o - - &gt; $output
173 #else 183 #else
174 &gt; $output_sam 184 &gt; $output_sam
178 #if $library.type == "paired" and $output_unaligned_reads_l and $output_unaligned_reads_r: 188 #if $library.type == "paired" and $output_unaligned_reads_l and $output_unaligned_reads_r:
179 #from os.path import splitext 189 #from os.path import splitext
180 #set _unaligned_root, _unaligned_ext = splitext( str( $output_unaligned_reads_l ) ) 190 #set _unaligned_root, _unaligned_ext = splitext( str( $output_unaligned_reads_l ) )
181 &amp;&amp; mv "${ _unaligned_root }.1${_unaligned_ext}" "${ output_unaligned_reads_l }" 191 &amp;&amp; mv "${ _unaligned_root }.1${_unaligned_ext}" "${ output_unaligned_reads_l }"
182 &amp;&amp; mv "${ _unaligned_root }.2${_unaligned_ext}" "${ output_unaligned_reads_r }" 192 &amp;&amp; mv "${ _unaligned_root }.2${_unaligned_ext}" "${ output_unaligned_reads_r }"
193 #end if
194 #if $library.type == "paired" and $output_aligned_reads_l and $output_aligned_reads_r:
195 #from os.path import splitext
196 #set _aligned_root, _aligned_ext = splitext( str( $output_aligned_reads_l ) )
197 &amp;&amp; mv "${ _aligned_root }.1${_aligned_ext}" "${ output_aligned_reads_l }"
198 &amp;&amp; mv "${ _aligned_root }.2${_aligned_ext}" "${ output_aligned_reads_r }"
183 #end if 199 #end if
184 200
185 </command> 201 </command>
186 <!-- basic error handling --> 202 <!-- basic error handling -->
187 <stdio> 203 <stdio>
198 </param> 214 </param>
199 215
200 <when value="single"> 216 <when value="single">
201 <param name="input_1" format="fastqsanger" type="data" label="FASTQ file" help="Must be of datatype &quot;fastqsanger&quot;" /> 217 <param name="input_1" format="fastqsanger" type="data" label="FASTQ file" help="Must be of datatype &quot;fastqsanger&quot;" />
202 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" help="--un/--un-conc; This triggers --un parameter for single reads and --un-conc for paired reads" /> 218 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" help="--un/--un-conc; This triggers --un parameter for single reads and --un-conc for paired reads" />
219 <param name="aligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" help="--al/--al-conc; This triggers --al parameter for single reads and --al-conc for paired reads" />
203 </when> 220 </when>
204 <when value="paired"> 221 <when value="paired">
205 <param name="input_1" format="fastqsanger" type="data" label="FASTQ file #1" help="Must be of datatype &quot;fastqsanger&quot;" /> 222 <param name="input_1" format="fastqsanger" type="data" label="FASTQ file #1" help="Must be of datatype &quot;fastqsanger&quot;" />
206 <param name="input_2" format="fastqsanger" type="data" label="FASTQ file #2" help="Must be of datatype &quot;fastqsanger&quot;" /> 223 <param name="input_2" format="fastqsanger" type="data" label="FASTQ file #2" help="Must be of datatype &quot;fastqsanger&quot;" />
207 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" help="--un/--un-conc; This triggers --un parameter for single reads and --un-conc for paired reads" /> 224 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" help="--un/--un-conc; This triggers --un parameter for single reads and --un-conc for paired reads" />
225 <param name="aligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" help="--al/--al-conc; This triggers --al parameter for single reads and --al-conc for paired reads" />
208 <conditional name="paired_options"> 226 <conditional name="paired_options">
209 <param name="paired_options_selector" type="select" label="Do you want to set paired-end options?" help="See &quot;Alignment Options&quot; section of Help below for information"> 227 <param name="paired_options_selector" type="select" label="Do you want to set paired-end options?" help="See &quot;Alignment Options&quot; section of Help below for information">
210 <option value="no" selected="True">No</option> 228 <option value="no" selected="True">No</option>
211 <option value="yes">Yes</option> 229 <option value="yes">Yes</option>
212 </param> 230 </param>
230 </conditional> 248 </conditional>
231 </when> 249 </when>
232 <when value="paired_collection"> 250 <when value="paired_collection">
233 <param name="input_1" format="fastqsanger" type="data_collection" collection_type="paired" label="FASTQ Paired Dataset" help="Must be of datatype &quot;fastqsanger&quot;" /> 251 <param name="input_1" format="fastqsanger" type="data_collection" collection_type="paired" label="FASTQ Paired Dataset" help="Must be of datatype &quot;fastqsanger&quot;" />
234 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" help="--un/--un-conc; This triggers --un parameter for single reads and --un-conc for paired reads" /> 252 <param name="unaligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write unaligned reads (in fastq format) to separate file(s)" help="--un/--un-conc; This triggers --un parameter for single reads and --un-conc for paired reads" />
253 <param name="aligned_file" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Write aligned reads (in fastq format) to separate file(s)" help="--al/--al-conc; This triggers --al parameter for single reads and --al-conc for paired reads" />
235 <conditional name="paired_options"> 254 <conditional name="paired_options">
236 <param name="paired_options_selector" type="select" label="Do you want to set paired-end options?" help="See &quot;Alignment Options&quot; section of Help below for information"> 255 <param name="paired_options_selector" type="select" label="Do you want to set paired-end options?" help="See &quot;Alignment Options&quot; section of Help below for information">
237 <option value="no" selected="True">No</option> 256 <option value="no" selected="True">No</option>
238 <option value="yes">Yes</option> 257 <option value="yes">Yes</option>
239 </param> 258 </param>
428 </when> 447 </when>
429 </conditional> 448 </conditional>
430 <param name="sam_opt" type="boolean" truevalue="true" falsevalue="false" label="Would you like the output to be a SAM file" help="By default, the output from this Bowtie2 wrapper is a sorted BAM file."/> 449 <param name="sam_opt" type="boolean" truevalue="true" falsevalue="false" label="Would you like the output to be a SAM file" help="By default, the output from this Bowtie2 wrapper is a sorted BAM file."/>
431 </when> 450 </when>
432 </conditional> 451 </conditional>
452 <param name="save_mapping_stats" type="boolean" checked="False" label="Save the bowtie2 mapping statistics to the history" />
433 </inputs> 453 </inputs>
434 454
435 <!-- define outputs --> 455 <!-- define outputs -->
436 456
437 <outputs> 457 <outputs>
451 </action> 471 </action>
452 </when> 472 </when>
453 <when value="paired_collection"> 473 <when value="paired_collection">
454 <action type="format"> 474 <action type="format">
455 <option type="from_param" name="library.input_1" param_attribute="forward.ext" /> 475 <option type="from_param" name="library.input_1" param_attribute="forward.ext" />
476 </action>
477 </when>
478 </conditional>
479 </actions>
480 </data>
481 <data format="fastqsanger" name="output_aligned_reads_l" label="${tool.name} on ${on_string}: aligned reads (L)" >
482 <filter>library['aligned_file'] is True</filter>
483 <actions>
484 <conditional name="library.type">
485 <when value="single">
486 <action type="format">
487 <option type="from_param" name="library.input_1" param_attribute="ext" />
488 </action>
489 </when>
490 <when value="paired">
491 <action type="format">
492 <option type="from_param" name="library.input_1" param_attribute="ext" />
493 </action>
494 </when>
495 <when value="paired_collection">
496 <action type="format">
497 <option type="from_param" name="library.input_1" param_attribute="forward.ext" />
498 </action>
499 </when>
500 </conditional>
501 </actions>
502 </data>
503 <data format="fastqsanger" name="output_aligned_reads_r" label="${tool.name} on ${on_string}: aligned reads (R)">
504 <filter>( library['type'] == "paired" or library['type'] == "paired_collection" ) and library['aligned_file'] is True</filter>
505 <actions>
506 <conditional name="library.type">
507 <when value="paired">
508 <action type="format">
509 <option type="from_param" name="library.input_2" param_attribute="ext" />
510 </action>
511 </when>
512 <when value="paired_collection">
513 <action type="format">
514 <option type="from_param" name="library.input_1" param_attribute="reverse.ext" />
456 </action> 515 </action>
457 </when> 516 </when>
458 </conditional> 517 </conditional>
459 </actions> 518 </actions>
460 </data> 519 </data>
514 <option type="from_param" name="reference_genome.own_file" param_attribute="dbkey" /> 573 <option type="from_param" name="reference_genome.own_file" param_attribute="dbkey" />
515 </action> 574 </action>
516 </when> 575 </when>
517 </conditional> 576 </conditional>
518 </actions> 577 </actions>
578 </data>
579 <data format="txt" name="mapping_stats" label="${tool.name} on ${on_string}: mapping stats">
580 <filter>save_mapping_stats is True</filter>
519 </data> 581 </data>
520 582
521 </outputs> 583 </outputs>
522 584
523 <tests> 585 <tests>
548 <param name="input_1" value="bowtie2-fq1.fq" ftype="fastqsanger"/> 610 <param name="input_1" value="bowtie2-fq1.fq" ftype="fastqsanger"/>
549 <param name="input_2" value="bowtie2-fq2.fq" ftype="fastqsanger"/> 611 <param name="input_2" value="bowtie2-fq2.fq" ftype="fastqsanger"/>
550 <param name="own_file" value="bowtie2-ref.fasta" /> 612 <param name="own_file" value="bowtie2-ref.fasta" />
551 <output name="output" file="bowtie2-test2.bam" ftype="bam" lines_diff="2"/> 613 <output name="output" file="bowtie2-test2.bam" ftype="bam" lines_diff="2"/>
552 </test> 614 </test>
615 <test>
616 <!-- basic test on single paired default run with stats-->
617 <param name="type" value="paired"/>
618 <param name="selection" value="no"/>
619 <param name="paired_options_selector" value="no"/>
620 <param name="unaligned_file" value="false"/>
621 <param name="analysis_type_selector" value="simple"/>
622 <param name="source" value="history" />
623 <param name="input_1" value="bowtie2-fq1.fq" ftype="fastqsanger"/>
624 <param name="input_2" value="bowtie2-fq2.fq" ftype="fastqsanger"/>
625 <param name="own_file" value="bowtie2-ref.fasta" />
626 <param name="save_mapping_stats" value="true" />
627 <output name="output" file="bowtie2-test1.bam" ftype="bam" lines_diff="2"/>
628 <output name="mapping_stats" file="bowtie2-stats.out" ftype="txt"/>
629 </test>
553 </tests> 630 </tests>
554 631
555 <help> 632 <help>
556 633
557 **Bowtie2 Overview** 634 **Bowtie2 Overview**