diff stacks_clonefilter.xml @ 2:2f1d464ebfd2 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit f55e2407891a3c1f73f14a77b7ddadcd6f5eb1f8"
author iuc
date Thu, 16 Jul 2020 07:30:45 -0400
parents b75174403a65
children 289b7d6b69a4
line wrap: on
line diff
--- a/stacks_clonefilter.xml	Mon Sep 30 14:19:47 2019 -0400
+++ b/stacks_clonefilter.xml	Thu Jul 16 07:30:45 2020 -0400
@@ -8,6 +8,7 @@
     <command detect_errors="aggressive"><![CDATA[
 @FASTQ_INPUT_FUNCTIONS@
 
+trap ">&2 cat '$output_log'" err exit &&
 mkdir stacks_inputs stacks_outputs &&
 
 #set ($link_command, $fwd_path, $rev_path, $inputype) = $fastq_input_batch($input_type.fqinputs, $input_type.input_type_select)
@@ -37,7 +38,6 @@
 ## the program outputs empty files for fasta/fastq
 -y gzfastq
 @TEE_APPEND_LOG@
-@CAT_LOG_TO_STDERR@
 
 ## move outputs such that Galaxy can find them
 #if $capture:
@@ -57,95 +57,87 @@
 ]]></command>
     <inputs>
         <expand macro="fastq_input_bc"/>
-        <param name="capture" type="boolean" checked="false" truevalue="-D" falsevalue="" argument="-D" label="Capture discarded reads to a file" />
+        <param name="capture" type="boolean" checked="false" truevalue="-D" falsevalue="" argument="-D" label="Capture discarded reads to a file"/>
         <param name="oligo_len_1" type="integer" value="0" label="Length of the single-end oligo sequence in dataset"/>
         <param name="oligo_len_2" optional="true" type="integer" label="Length of the paired-end oligo sequence in dataset"/>
-        <param argument="--retain_oligo" type="boolean" checked="false" truevalue="--retain_oligo" falsevalue="" label="Do not trim off the random oligo sequence (if oligo is inline)" />
+        <param argument="--retain_oligo" type="boolean" checked="false" truevalue="--retain_oligo" falsevalue="" label="Do not trim off the random oligo sequence (if oligo is inline)"/>
         <expand macro="in_log"/>
     </inputs>
     <outputs>
         <expand macro="out_log"/>
-        <data format="fastqsanger.gz" name="clean" from_work_dir="outputs/R1.fq.gz" label="${tool.name} on ${on_string}">
-            <filter>input_type['input_type_select'] == 'single'</filter>
-        </data>
-        <collection name="clean_pair" type="paired" label="${tool.name} on ${on_string}">
-            <filter>input_type['input_type_select'] == 'paired'</filter>
-        </collection>
-        <data name="discarded" format="fastqsanger" label="${tool.name} on ${on_string}: discarded reads">
-            <filter>capture and input_type['input_type_select'] == 'single' and not options_kmer_char['k_dist']</filter>
-        </data>
-        <collection name="discarded_pair" type="paired" label="${tool.name} on ${on_string}: discarded reads">
-            <filter>capture and input_type['input_type_select'] == 'paired' and not options_kmer_char['k_dist']</filter>
-        </collection>
+        <expand macro="fastq_output_filter"/>
     </outputs>
     <tests>
         <!-- single end, defaults-->
-        <test>
+        <test expect_num_outputs="2">
             <conditional name="input_type">
-                <param name="input_type_select" value="single" />
-                <param name="fqinputs" ftype="fastqsanger.gz" value="clonefilter/R1_0001.1.fq.gz" />
+                <param name="input_type_select" value="single"/>
+                <param name="fqinputs" ftype="fastqsanger.gz" value="clonefilter/R1_0001.1.fq.gz"/>
             </conditional>
-            <param name="oligo_len_1" value="6" />
-            <param name="add_log" value="yes" />
+            <param name="oligo_len_1" value="6"/>
+            <param name="add_log" value="yes"/>
             <output name="output_log" ftype="txt" file="clonefilter/clonefilter.log" lines_diff="8"/>
-            <output name="clean" compare="sim_size" file="clonefilter/Removed1_0001.1.1.fq.single.gz"/>
+            <output name="clean" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed1_0001.1.1.fq.single.gz"/>
         </test>
         <!-- single end, alt BCencoding, capture-->
-        <test>
+        <test expect_num_outputs="3">
             <conditional name="input_type">
-                <param name="input_type_select" value="single" />
-                <param name="fqinputs" ftype="fastqsanger.gz" value="clonefilter/R1_0001.1.fq.gz" />
-                <param name="barcode_encoding" value="--index_null" />
+                <param name="input_type_select" value="single"/>
+                <param name="fqinputs" ftype="fastqsanger.gz" value="clonefilter/R1_0001.1.fq.gz"/>
+                <param name="barcode_encoding" value="--index_null"/>
             </conditional>
