Repository 'cutadapt'
hg clone https://toolshed.g2.bx.psu.edu/repos/lparsons/cutadapt

Changeset 12:78e1cf88d133 (2018-05-24)
Previous changeset 11:8665bcc8b847 (2018-03-05) Next changeset 13:f5fdf41c08b8 (2018-06-12)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit 195c6112eff237b20a6744e82e2c4e7641f7c488
modified:
cutadapt.xml
macros.xml
b
diff -r 8665bcc8b847 -r 78e1cf88d133 cutadapt.xml
--- a/cutadapt.xml Mon Mar 05 11:02:48 2018 -0500
+++ b/cutadapt.xml Thu May 24 18:24:08 2018 -0400
[
b'@@ -1,4 +1,4 @@\n-<tool id="cutadapt" name="Cutadapt" version="1.16">\n+<tool id="cutadapt" name="Cutadapt" version="1.16.1" profile="17.09">\n     <description>Remove adapter sequences from Fastq/Fasta</description>\n     <macros>\n         <import>macros.xml</import>\n@@ -13,107 +13,62 @@\n \n         ## Link in the input and output files, so Cutadapt can tell their type\n \n-        #set compressed="False"\n+        #import re\n         #set format = "fastq"\n-\n-        #if str($library.type) == \'paired\':\n+        #set read1 = "input_f"\n+        #set read2 = "input_r"\n+        #set paired = False\n+        #set library_type = str($library.type)\n+        #if $library_type == \'paired\':\n+        #set paired = True\n+        #set read1 = re.sub(\'[^\\w\\-\\s]\', \'_\', str($library.input_1.element_identifier))\n+        #set read2 = re.sub(\'[^\\w\\-\\s]\', \'_\', str($library.input_2.element_identifier))\n+        #set input_1 = $library.input_1\n+        #set input_2 = $library.input_2\n+        #else if $library_type == \'paired_collection\'\n+        #set paired = True\n+        #set input_1 = $library.input_1.forward\n+        #set input_2 = $library.input_1.reverse\n+        #set read1 = re.sub(\'[^\\w\\-\\s]\', \'_\', str($library.input_1.name))\n+        #else\n+        #set input_1 = $library.input_1\n+        #set read1 = re.sub(\'[^\\w\\-\\s]\', \'_\', str($library.input_1.element_identifier))\n+        #end if\n \n-            #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"):\n-                #set read1 = "input_f.fastq.gz"\n-                #set compressed = "GZ"\n-                #set out1 = "out1.gz"\n-            #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):\n-                #set read1 = "input_f.fastq.bz2"\n-                #set compressed = "BZ2"\n-                #set out1 = "out1.bz2"\n-            #else if $library.input_1.is_of_type(\'fasta\'):\n+        #if $input_1.is_of_type("fastq.gz", "fastqsanger.gz"):\n+            #set read1 = $read1 + ".fq.gz"\n+            #set out1 = "out1.gz"\n+        #else if $input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):\n+            #set read1 = $read1 + ".fq.bz2"\n+            #set out1 = "out1.bz2"\n+        #else if $input_1.is_of_type(\'fasta\'):\n+            #set format = "fasta"\n+            #set read1 = $read1 + ".fa"\n+            #set out1 = "out1.fa"\n+        #else:\n+            #set read1 = $read1 + ".fq"\n+            #set out1 = "out1.fq"\n+        #end if\n+        ln -f -s \'${input_1}\' \'$read1\' &&\n+\n+        #if $paired:\n+            #if $input_2.is_of_type("fastq.gz", "fastqsanger.gz"):\n+                #set read2 = $read2 + ".fq.gz"\n+                #set out2 = "out2.gz"\n+            #else if $input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"):\n+                #set read2 = $read2 + ".fq.bz2"\n+                #set out2 = "out2.bz2"\n+            #else if $input_2.is_of_type(\'fasta\'):\n                 #set format = "fasta"\n-                #set read1 = "input_f.fasta"\n-                #set out1 = "out1.fa"\n+                #set read2 = $read2 + ".fa"\n+                #set out2 = "out2.fa"\n             #else:\n-                #set read1 = "input_f.fastq"\n-                #set out1 = "out1.fq"\n-            #end if\n-            ln -f -s \'${library.input_1}\' ${read1} &&\n-\n-            #if $library.input_2.is_of_type("fastq.gz", "fastqsanger.gz"):\n-                #set read2 = "input_r.fastq.gz"\n-                #set compressed = "GZ"\n-                #set out2 = "out2.gz"\n-            #else if $library.input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"):\n-                #set read2 = "input_r.fastq.bz2"\n-                #set compressed = "BZ2"\n-                #set out2 = "out2.bz2"\n-            #else if $library.input_2.is_of_type(\'fasta\'):\n-                #set read2 = "input_r.fasta"\n-                #set out2 = "out2.fa"\n-                #set format = "fasta"\n-            #else:\n-                #set read2 = "input_r.fastq"\n+                #set read2 = $read2 + ".fq"\n                 #set out2'..b'ource_list2" value="user"/>\n             <param name="adapter2" value="AGATCGGAAGAGC"/>\n-            <output name="out1" decompress="True" file="cutadapt_out1.fq.gz"/>\n-            <output name="out2" decompress="True" file="cutadapt_out2.fq.gz"/>\n+            <output name="out1" decompress="True" file="cutadapt_out1.fq.gz" ftype="fastq.gz"/>\n+            <output name="out2" decompress="True" file="cutadapt_out2.fq.gz" ftype="fastq.gz"/>\n+        </test>\n+        <!-- Ensure paired collection works -->\n+        <test>\n+            <param name="type" value="paired_collection" />\n+            <param name="input_1">\n+                <collection type="paired">\n+                    <element name="forward" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />\n+                    <element name="reverse" ftype="fastq.gz" value="bwa-mem-fastq2.fq.gz" />\n+                </collection>\n+            </param>\n+            <param name="adapter_source_list" value="user"/>\n+            <param name="adapter" value="AGATCGGAAGAGC"/>\n+            <param name="adapter_source_list2" value="user"/>\n+            <param name="adapter2" value="AGATCGGAAGAGC"/>\n+            <output name="out1" decompress="True" file="cutadapt_out1.fq.gz" ftype="fastq.gz"/>\n+            <output name="out2" decompress="True" file="cutadapt_out2.fq.gz" ftype="fastq.gz"/>\n         </test>\n         <!-- Ensure built-in adapters work -->\n         <test>\n@@ -354,7 +332,7 @@\n             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />\n             <param name="adapter_source_list" value="builtin"/>\n             <param name="adapter" value="TGTAGGCC"/>\n-            <output name="out1" file="cutadapt_builtin.out"/>\n+            <output name="out1" file="cutadapt_builtin.out" ftype="fastq"/>\n         </test>\n         <!-- Ensure discard file output works -->\n         <test>\n@@ -365,7 +343,7 @@\n             <param name="discard" value="True"/>\n             <param name="read_modification" value="none"/>\n             <param name="output_type" value="default"/>\n-            <output name="out1" file="cutadapt_discard.out"/>\n+            <output name="out1" file="cutadapt_discard.out" ftype="fastq"/>\n         </test>\n         <!-- Ensure rest file output works -->\n         <test>\n@@ -376,8 +354,8 @@\n             <param name="read_modification" value="none"/>\n             <param name="output_type" value="additional"/>\n             <param name="rest_file" value="True"/>\n-            <output name="out1" file="cutadapt_rest.out"/>\n-            <output name="rest_output" file="cutadapt_rest2.out"/>\n+            <output name="out1" file="cutadapt_rest.out" ftype="fasta"/>\n+            <output name="rest_output" file="cutadapt_rest2.out" ftype="fasta"/>\n         </test>\n         <!-- Ensure nextseq-trim option works -->\n         <test>\n@@ -387,7 +365,7 @@\n             <param name="adapter" value="AGATCGGAAGAGC"/>\n             <param name="read_modification" value="modify"/>\n             <param name="nextseq_trim" value="20" />\n-            <output name="out1" decompress="True" file="cutadapt_nextseq_out.fq.gz"/>\n+            <output name="out1" decompress="True" file="cutadapt_nextseq_out.fq.gz" ftype="fastq.gz"/>\n         </test>\n         <!-- Ensure Report and Info file output work -->\n         <test>\n@@ -397,13 +375,13 @@\n             <param name="adapter" value="AGATCGGAAGAGC"/>\n             <param name="report" value="True" />\n             <param name="info_file" value="True" />\n-            <output name="out1" value="cutadapt_small.out"/>\n+            <output name="out1" value="cutadapt_small.out" ftype="fastq"/>\n             <output name="report">\n                 <assert_contents>\n                     <has_text text="Summary"/>\n                 </assert_contents>\n             </output>\n-            <output name="info_file" value="cutadapt_info_out.txt"/>\n+            <output name="info_file" value="cutadapt_info_out.txt" ftype="txt"/>\n         </test>\n     </tests>\n \n'
b
diff -r 8665bcc8b847 -r 78e1cf88d133 macros.xml
--- a/macros.xml Mon Mar 05 11:02:48 2018 -0500
+++ b/macros.xml Thu May 24 18:24:08 2018 -0400
b
@@ -261,4 +261,43 @@
 
         </xml>
 
+        <xml name="inherit_format_1">
+            <actions>
+                <conditional name="library.type">
+                    <when value="single">
+                        <action type="format">
+                            <option type="from_param" name="library.input_1" param_attribute="ext" />
+                        </action>
+                    </when>
+                    <when value="paired">
+                        <action type="format">
+                            <option type="from_param" name="library.input_1" param_attribute="ext" />
+                        </action>
+                    </when>
+                    <when value="paired_collection">
+                        <action type="format">
+                            <option type="from_param" name="library.input_1" param_attribute="forward.ext" />
+                        </action>
+                    </when>
+                </conditional>
+            </actions>
+        </xml>
+
+        <xml name="inherit_format_2">
+            <actions>
+                <conditional name="library.type">
+                    <when value="paired">
+                        <action type="format">
+                            <option type="from_param" name="library.input_2" param_attribute="ext" />
+                        </action>
+                    </when>
+                    <when value="paired_collection">
+                        <action type="format">
+                            <option type="from_param" name="library.input_1" param_attribute="reverse.ext" />
+                        </action>
+                    </when>
+                </conditional>
+            </actions>
+        </xml>
+
 </macros>
\ No newline at end of file