changeset 14:85f0e9edb32d draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/bowtie2 commit 954b2052cb74a0bc88f65df37f429ff27c45ea8f
author devteam
date Wed, 12 Apr 2017 17:09:24 -0400
parents 55dcd6aad1ab
children 7e0b333f39e1
files bowtie2_wrapper.xml test-data/bowtie2-fq1.fq.bz2 test-data/bowtie2-fq1.fq.gz test-data/bowtie2-fq2.fq.bz2 test-data/bowtie2-fq2.fq.gz
diffstat 5 files changed, 133 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/bowtie2_wrapper.xml	Mon Jan 09 04:30:45 2017 -0500
+++ b/bowtie2_wrapper.xml	Wed Apr 12 17:09:24 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="bowtie2" name="Bowtie2" version="2.3.0">
+<tool id="bowtie2" name="Bowtie2" version="2.3.0.1" profile="17.01">
     <description>- map reads against reference genome</description>
     <macros>
         <import>read_group_macros.xml</import>
@@ -19,6 +19,66 @@
             #set index_path = $reference_genome.index.fields.path
         #end if
 
+        ## Link in the input files, so bowtie2 can tell their type
+
+        #set compressed="False"
+        #if str($library.type) == 'paired':
+            #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read1 = "input_f.fastq.gz"
+                #set compressed = "GZ"
+            #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read1 = "input_f.fastq.bz2"
+                #set compressed = "BZ2"
+            #else:
+                #set read1 = "input_f.fastq"
+            #end if
+            ln -f -s '${library.input_1}' ${read1} &&
+
+            #if $library.input_2.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read2 = "input_r.fastq.gz"
+                #set compressed = "GZ"
+            #else if $library.input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read2 = "input_r.fastq.bz2"
+                #set compressed = "BZ2"
+            #else:
+                #set read2 = "input_r.fastq"
+            #end if
+            ln -f -s '${library.input_2}' ${read2} &&
+        #else if str($library.type) == 'paired_collection':
+            #if $library.input_1.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read1 = "input_f.fastq.gz"
+                #set compressed = "GZ"
+            #else if $library.input_1.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read1 = "input_f.fastq.bz2"
+                #set compressed = "BZ2"
+            #else:
+                #set read1 = "input_f.fastq"
+            #end if
+            ln -s '${library.input_1.forward}' ${read1} &&
+
+            #if $library.input_1.reverse.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read2 = "input_r.fastq.gz"
+                #set compressed = "GZ"
+            #else if $library.input_1.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read2 = "input_r.fastq.bz2"
+                #set compressed = "BZ2"
+            #else:
+                #set read2 = "input_r.fastq"
+            #end if
+            ln -s '${library.input_1.reverse}' ${read2} &&
+        #else:
+            #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read1 = "input_f.fastq.gz"
+                #set compressed = "GZ"
+            #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read1 = "input_f.fastq.bz2"
+                #set compressed = "BZ2"
+            #else:
+                #set read1 = "input_f.fastq"
+            #end if
+            ln -s '${library.input_1}' ${read1} &&
+        #end if
+
         ## execute bowtie2
 
         bowtie2
@@ -31,16 +91,46 @@
 
         ## Fastq inputs
         #if str( $library.type ) == "single":
-            -U '${library.input_1}'
+            -U '${read1}'
             #if str( $library.unaligned_file ) == "true":
-                --un '$output_unaligned_reads_l'
+                #if $compressed == "GZ":
+                    --un-gz '${output_unaligned_reads_l}'
+                #else if $compressed == "BZ2":
+                    --un-bz2 '${output_unaligned_reads_l}'
+                #else:
+                    --un '${output_unaligned_reads_l}'
+                #end if
             #end if
             #if str( $library.aligned_file ) == "true":
-                --al '$output_aligned_reads_l'
+                #if $compressed == "GZ":
+                    --al-gz '${output_aligned_reads_l}'
+                #else if $compressed == "BZ2":
+                    --al-bz2 '${output_aligned_reads_l}'
+                #else:
+                    --al '${output_aligned_reads_l}'
+                #end if
             #end if
-        #elif str( $library.type ) == "paired":
-            -1 '${library.input_1}'
-            -2 '${library.input_2}'
+        #else:
+            -1 '${read1}'
+            -2 '${read2}'
+            #if str( $library.unaligned_file ) == "true":
+                #if $compressed == "GZ":
+                    --un-conc-gz '${output_unaligned_reads_l}'
+                #else if $compressed == "BZ2":
+                    --un-conc-bz2 '${output_unaligned_reads_l}'
+                #else:
+                    --un-conc '${output_unaligned_reads_l}'
+                #end if
+            #end if
+            #if str( $library.aligned_file ) == "true":
+                #if $compressed == "GZ":
+                    --al-conc-gz '${output_aligned_reads_l}'
+                #else if $compressed == "BZ2":
+                    --al-conc-bz2 '${output_aligned_reads_l}'
+                #else:
+                    --al-conc '${output_aligned_reads_l}'
+                #end if
+            #end if
             #if str( $library.paired_options.paired_options_selector ) == "yes":
                 -I "${library.paired_options.I}"
                 -X "${library.paired_options.X}"
@@ -51,29 +141,6 @@
                 ${library.paired_options.no_contain}
                 ${library.paired_options.no_overlap}
             #end if