-            <param name="capture" value="-D" />
-            <param name="oligo_len_1" value="6" />
+            <param name="capture" value="-D"/>
+            <param name="oligo_len_1" value="6"/>
             <assert_command>
-                <has_text text="-D" />
+                <has_text text="-D"/>
             </assert_command>
-            <output name="clean" compare="sim_size" file="clonefilter/Removed1_0001.1.1.fq.gz"/>
-            <output name="discarded" compare="sim_size" file="clonefilter/Removed1_0001.1.1.fq.gz"/>
+            <output name="output_log" ftype="txt"><assert_contents><has_text text="5 pairs of reads input."/></assert_contents></output>
+            <output name="clean"     compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed1_0001.1.1.fq.single-alt.gz"/>
+            <output name="discarded" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Discarded1_0001.1.1.fq.single.gz"/>
         </test>
         <!-- paired end, defaults-->
-        <test>
+        <test expect_num_outputs="4">
             <conditional name="input_type">
-                <param name="input_type_select" value="paired" />
+                <param name="input_type_select" value="paired"/>
                 <param name="fqinputs">
                     <collection type="paired">
-                        <element name="forward" value="clonefilter/R1_0001.1.fq.gz" />
-                        <element name="reverse" value="clonefilter/R2_0001.2.fq.gz" />
+                        <element name="forward" value="clonefilter/R1_0001.1.fq.gz" ftype="fastqsanger.gz"/>
+                        <element name="reverse" value="clonefilter/R2_0001.2.fq.gz" ftype="fastqsanger.gz"/>
                     </collection>
                 </param>
             </conditional>
-            <param name="oligo_len_1" value="6" />
+            <param name="oligo_len_1" value="6"/>
+            <output name="output_log" ftype="txt"><assert_contents><has_text text="4 pairs of reads input."/></assert_contents></output>
             <output_collection name="clean_pair" type="paired">
-                <element name="forward" compare="sim_size" file="clonefilter/Removed1_0001.1.1.fq.gz" />
-                <element name="reverse" compare="sim_size" file="clonefilter/Removed2_0001.2.2.fq.gz" />
+                <element name="forward" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed1_0001.1.1.fq.gz"/>
+                <element name="reverse" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed2_0001.2.2.fq.gz"/>
             </output_collection>
         </test>
         <!-- paired end, non defaults -->
-        <test>
+        <test expect_num_outputs="7">
             <conditional name="input_type">
-                <param name="input_type_select" value="paired" />
+                <param name="input_type_select" value="paired"/>
                 <param name="fqinputs">
                     <collection type="paired">
-                        <element name="forward" value="clonefilter/R1_0001.1.fq.gz" />
-                        <element name="reverse" value="clonefilter/R2_0001.2.fq.gz" />
+                        <element name="forward" value="clonefilter/R1_0001.1.fq.gz" ftype="fastqsanger.gz"/>
+                        <element name="reverse" value="clonefilter/R2_0001.2.fq.gz" ftype="fastqsanger.gz"/>
                     </collection>
                 </param>
             </conditional>
-            <param name="oligo_len_1" value="6" />
-            <param name="capture" value="-D" />
-            <param name="retain_oligo" value="--retain_oligo" />
+            <param name="oligo_len_1" value="6"/>
+            <param name="capture" value="-D"/>
+            <param name="retain_oligo" value="--retain_oligo"/>
             <assert_command>
-                <has_text text="--retain_oligo" />
+                <has_text text="--retain_oligo"/>
             </assert_command>
+            <output name="output_log" ftype="txt"><assert_contents><has_text text="4 pairs of reads input."/></assert_contents></output>
             <output_collection name="clean_pair" type="paired">
-                <element name="forward" compare="sim_size" file="clonefilter/Removed1_0001.1.1.fq.gz" />
-                <element name="reverse" compare="sim_size" file="clonefilter/Removed2_0001.2.2.fq.gz" />
+                <element name="forward" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed1_0001.1.1.fq.gz"/>
+                <element name="reverse" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed2_0001.2.2.fq.gz"/>
             </output_collection>
             <output_collection name="discarded_pair" type="paired">
-                <element name="forward" compare="sim_size" file="clonefilter/Removed1_0001.1.1.fq.gz" />
-                <element name="reverse" compare="sim_size" file="clonefilter/Removed2_0001.2.2.fq.gz" />
+                <element name="forward" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed1_0001.1.1.fq.gz"/>
+                <element name="reverse" compare="sim_size" delta_frac="0.01" ftype="fastqsanger.gz" file="clonefilter/Removed2_0001.2.2.fq.gz"/>
             </output_collection>
         </test>
     </tests>
@@ -158,5 +150,5 @@
 @STACKS_INFOS@
 ]]>
     </help>
-    <expand macro="citation" />
+    <expand macro="citation"/>
 </tool>