diff cutadapt.xml @ 21:104d86c98776 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit 1e4c2d05b7f1052a16101cb4fc0d9ca4393e9e96"
author iuc
date Thu, 05 Mar 2020 06:45:31 -0500
parents e4691e1589d3
children 093678460093
line wrap: on
line diff
--- a/cutadapt.xml	Mon Apr 08 13:49:22 2019 -0400
+++ b/cutadapt.xml	Thu Mar 05 06:45:31 2020 -0500
@@ -1,4 +1,4 @@
-<tool id="cutadapt" name="Cutadapt" version="1.16.6" profile="17.09">
+<tool id="cutadapt" name="Cutadapt" version="1.16.7" profile="17.09">
     <description>Remove adapter sequences from Fastq/Fasta</description>
     <macros>
         <import>macros.xml</import>
@@ -107,10 +107,10 @@
 
 $filter_options.discard
 $filter_options.discard_untrimmed
-#if str($filter_options.min) != '0':
+#if str($filter_options.min):
     --minimum-length=$filter_options.min
 #end if
-#if str($filter_options.max) != '0':
+#if str($filter_options.max):
     --maximum-length=$filter_options.max
 #end if
 #if $filter_options.max_n:
@@ -197,10 +197,10 @@
 
         <!-- Filter Options -->
         <section name="filter_options" title="Filter Options">
-            <param name="discard" argument="--discard-trimmed" type="boolean" value="False" truevalue="--discard" falsevalue="" label="Discard Trimmed Reads" help="Discard reads that contain the adapter instead of trimming them. Use the 'Minimum overlap length' option in order to avoid throwing away too many randomly matching reads!" />
+            <param name="discard" argument="--discard-trimmed" type="boolean" value="False" truevalue="--discard-trimmed" falsevalue="" label="Discard Trimmed Reads" help="Discard reads that contain the adapter instead of trimming them. Use the 'Minimum overlap length' option in order to avoid throwing away too many randomly matching reads!" />
             <param name="discard_untrimmed" argument="--discard_untrimmed" type="boolean" value="False" truevalue="--discard-untrimmed" falsevalue="" label="Discard Untrimmed Reads" help="Discard reads that do not contain the adapter." />
-            <param name="min" argument="--minimum-length" type="integer" min="0" optional="True" value="0" label="Minimum length" help="Discard trimmed reads that are shorter than LENGTH.  Reads that are too short even before adapter removal are also discarded. In colorspace, an initial primer is not counted. Value of 0 means no minimum length." />
-            <param name="max" argument="--maximum-length" type="integer" min="0" optional="True" value="0" label="Maximum length" help="Discard trimmed reads that are longer than LENGTH.  Reads that are too long even before adapter removal are also discarded. In colorspace, an initial primer is not counted. Value of 0 means no maximum length." />
+            <param name="min" argument="--minimum-length" type="integer" min="0" optional="True" value="" label="Minimum length" help="Discard trimmed reads that are shorter than LENGTH.  Reads that are too short even before adapter removal are also discarded. In colorspace, an initial primer is not counted." />
+            <param name="max" argument="--maximum-length" type="integer" min="0" optional="True" value="" label="Maximum length" help="Discard trimmed reads that are longer than LENGTH.  Reads that are too long even before adapter removal are also discarded. In colorspace, an initial primer is not counted." />
             <param name="max_n" argument="--max-n" type="float" min="0" optional="True" label="Max N" help="Discard reads with more than this number of 'N' bases. A number between 0 and 1 is interpreted as a fraction of the read length." />
             <param name="pair_filter" argument="--pair-filter" type="select" optional="True" label="Pair filter" help="Which of the reads in a paired-end read have to match the filtering criterion in order for the pair to be filtered. Default: any">
                 <option value="any" selected="True">any</option>
@@ -330,6 +330,14 @@
             <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"/>