-            #if str( $library.unaligned_file ) == "true":
-                --un-conc $output_unaligned_reads_l
-            #end if
-            #if str( $library.aligned_file ) == "true":
-                --al-conc $output_aligned_reads_l
-            #end if
-        #else
-            ## prepare collection
-            -1 $library.input_1.forward
-            -2 $library.input_1.reverse
-            #if str( $library.paired_options.paired_options_selector ) == "yes":
-                -I "${library.paired_options.I}"
-                -X "${library.paired_options.X}"
-                ${library.paired_options.fr_rf_ff}
-                ${library.paired_options.no_mixed}
-                ${library.paired_options.no_discordant}
-                ${library.paired_options.dovetail}
-                ${library.paired_options.no_contain}
-                ${library.paired_options.no_overlap}
-            #end if
-            #if str( $library.unaligned_file ) == "true":
-                --un-conc '$output_unaligned_reads_l'
-            #end if
         #end if
 
         ## Read group information.
@@ -209,15 +276,15 @@
             </param>
 
             <when value="single">
-                <param name="input_1" format="fastqsanger" type="data" label="FASTQ file" help="Must be of datatype &quot;fastqsanger&quot;" />
-                <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" />
-                <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" />
+                <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2" type="data" label="FASTQ file" help="Must be of datatype &quot;fastqsanger&quot;" />
+                <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 (possibly with -gz or -bz2); This triggers --un parameter for single reads and --un-conc for paired reads" />
+                <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 (possibly with -gz or -bz2); This triggers --al parameter for single reads and --al-conc for paired reads" />
             </when>
             <when value="paired">
-                <param name="input_1" format="fastqsanger" type="data" label="FASTQ file #1" help="Must be of datatype &quot;fastqsanger&quot;" />
-                <param name="input_2" format="fastqsanger" type="data" label="FASTQ file #2" help="Must be of datatype &quot;fastqsanger&quot;" />
-                <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" />
-                <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" />
+                <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2" type="data" label="FASTQ file #1" help="Must be of datatype &quot;fastqsanger&quot;" />
+                <param name="input_2" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2" type="data" label="FASTQ file #2" help="Must be of datatype &quot;fastqsanger&quot;" />
+                <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 (possibly with -gz or -bz2); This triggers --un parameter for single reads and --un-conc for paired reads" />
+                <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 (possibly with -gz or -bz2); This triggers --al parameter for single reads and --al-conc for paired reads" />
                 <conditional name="paired_options">
                     <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">
                         <option value="no" selected="True">No</option>
@@ -243,9 +310,9 @@
                 </conditional>
             </when>
             <when value="paired_collection">
-                <param name="input_1" format="fastqsanger" type="data_collection" collection_type="paired" label="FASTQ Paired Dataset" help="Must be of datatype &quot;fastqsanger&quot;" />
-                <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" />
-                <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" />
+                <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2" type="data_collection" collection_type="paired" label="FASTQ Paired Dataset" help="Must be of datatype &quot;fastqsanger&quot;" />
+                <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 (possibly with -gz or -bz2); This triggers --un parameter for single reads and --un-conc for paired reads" />
+                <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 (possibly with -gz or -bz2); This triggers --al parameter for single reads and --al-conc for paired reads" />
                 <conditional name="paired_options">
                     <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">
                         <option value="no" selected="True">No</option>
@@ -622,6 +689,32 @@
             <output name="output" file="bowtie2-test1.bam" ftype="bam" lines_diff="2"/>
             <output name="mapping_stats" file="bowtie2-stats.out" ftype="txt"/>
         </test>
+        <test>
+            <!-- test fastqsanger.gz input -->
+            <param name="type" value="paired"/>
+            <param name="selection" value="no"/>
+            <param name="paired_options_selector" value="no"/>
+            <param name="unaligned_file" value="false"/>
+            <param name="analysis_type_selector" value="simple"/>
+            <param name="source" value="history" />
+            <param name="input_1" value="bowtie2-fq1.fq.gz" ftype="fastqsanger.gz"/>
+            <param name="input_2" value="bowtie2-fq2.fq.gz" ftype="fastqsanger.gz"/>
+            <param name="own_file" value="bowtie2-ref.fasta" />
+            <output name="output" file="bowtie2-test1.bam" ftype="bam" lines_diff="2"/>
+        </test>
+        <test>
+            <!-- test fastqsanger.bz2 input -->
+            <param name="type" value="paired"/>
+            <param name="selection" value="no"/>
+            <param name="paired_options_selector" value="no"/>
+            <param name="unaligned_file" value="false"/>
+            <param name="analysis_type_selector" value="simple"/>
+            <param name="source" value="history" />
+            <param name="input_1" value="bowtie2-fq1.fq.bz2" ftype="fastqsanger.bz2"/>
+            <param name="input_2" value="bowtie2-fq2.fq.bz2" ftype="fastqsanger.bz2"/>
+            <param name="own_file" value="bowtie2-ref.fasta" />
+            <output name="output" file="bowtie2-test1.bam" ftype="bam" lines_diff="2"/>
+        </test>
     </tests>
 
     <help><![CDATA[
Binary file test-data/bowtie2-fq1.fq.bz2 has changed
Binary file test-data/bowtie2-fq1.fq.gz has changed
Binary file test-data/bowtie2-fq2.fq.bz2 has changed
Binary file test-data/bowtie2-fq2.fq.gz has changed