Repository 'trim_galore'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/trim_galore

Changeset 8:f1e71aeaa923 (2016-03-18)
Previous changeset 7:8352713cf939 (2016-01-25) Next changeset 9:1bfc7254232e (2017-03-16)
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/trim_galore commit d48f42b1c267c8ebfc50161ea764baed8ee66701-dirty
modified:
trim_galore.xml
b
diff -r 8352713cf939 -r f1e71aeaa923 trim_galore.xml
--- a/trim_galore.xml Mon Jan 25 04:44:33 2016 -0500
+++ b/trim_galore.xml Fri Mar 18 07:56:01 2016 -0400
[
@@ -1,4 +1,4 @@
-<tool id="trim_galore" name="Trim Galore!" version="0.4.1">
+<tool id="trim_galore" name="Trim Galore!" version="0.4.2">
     <!-- Wrapper compatible with Trim Galore! version 0.4 -->
     <description>adaptive quality and adapter trimmer</description>
     <macros>
@@ -44,9 +44,13 @@
         </macro>
     </macros>
     <requirements>
+        <!-- conda dependency -->
+        <requirement type="package" version="1.8.3">cutadapt</requirement>
         <requirement type="package" version="1.8">cutadapt</requirement>
     </requirements>
-    <version_command interpreter="perl">trim_galore --version</version_command>
+    <version_command>
+        perl $__tool_directory__/trim_galore --version
+    </version_command>
     <command>
 <![CDATA[
 
@@ -56,13 +60,27 @@
         ## We work around this by linking every file to cwd without file extension
 
         #if $singlePaired.sPaired == "single":
-            ln -s "${singlePaired.input_singles}" ./input_singles;
+            #if str($singlePaired.input_singles).endswith(".gz"):
+                ln -s "${singlePaired.input_singles}" ./input_singles.gz;
+            #else
+                ln -s "${singlePaired.input_singles}" ./input_singles;
+            #end if
         #elif $singlePaired.sPaired == "paired":
-            ln -s "${singlePaired.input_mate1}" ./input_mate1;
-            ln -s "${singlePaired.input_mate2}" ./input_mate2;
+            #if str($singlePaired.input_mate1).endswith(".gz"):
+                ln -s "${singlePaired.input_mate1}" ./input_mate1.gz;
+                ln -s "${singlePaired.input_mate2}" ./input_mate2.gz;
+            #else
+                ln -s "${singlePaired.input_mate1}" ./input_mate1;
+                ln -s "${singlePaired.input_mate2}" ./input_mate2;
+            #end if
         #else:
-            ln -s "${singlePaired.input_mate_pairs.forward}" ./input_mate1;
-            ln -s "${singlePaired.input_mate_pairs.reverse}" ./input_mate2;
+            #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;
+            #else
+                ln -s "${singlePaired.input_mate_pairs.forward}" ./input_mate1;
+                ln -s "${singlePaired.input_mate_pairs.reverse}" ./input_mate2;
+            #end if
         #end if
 
         perl $__tool_directory__/trim_galore
@@ -129,7 +147,12 @@
 
         #if $singlePaired.sPaired == "single":
             ## input sequence
-            ./input_singles
+            #if str($singlePaired.input_singles).endswith(".gz"):
+                ./input_singles.gz
+                --dont_gzip
+            #else
+                ./input_singles
+            #end if
         #else:
             --paired
 
@@ -146,11 +169,40 @@
             #end if
 
             ## input sequences
-            ./input_mate1
-            ./input_mate2
+            #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
 
         #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_mate1.gz_val_1.fq ] ; then mv input_mate1.gz_val_1.fq input_mate1_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_mate1.gz_unpaired_1.fq ] ; then mv input_mate1.gz_unpaired_1.fq input_mate1_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
+
         ##  Trim Galore! run is finished. Move the report files to the proper place
         #if $params.settingsType == "custom" and $params.report:
             &&
@@ -295,7 +347,7 @@
             <param name="settingsType" value="custom" />
             <param name="report" value="true" />
             <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="2" />
+            <output name="report_file" file="sanger_full_range_report_results1.txt" ftype="txt" lines_diff="8" />
         </test>
 
         <test>
@@ -320,7 +372,7 @@
             <param name="report" value="true" />
             <output name="trimmed_reads_pair1" file="paired_example_pair1_results2.fastqsanger" ftype="fastqsanger"/>
             <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="8" />
+            <output name="report_file" file="paired_example_results2.txt" ftype="txt" lines_diff="24" />
         </test>
 
         <test>
@@ -336,7 +388,7 @@
             <param name="report" value="true" />
             <param name="retain_unpaired_select" value="retain_unpaired_output" />
 
-            <output name="report_file" file="paired_collection_example_results3.txt" ftype="txt" lines_diff="8" />
+            <output name="report_file" file="paired_collection_example_results3.txt" ftype="txt" lines_diff="24" />
 
             <output_collection name="trimmed_reads_paired_collection" type="paired">
                 <element name="forward" file="paired_collection_example_pair1_results3.fastqsanger" ftype="fastqsanger"/>