+            <assert_command>
+                <not_has_text text="--discard-trimmed"/>
+                <not_has_text text="--discard-untrimmed"/>
+                <not_has_text text="--minimum-length"/>
+                <not_has_text text="--maximum-length"/>
+                <not_has_text text="--max-n"/>
+                <has_text text="--pair-filter=any"/>
+            </assert_command>
         </test>
         <!-- Ensure paired collection works -->
         <test>
@@ -361,10 +369,15 @@
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="TTAGACATATCTCCGTCG"/>
             <param name="output_filtering" value="filter"/>
-            <param name="discard" value="True"/>
+            <section name="filter_options">
+                <param name="discard" value="True"/>
+            </section>
             <param name="read_modification" value="none"/>
             <param name="output_type" value="default"/>
             <output name="out1" file="cutadapt_discard.out" ftype="fastq"/>
+            <assert_command>
+                <has_text text="--discard-trimmed"/>
+            </assert_command>
         </test>
         <!-- Ensure rest file output works -->
         <test>
@@ -440,32 +453,31 @@
              </output_collection>
         </test>
 
-
-            <test>
-                <conditional name="library">
-                    <param name="type" value="single" />
-                    <param name="input_1" ftype="fastq.gz" value="cutadapt_in_split.fastq.gz" />
-                    <section name="r1" >
-                        <repeat name="front_adapters">
-                            <conditional name="front_adapter_source">
-                                <param name="front_adapter_source_list" value="file"/>
-                                <param name="front_adapter_file" ftype="fasta"  value="barcodes.fasta" />
-                            </conditional>
-                        </repeat>
-                    </section>
-                </conditional>
-                <param name="report" value="False" />
-                <param name="info_file" value="False" />
-                <param name="multiple_output" value="True" />
-                <output_collection name="split_output" type="list" count="3">
-                       <element name="A1"  decompress="True" file="A1.fastq.gz" ftype="fastq.gz">
-                       </element>
-                       <element name="A2" decompress="True" file="A2.fastq.gz" ftype="fastq.gz">
-                       </element>
-                       <element name="unknown" decompress="True" file="unknown.fastq.gz" ftype="fastq.gz">
-                       </element>
-                 </output_collection>
-            </test>
+        <test>
+            <conditional name="library">
+                <param name="type" value="single" />
+                <param name="input_1" ftype="fastq.gz" value="cutadapt_in_split.fastq.gz" />
+                <section name="r1" >
+                    <repeat name="front_adapters">
+                        <conditional name="front_adapter_source">
+                            <param name="front_adapter_source_list" value="file"/>
+                            <param name="front_adapter_file" ftype="fasta"  value="barcodes.fasta" />
+                        </conditional>
+                    </repeat>
+                </section>
+            </conditional>
+            <param name="report" value="False" />
+            <param name="info_file" value="False" />
+            <param name="multiple_output" value="True" />
+            <output_collection name="split_output" type="list" count="3">
+                   <element name="A1"  decompress="True" file="A1.fastq.gz" ftype="fastq.gz">
+                   </element>
+                   <element name="A2" decompress="True" file="A2.fastq.gz" ftype="fastq.gz">
+                   </element>
+                   <element name="unknown" decompress="True" file="unknown.fastq.gz" ftype="fastq.gz">
+                   </element>
+             </output_collection>
+        </test>
 
         <!-- Ensure untrimmed file output works -->
         <test>
@@ -493,6 +505,30 @@
             -->
             <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>
+            <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" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+            <param name="adapter_source_list2" value="user"/>
+            <param name="adapter2" value="AGATCGGAAGAGC"/>
+            <section name="filter_options">
+                <param name="discard_untrimmed" value="true"/>
+                <param name="min" value="1"/>
+                <param name="max" value="1000"/>
+                <param name="max_n" value="1"/>
+                <param name="pair_filter" value="both"/>
+            </section>
+            <assert_command>
+                <has_text text="--discard-untrimmed"/>
+                <has_text text="--minimum-length=1"/>
+                <has_text text="--maximum-length=1000"/>
+                <has_text text="--max-n=1"/>
+                <has_text text="--pair-filter=both"/>
+            </assert_command>
+        </test>
     </tests>
 
     <help><![CDATA[