changeset 23:c4b82dce8335 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit d1e907795fa943b505723dd6f7bf0a61723d8818"
author iuc
date Fri, 30 Apr 2021 10:13:37 +0000
parents 093678460093
children 288f97432497
files cutadapt.xml macros.xml
diffstat 2 files changed, 32 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/cutadapt.xml	Sat Jul 04 06:52:59 2020 -0400
+++ b/cutadapt.xml	Fri Apr 30 10:13:37 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="cutadapt" name="Cutadapt" version="1.16.8" profile="17.09">
+<tool id="cutadapt" name="Cutadapt" version="1.16.9" profile="17.09">
     <description>Remove adapter sequences from Fastq/Fasta</description>
     <macros>
         <import>macros.xml</import>
@@ -93,8 +93,13 @@
 #else:
     @read1_options@
     @read2_options@
-    --output='$out1'
-    --paired-output='$out2'
+    #if $library.type == "paired"
+        --output='$out1'
+        --paired-output='$out2'
+    #else
+        --output='$out_pairs.forward'
+        --paired-output='$out_pairs.reverse'
+    #end if
 #end if
 
 --error-rate=$adapter_options.error_rate
@@ -240,14 +245,18 @@
 
     <outputs>
         <data name="out1" format="fastqsanger" metadata_source="input_1" from_work_dir="out1*" label="${tool.name} on ${on_string}: Read 1 Output">
-            <filter>(output_options['multiple_output'] is False)</filter>
+            <filter>(output_options['multiple_output'] is False and library['type'] != 'paired_collection')</filter>
             <expand macro="inherit_format_1" />
         </data>
         <data name="out2" format="fastqsanger" metadata_source="input_2" from_work_dir="out2*" label="${tool.name} on ${on_string}: Read 2 Output" >
-            <filter>(library['type'] == 'paired' or library['type'] == 'paired_collection')</filter>
+            <filter>(output_options['multiple_output'] is False and library['type'] == 'paired')</filter>
             <expand macro="inherit_format_2" />
         </data>
 
+        <collection name="out_pairs" type="paired" format_source="input_1" label="${tool.name} on ${on_string}: Reads">
+            <filter>(output_options['multiple_output'] is False and library['type'] == 'paired_collection')</filter>
+        </collection>
+
         <data name="report" format="txt" from_work_dir="report.txt" label="${tool.name} on ${on_string}: Report">
             <filter>(output_options['report'] is True)</filter>
         </data>
@@ -304,7 +313,7 @@
 
     <tests>
         <!-- Ensure fastq works -->
-        <test>
+        <test expect_num_outputs="1">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
@@ -312,7 +321,7 @@
             <output name="out1" file="cutadapt_small.out" ftype="fastq"/>
         </test>
         <!-- Ensure single end fastq.gz works -->
-        <test>
+        <test expect_num_outputs="1">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
             <param name="adapter_source_list" value="user"/>
@@ -320,7 +329,7 @@
             <output name="out1" decompress="True" file="cutadapt_out1.fq.gz" ftype="fastq.gz"/>
         </test>
         <!-- Ensure paired end fastq.gz works -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="type" value="paired" />
             <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
             <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2.fq.gz" />
@@ -340,7 +349,7 @@
             </assert_command>
         </test>
         <!-- Ensure paired collection works -->
-        <test>
+        <test expect_num_outputs="3">
             <param name="type" value="paired_collection" />
             <param name="input_1">
                 <collection type="paired">
@@ -352,11 +361,13 @@
             <param name="adapter" value="AGATCGGAAGAGC"/>
             <param name="adapter_source_list2" value="user"/>
             <param name="adapter2" value="AGATCGGAAGAGC"/>
-            <output name="out1" decompress="True" file="cutadapt_out1.fq.gz" ftype="fastq.gz"/>
-            <output name="out2" decompress="True" file="cutadapt_out2.fq.gz" ftype="fastq.gz"/>
+            <output_collection name="out_pairs" type="paired">
+                <element name="forward" decompress="True" file="cutadapt_out1.fq.gz" ftype="fastq.gz" />
+                <element name="reverse" decompress="True" file="cutadapt_out2.fq.gz" ftype="fastq.gz" />
+            </output_collection>
         </test>
         <!-- Ensure built-in adapters work -->
-        <test>
+        <test expect_num_outputs="1">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="builtin"/>
@@ -364,7 +375,7 @@
             <output name="out1" file="cutadapt_builtin.out" ftype="fastq"/>
         </test>
         <!-- Ensure discard file output works -->
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="TTAGACATATCTCCGTCG"/>
@@ -380,7 +391,7 @@
             </assert_command>
         </test>
         <!-- Ensure rest file output works -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_1" ftype="fasta" value="cutadapt_rest.fa" />
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="AAAGATG"/>
@@ -392,7 +403,7 @@
             <output name="rest_output" file="cutadapt_rest2.out" ftype="fasta"/>
         </test>
         <!-- Ensure nextseq-trim option works -->
-        <test>
+        <test expect_num_outputs="1">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
             <param name="adapter_source_list" value="user"/>
@@ -402,7 +413,7 @@
             <output name="out1" decompress="True" file="cutadapt_nextseq_out.fq.gz" ftype="fastq.gz"/>
         </test>
         <!-- Ensure Report and Info file output work -->
-        <test>
+        <test expect_num_outputs="3">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
@@ -419,7 +430,7 @@
         </test>
 
 
-        <test>
+        <test expect_num_outputs="1">
             <conditional name="library">
                 <param name="type" value="single" />
                 <param name="input_1" ftype="fastq" value="cutadapt_in_split.fastq" />
@@ -453,7 +464,7 @@
              </output_collection>
         </test>
 
-        <test>
+        <test expect_num_outputs="1">
             <conditional name="library">
                 <param name="type" value="single" />
                 <param name="input_1" ftype="fastq.gz" value="cutadapt_in_split.fastq.gz" />
@@ -480,7 +491,7 @@
         </test>
 
         <!-- Ensure untrimmed file output works -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
@@ -490,7 +501,7 @@
             <output name="untrimmed_output" file="cutadapt_untrimmed.out" ftype="fastq"/>
         </test>
         <!-- Ensure untrimmed gzip file output works -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="type" value="single" />
             <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
             <param name="adapter_source_list" value="user"/>
@@ -506,7 +517,7 @@
             <output name="untrimmed_output" file="cutadapt_untrimmed.out.gz" compare="sim_size" delta="4000" ftype="fastq.gz"/>
         </test>
         <!-- same as 1st test with paired data + filter options (because of discard_untrimmed no comparison is done) -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="type" value="paired" />
             <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
             <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2.fq.gz" />
--- a/macros.xml	Sat Jul 04 06:52:59 2020 -0400
+++ b/macros.xml	Fri Apr 30 10:13:37 2021 +0000
@@ -338,11 +338,6 @@
                             <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>
@@ -355,11 +350,6 @@
                             <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>