diff trim_galore.xml @ 10:b4e39d993fc8 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/trim_galore commit bbef69cc08154b5c156c25f9ca43df0915803856
author bgruening
date Thu, 20 Apr 2017 09:14:30 -0400
parents 1bfc7254232e
children 80cd83b11214
line wrap: on
line diff
--- a/trim_galore.xml	Thu Mar 16 13:48:46 2017 -0400
+++ b/trim_galore.xml	Thu Apr 20 09:14:30 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="trim_galore" name="Trim Galore!" version="0.4.2">
+<tool id="trim_galore" name="Trim Galore!" version="0.4.3" profile="17.01">
     <!-- Wrapper compatible with Trim Galore! version 0.4 -->
     <description>Quality and adapter trimmer of reads</description>
     <macros>
@@ -49,41 +49,53 @@
         <requirement type="package" version="1.8">cutadapt</requirement>
     </requirements>
     <version_command>
-        perl $__tool_directory__/trim_galore --version
+        perl '$__tool_directory__/trim_galore' --version
     </version_command>
     <command>
 <![CDATA[
 
-        ## trim_galore removes .fastq and .fq file extensions of input files.
-        ## This is essential if Galaxy provides links to files (with real extensions)
-        ## but that behaviour is causing an inconsistency in output filenaming.
-        ## We work around this by linking every file to cwd without file extension
-
+        #set compressed = 'no'
         #if $singlePaired.sPaired == "single":
-            #if str($singlePaired.input_singles).endswith(".gz"):
-                ln -s "${singlePaired.input_singles}" ./input_singles.gz;
+            #if $singlePaired.input_singles.is_of_type("fastq.gz"):
+                #set read1 = 'input_1.fastq.gz'
+                #set compressed = 'gz'
             #else
-                ln -s "${singlePaired.input_singles}" ./input_singles;
+                #set read1 = 'input_1.fastq'
             #end if
+            ln -s '${singlePaired.input_singles}' ${read1} &&
         #elif $singlePaired.sPaired == "paired":
-            #if str($singlePaired.input_mate1).endswith(".gz"):
-                ln -s "${singlePaired.input_mate1}" ./input_mate1.gz;
-                ln -s "${singlePaired.input_mate2}" ./input_mate2.gz;
+            #if $singlePaired.input_mate1.is_of_type("fastq.gz"):
+                #set read1 = 'input_1.fastq.gz'
+                #set compressed = 'gz'
             #else
-                ln -s "${singlePaired.input_mate1}" ./input_mate1;
-                ln -s "${singlePaired.input_mate2}" ./input_mate2;
+                #set read1 = 'input_1.fastq'
             #end if
+            ln -s '${singlePaired.input_mate1}' ${read1} &&
+
+            #if $singlePaired.input_mate2.is_of_type("fastq.gz"):
+                #set read2 = 'input_2.fastq.gz'
+            #else
+                #set read2 = 'input_2.fastq'
+            #end if
+            ln -s '${singlePaired.input_mate2}' ${read2} &&
         #else:
-            #if str($singlePaired.input_mate_pairs.forward).endswith(".gz"):
-                ln -s "${singlePaired.input_mate_pairs.forward}" ./input_mate1.gz;
-                ln -s "${singlePaired.input_mate_pairs.reverse}" ./input_mate2.gz;
+            #if $singlePaired.input_mate_pairs.forward.is_of_type("fastq.gz"):
+                #set read1 = 'input_1.fastq.gz'
+                #set compressed = 'gz'
             #else
-                ln -s "${singlePaired.input_mate_pairs.forward}" ./input_mate1;
-                ln -s "${singlePaired.input_mate_pairs.reverse}" ./input_mate2;
+                #set read1 = 'input_1.fastq'
             #end if
+            ln -s '${singlePaired.input_mate_pairs.forward}' ${read1} &&
+
+            #if $singlePaired.input_mate_pairs.reverse.is_of_type("fastq.gz"):
+                #set read2 = 'input_2.fastq.gz'
+            #else
+                #set read2 = 'input_2.fastq'
+            #end if
+            ln -s '${singlePaired.input_mate_pairs.reverse}' ${read2} &&
         #end if
 
-        perl $__tool_directory__/trim_galore
+        perl '$__tool_directory__/trim_galore'
 
         ## we only support fastqsanger
         --phred33
@@ -147,12 +159,7 @@
 
         #if $singlePaired.sPaired == "single":
             ## input sequence
-            #if str($singlePaired.input_singles).endswith(".gz"):
-                ./input_singles.gz
-                --dont_gzip
-            #else
-                ./input_singles
-            #end if
+            ${read1}
         #else:
             --paired
 
@@ -169,39 +176,25 @@
             #end if
 
             ## input sequences
-            #if $singlePaired.sPaired == "paired":
-                #if str($singlePaired.input_mate1).endswith(".gz"):
-                    ./input_mate1.gz
-                    ./input_mate2.gz
-                    --dont_gzip
-                #else
-                    ./input_mate1
-                    ./input_mate2
-                #end if
-            #else:
-                #if str($singlePaired.input_mate_pairs.forward).endswith(".gz"):
-                    ./input_mate1.gz
-                    ./input_mate2.gz
-                    --dont_gzip
-                #else
-                    ./input_mate1
-                    ./input_mate2
-                #end if
-            #end if
+            ${read1}
+            ${read2}
+        #end if
 
+        #if $compressed == 'no':
+            --dont_gzip
         #end if
 
         ##  Trim Galore is finished, rename the output if compressed
         &&
-        if [ -f input_singles.gz_trimmed.fq ] ; then mv input_singles.gz_trimmed.fq input_singles_trimmed.fq ; fi
+        if [ -f input_1_trimmed.fq.gz ] ; then mv input_1_trimmed.fq.gz input_1_trimmed.fq ; fi
         &&
-        if [ -f input_mate1.gz_val_1.fq ] ; then mv input_mate1.gz_val_1.fq input_mate1_val_1.fq ; fi
+        if [ -f input_1_val_1.fq.gz ] ; then mv input_1_val_1.fq.gz input_1_val_1.fq ; fi
         &&
-        if [ -f input_mate2.gz_val_2.fq ] ; then mv input_mate2.gz_val_2.fq input_mate2_val_2.fq ; fi
+        if [ -f input_2_val_2.fq.gz ] ; then mv input_2_val_2.fq.gz input_2_val_2.fq ; fi
         &&
-        if [ -f input_mate1.gz_unpaired_1.fq ] ; then mv input_mate1.gz_unpaired_1.fq input_mate1_unpaired_1.fq ; fi
+        if [ -f input_1_unpaired_1.fq.gz ] ; then mv input_1_unpaired_1.fq.gz input_1_unpaired_1.fq ; fi
         &&
-        if [ -f input_mate2.gz_unpaired_2.fq ] ; then mv input_mate2.gz_unpaired_2.fq input_mate2_unpaired_2.fq ; fi
+        if [ -f input_2_unpaired_2.fq.gz ] ; then mv input_2_unpaired_2.fq.gz input_2_unpaired_2.fq ; fi
 
         ##  Trim Galore! run is finished. Move the report files to the proper place
         #if $params.settingsType == "custom" and $params.report:
@@ -220,7 +213,7 @@
                 <option value="paired_collection">Paired Collection</option>
             </param>
             <when value="single">
-                <param name="input_singles" type="data" format="fastqsanger" label="Reads in FASTQ format" />
+                <param name="input_singles" type="data" format="fastqsanger,fastqsanger.gz" label="Reads in FASTQ format" />
                 <expand macro="adapter_trimming"/>
 
                 <param name="three_prime_clip_R1" type="integer" value="" optional="True" label="Remove N bp from the 3' end">
@@ -230,12 +223,12 @@
                 </param>
             </when>
             <when value="paired">
-                <param name="input_mate1" type="data" format="fastqsanger" label="Reads in FASTQ format" />
-                <param name="input_mate2" type="data" format="fastqsanger" label="Reads in FASTQ format" />
+                <param name="input_mate1" type="data" format="fastqsanger,fastqsanger.gz" label="Reads in FASTQ format" />
+                <param name="input_mate2" type="data" format="fastqsanger,fastqsanger.gz" label="Reads in FASTQ format" />
                 <expand macro="paired_adapter_trimming" />
             </when>
             <when value="paired_collection">
-                <param name="input_mate_pairs" format="fastqsanger" type="data_collection" collection_type="paired"
+                <param name="input_mate_pairs" format="fastqsanger,fastqsanger.gz" type="data_collection" collection_type="paired"
                     label="Select a paired collection" help="See help section for an explanation of dataset collections"/>
                 <expand macro="paired_adapter_trimming" />
             </when>
@@ -293,42 +286,42 @@
 
     </inputs>
     <outputs>
-        <data format="fastqsanger" name="trimmed_reads_single" from_work_dir="input_singles_trimmed.fq" label="${tool.name} on ${on_string}: trimmed reads">
+        <data format_source="input_singles" name="trimmed_reads_single" from_work_dir="input_1_trimmed.fq" label="${tool.name} on ${on_string}: trimmed reads">
             <filter>singlePaired['sPaired'] == "single"</filter>
         </data>
 
         <collection name="trimmed_reads_paired_collection" type="paired" label="${tool.name} on ${on_string}: paired reads">
-            <data name="forward" format="fastqsanger" from_work_dir="input_mate1_val_1.fq" />
-            <data name="reverse" format="fastqsanger" from_work_dir="input_mate2_val_2.fq" />
+            <data name="forward" format_source="input_mate_pairs['forward']" from_work_dir="input_1_val_1.fq" />
+            <data name="reverse" format_source="input_mate_pairs['forward']" from_work_dir="input_2_val_2.fq" />
             <filter>singlePaired['sPaired'] == "paired_collection"</filter>
         </collection>
 
         <collection name="trimmed_reads_unpaired_collection" type="paired" label="${tool.name} on ${on_string}: unpaired reads">
-            <data name="forward" format="fastqsanger" from_work_dir="input_mate1_unpaired_1.fq" />
-            <data name="reverse" format="fastqsanger" from_work_dir="input_mate2_unpaired_2.fq" />
+            <data name="forward" format_source="input_mate_pairs['forward']" from_work_dir="input_1_unpaired_1.fq" />
+            <data name="reverse" format_source="input_mate_pairs['forward']" from_work_dir="input_2_unpaired_2.fq" />
             <filter>params['settingsType'] == "custom"</filter>
             <filter>params['retain_unpaired']['retain_unpaired_select'] == "retain_unpaired_output"</filter>
             <filter>singlePaired['sPaired'] == "paired_collection"</filter>
         </collection>
 
-        <data format="fastqsanger" name="trimmed_reads_pair1" from_work_dir="input_mate1_val_1.fq"
+        <data format_source="input_mate1" name="trimmed_reads_pair1" from_work_dir="input_1_val_1.fq"
             label="${tool.name} on ${on_string}: trimmed reads pair 1">
             <filter>singlePaired['sPaired'] == "paired"</filter>
         </data>
 
-        <data format="fastqsanger" name="trimmed_reads_pair2" from_work_dir="input_mate2_val_2.fq"
+        <data format_source="input_mate2" name="trimmed_reads_pair2" from_work_dir="input_2_val_2.fq"
             label="${tool.name} on ${on_string}: trimmed reads pair 2">
             <filter>singlePaired['sPaired'] == "paired"</filter>
         </data>
 
-        <data format="fastqsanger" name="unpaired_reads_1" from_work_dir="input_mate1_unpaired_1.fq"
+        <data format_source="input_mate1" name="unpaired_reads_1" from_work_dir="input_1_unpaired_1.fq"
             label="${tool.name} on ${on_string}: unpaired reads (1)">
             <filter>params['settingsType'] == "custom"</filter>
             <filter>params['retain_unpaired']['retain_unpaired_select'] == "retain_unpaired_output"</filter>
             <filter>singlePaired['sPaired'] == "paired"</filter>
         </data>
 
-        <data format="fastqsanger" name="unpaired_reads_2" from_work_dir="input_mate2_unpaired_2.fq"
+        <data format_source="input_mate2" name="unpaired_reads_2" from_work_dir="input_2_unpaired_2.fq"
             label="${tool.name} on ${on_string}: unpaired reads (2)">
             <filter>params['settingsType'] == "custom"</filter>
             <filter>params['retain_unpaired']['retain_unpaired_select'] == "retain_unpaired_output"</filter>
@@ -349,6 +342,14 @@
             <output name="trimmed_reads_single" file="sanger_full_range_results1.fastqsanger" ftype="fastqsanger"/>
             <output name="report_file" file="sanger_full_range_report_results1.txt" ftype="txt" lines_diff="8" />
         </test>
+        <test>
+            <param name="input_singles" value="sanger_full_range_original_sanger.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="sPaired" value="single" />
+            <param name="settingsType" value="custom" />
+            <param name="report" value="true" />
+            <output name="trimmed_reads_single" file="sanger_full_range_results1.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+            <output name="report_file" file="sanger_full_range_report_results1gz.txt" ftype="txt" lines_diff="9" />
+        </test>
 
         <test>
             <param name="input_singles" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
@@ -356,6 +357,12 @@
             <param name="trimming_select" value="--illumina" />
             <output name="trimmed_reads_single" file="sanger_full_range_results2.fastqsanger" ftype="fastqsanger"/>
         </test>
+        <test>
+            <param name="input_singles" value="sanger_full_range_original_sanger.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="sPaired" value="single" />
+            <param name="trimming_select" value="--illumina" />
+            <output name="trimmed_reads_single" file="sanger_full_range_results2.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+        </test>
 
         <test>
             <param name="input_singles" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
@@ -363,6 +370,12 @@
             <param name="adapter" value="AAAGAGC" />
             <output name="trimmed_reads_single" file="sanger_full_range_results3.fastqsanger" ftype="fastqsanger"/>
         </test>
+        <test>
+            <param name="input_singles" value="sanger_full_range_original_sanger.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="sPaired" value="single" />
+            <param name="adapter" value="AAAGAGC" />
+            <output name="trimmed_reads_single" file="sanger_full_range_results3.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+        </test>
 
         <test>
             <param name="input_mate1" value="bwa-mem-fastq1.fq" ftype="fastqsanger" />
@@ -374,6 +387,16 @@
             <output name="trimmed_reads_pair2" file="paired_example_pair2_results2.fastqsanger" ftype="fastqsanger"/>
             <output name="report_file" file="paired_example_results2.txt" ftype="txt" lines_diff="24" />
         </test>
+        <test>
+            <param name="input_mate1" value="bwa-mem-fastq1.fq.gz" ftype="fastqsanger.gz" />
+            <param name="input_mate2" value="bwa-mem-fastq2.fq.gz" ftype="fastqsanger.gz" />
+            <param name="sPaired" value="paired" />
+            <param name="settingsType" value="custom" />
+            <param name="report" value="true" />
+            <output name="trimmed_reads_pair1" file="paired_example_pair1_results2.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+            <output name="trimmed_reads_pair2" file="paired_example_pair2_results2.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+            <output name="report_file" file="paired_example_results2gz.txt" ftype="txt" lines_diff="24" />
+        </test>
 
         <test>
             <param name="input_mate_pairs">
@@ -399,7 +422,31 @@
                 <element name="forward" file="paired_collection_example_unpair1_results3.fastqsanger" ftype="fastqsanger"/>
                 <element name="reverse" file="paired_collection_example_unpair2_results3.fastqsanger" ftype="fastqsanger"/>
             </output_collection>
+        </test>
+        <test>
+            <param name="input_mate_pairs">
+                <collection type="paired">
+                    <element name="forward" value="bwa-mem-fastq1.fq.gz" ftype="fastqsanger.gz" />
+                    <element name="reverse" value="bwa-mem-fastq2.fq.gz" ftype="fastqsanger.gz" />
+                </collection>
+            </param>
 
+            <param name="sPaired" value="paired_collection" />
+            <param name="settingsType" value="custom" />
+            <param name="report" value="true" />
+            <param name="retain_unpaired_select" value="retain_unpaired_output" />
+
+            <output name="report_file" file="paired_collection_example_results3gz.txt" ftype="txt" lines_diff="25" />
+
+            <output_collection name="trimmed_reads_paired_collection" type="paired">
+                <element name="forward" file="paired_collection_example_pair1_results3.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+                <element name="reverse" file="paired_collection_example_pair2_results3.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+            </output_collection>
+
+            <output_collection name="trimmed_reads_unpaired_collection" type="paired">
+                <element name="forward" file="paired_collection_example_unpair1_results3.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+                <element name="reverse" file="paired_collection_example_unpair2_results3.fastq.gz" ftype="fastqsanger.gz" compare="sim_size" delta="0"/>
+            </output_collection>
         </test>
     </tests>
     <help>
@@ -443,7 +490,7 @@
 
   * **Illumina small RNA adapters**
 
-      | Adapter sequence to be trimmed is the first 12bp of the Illumina Small RNA 3' Adapter 'TGGAATTCTCGG' instead of the default auto-detection of adapter sequence. Selecting to trim smallRNA adapters will also lower the --length value to 18bp. If the smallRNA libraries are paired-end then -a2 will be set to the Illumina small RNA 5' adapter automatically (‘GATCGTCGGACT’) unless -a 2 had been defined explicitly.
+      | Adapter sequence to be trimmed is the first 12bp of the Illumina Small RNA 3' Adapter 'TGGAATTCTCGG' instead of the default auto-detection of adapter sequence. Selecting to trim smallRNA adapters will also lower the --length value to 18bp. If the smallRNA libraries are paired-end then -a2 will be set to the Illumina small RNA 5' adapter automatically ('GATCGTCGGACT') unless -a 2 had been defined explicitly.
       |
       | *option --small_rna*