diff stacks_ustacks.xml @ 2:d033e1ccb386 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:31:44 -0400
parents 21d2aa544835
children d1fda11e602f
line wrap: on
line diff
--- a/stacks_ustacks.xml	Mon Sep 30 14:16:43 2019 -0400
+++ b/stacks_ustacks.xml	Thu Jul 16 07:31:44 2020 -0400
@@ -8,9 +8,8 @@
     <command detect_errors="aggressive"><![CDATA[
 @FASTQ_INPUT_FUNCTIONS@
 
-mkdir stacks_inputs stacks_outputs
-
-&&
+trap ">&2 cat '$output_log'" err exit &&
+mkdir stacks_inputs stacks_outputs &&
 
 #set $ID=1
 #for $sample in $input_type.fqinputs
@@ -58,12 +57,12 @@
     #end if
 
     -o stacks_outputs
-
     @TEE_APPEND_LOG@
+    &&
 
     #set $ID=$ID+1
 #end for
-@CAT_LOG_TO_STDERR@
+true
 ## If input is in gz format, stacks will output gzipped files (no option to control this)
 #if $inputype.startswith('gz')
     && gunzip stacks_outputs/*.gz
@@ -76,11 +75,11 @@
         <param argument="-m" type="integer" value="3" label="Minimum depth of coverage required to create a stack"/>
         <param argument="-M" type="integer" value="2" label="Maximum distance (in nucleotides) allowed between stacks"/>
         <param argument="-N" type="integer" value="" optional="true" label="Maximum distance allowed to align secondary reads to primary stacks" help="(default: M + 2)"/>
-        <param argument="-R" type="boolean" checked="false" truevalue="-R" falsevalue="" label="Retain unused reads" />
-        <param argument="-H" type="boolean" checked="false" truevalue="-H" falsevalue="" label="Disable calling haplotypes from secondary reads" />
+        <param argument="-R" type="boolean" checked="false" truevalue="-R" falsevalue="" label="Retain unused reads"/>
+        <param argument="-H" type="boolean" checked="false" truevalue="-H" falsevalue="" label="Disable calling haplotypes from secondary reads"/>
         <section name="assembly_options" title="SNP Model Options (ustacks options)" expanded="True">
-            <param argument="--keep_high_cov" type="boolean" checked="false" truevalue="--keep_high_cov" falsevalue="" label="Disable the algorithm that removes highly-repetitive stacks and nearby errors. " />
-            <param argument="-d" type="boolean" checked="false" truevalue="-d" falsevalue="" label="Enable the Deleveraging algorithm, used for resolving over merged tags" />
+            <param argument="--keep_high_cov" type="boolean" checked="false" truevalue="--keep_high_cov" falsevalue="" label="Disable the algorithm that removes highly-repetitive stacks and nearby errors. "/>
+            <param argument="-d" type="boolean" checked="false" truevalue="-d" falsevalue="" label="Enable the Deleveraging algorithm, used for resolving over merged tags"/>
             <param argument="--high_cov_thres" type="float" min="0.0" value="3.0" label="Highly-repetitive stacks threshold" help="in standard deviation units"/>
             <param argument="--max_locus_stacks" type="integer" value="3" label="Maximum number of stacks at a single de novo locus"/>
             <param argument="--k_len" type="integer" value="" min="7" max="31" optional="true" label="K-mer size for matching between alleles and loci (automatically calculated by default)"/>
@@ -101,91 +100,92 @@
 
     <tests>
         <!-- paired list, default options, test for file equality -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_type|input_type_select" value="paired"/>
             <param name="input_type|fqinputs">
                 <collection type="list:paired">
                     <element name="PopA_01">
                         <collection type="paired">
-                            <element name="forward" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger" />
+                            <element name="forward" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger"/>
                             <element name="reverse" value="demultiplexed/PopA_01.2.fq" ftype="fastqsanger"/>
                         </collection>
                     </element>
                     <element name="PopA_02">
                         <collection type="paired">
-                            <element name="forward" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger" />
+                            <element name="forward" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger"/>
                             <element name="reverse" value="demultiplexed/PopA_02.2.fq" ftype="fastqsanger"/>
                         </collection>
                     </element>
                 </collection>
             </param>
-            <param name="add_log" value="yes" />
-            <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
+            <param name="add_log" value="yes"/>
+            <output name="output_log"><assert_contents><has_text text="done."/></assert_contents></output>
+            <!-- 1st test checks for file content allowing differences in the 2 comment lines that contain date and version -->
             <output_collection name="tabs" type="list" count="6">
-                <element name="PopA_01.tags" ftype="tabular" file="ustacks/PopA_01.tags.tsv" lines_diff="2"/>
-                <element name="PopA_01.snps" ftype="tabular" file="ustacks/PopA_01.snps.tsv" lines_diff="2"/>
-                <element name="PopA_01.alleles" ftype="tabular" file="ustacks/PopA_01.alleles.tsv" lines_diff="2"/>
-                <element name="PopA_02.tags" ftype="tabular" file="ustacks/PopA_02.tags.tsv" lines_diff="2"/>
-                <element name="PopA_02.snps" ftype="tabular" file="ustacks/PopA_02.snps.tsv" lines_diff="2"/>
-                <element name="PopA_02.alleles" ftype="tabular" file="ustacks/PopA_02.alleles.tsv" lines_diff="2"/>
+                <element name="PopA_01.tags" ftype="tabular" file="ustacks/PopA_01.tags.tsv" lines_diff="4"/>
+                <element name="PopA_01.snps" ftype="tabular" file="ustacks/PopA_01.snps.tsv" lines_diff="4"/>
+                <element name="PopA_01.alleles" ftype="tabular" file="ustacks/PopA_01.alleles.tsv" lines_diff="4"/>
+                <element name="PopA_02.tags" ftype="tabular" file="ustacks/PopA_02.tags.tsv" lines_diff="4"/>
+                <element name="PopA_02.snps" ftype="tabular" file="ustacks/PopA_02.snps.tsv" lines_diff="4"/>
+                <element name="PopA_02.alleles" ftype="tabular" file="ustacks/PopA_02.alleles.tsv" lines_diff="4"/>
             </output_collection>
         </test>
         <!-- manual selected list of elements + default args, test for file equality -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_type|input_type_select" value="single"/>
-            <param name="input_type|fqinputs" value="demultiplexed/PopA_01.1.fq,demultiplexed/PopA_02.1.fq" ftype="fastqsanger" />
-            <param name="add_log" value="yes" />
+            <param name="input_type|fqinputs" value="demultiplexed/PopA_01.1.fq,demultiplexed/PopA_02.1.fq" ftype="fastqsanger"/>
+            <param name="add_log" value="yes"/>
             <output name="output_log" ftype="txt"><assert_contents><has_text text="ustacks is done."/></assert_contents></output>
             <output_collection name="tabs" count="6">
-                <element name="PopA_01.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
+                <element name="PopA_01.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
             </output_collection>
         </test>
         <!-- manual selected list of elements + non-default short args, test for file presence -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_type|input_type_select" value="single"/>
-            <param name="input_type|fqinputs" value="demultiplexed/PopA_01.1.fq,demultiplexed/PopA_02.1.fq" ftype="fastqsanger" />
-            <param name="m" value="2" />
-            <param name="M" value="3" />
+            <param name="input_type|fqinputs" value="demultiplexed/PopA_01.1.fq,demultiplexed/PopA_02.1.fq" ftype="fastqsanger"/>
+            <param name="m" value="2"/>
+            <param name="M" value="3"/>
             <param name="N" value="4"/>
-            <param name="R" value="-R" />
-            <param name="H" value="-H" />
-            <param name="add_log" value="yes" />
+            <param name="R" value="-R"/>
+            <param name="H" value="-H"/>
+            <param name="add_log" value="yes"/>
             <assert_command>
-                <has_text text="-m 2" />
-                <has_text text="-M 3" />
-                <has_text text="-N 4" />
-                <has_text text="-R" />
-                <has_text text="-H" />
+                <has_text text="-m 2"/>
+                <has_text text="-M 3"/>
+                <has_text text="-N 4"/>
+                <has_text text="-R"/>
+                <has_text text="-H"/>
             </assert_command>
             <output name="output_log" ftype="txt"><assert_contents><has_text text="ustacks is done."/></assert_contents></output>
             <output_collection name="tabs" count="6">
-                <element name="PopA_01.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
+                <element name="PopA_01.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
             </output_collection>
         </test>
         <!-- paired list, non-default model options, disabled gapped alignment, test for file presence -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_type|input_type_select" value="paired"/>
             <param name="input_type|fqinputs">
                 <collection type="list:paired">
                     <element name="PopA_01">
                         <collection type="paired">
-                            <element name="forward" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger" />
+                            <element name="forward" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger"/>
                             <element name="reverse" value="demultiplexed/PopA_01.2.fq" ftype="fastqsanger"/>
                         </collection>
                     </element>
                     <element name="PopA_02">
                         <collection type="paired">
-                            <element name="forward" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger" />
+                            <element name="forward" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger"/>
                             <element name="reverse" value="demultiplexed/PopA_02.2.fq" ftype="fastqsanger"/>
                         </collection>
                     </element>
@@ -198,61 +198,61 @@
                 <param name="bound_high" value="0.5"/>
                 <param name="bc_err_freq" value="0.1"/>
             </conditional>
-            <param name="gapped|use_gapped" value="no" />
-            <param name="add_log" value="yes" />
+            <param name="gapped|use_gapped" value="no"/>
+            <param name="add_log" value="yes"/>
             <assert_command>
-                <has_text text="--model_type snp" />
-                <has_text text="--alpha 0.1" />
-                <not_has_text text="--bound_low 0.1" />
-                <not_has_text text="--bound_high 0.5" />
-                <not_has_text text="--bc_err_freq 0.1" />
-                <has_text text="--disable-gapped" />
+                <has_text text="--model_type snp"/>
+                <has_text text="--alpha 0.1"/>
+                <not_has_text text="--bound_low 0.1"/>
+                <not_has_text text="--bound_high 0.5"/>
+                <not_has_text text="--bc_err_freq 0.1"/>
+                <has_text text="--disable-gapped"/>
             </assert_command>
             <output name="output_log" ftype="txt"><assert_contents><has_text text="ustacks is done."/></assert_contents></output>
             <output_collection name="tabs" count="6">
-                <element name="PopA_01.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
+                <element name="PopA_01.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
             </output_collection>
         </test>
         <!-- list of fwd reads, nondefault assembly and gapped alignment options, test for file presence -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_type|input_type_select" value="paired"/>
             <param name="input_type|fqinputs">
                 <collection type="list">
-                    <element name="PopA_01" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger" />
+                    <element name="PopA_01" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger"/>
                     <element name="PopA_02" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger"/>
                 </collection>
             </param>
             <param name="assembly_options|keep_high_cov" value="true"/>
-            <param name="assembly_options|d" value="-d" />
+            <param name="assembly_options|d" value="-d"/>
             <param name="assembly_options|high_cov_thres" value="2.0"/>
-            <param name="assembly_options|max_locus_stacks" value="4" />
+            <param name="assembly_options|max_locus_stacks" value="4"/>
             <param name="assembly_options|k_len" value="12"/>
-            <param name="gapped|use_gapped" value="yes" />
-            <param name="gapped|max_gaps" value="3" />
+            <param name="gapped|use_gapped" value="yes"/>
+            <param name="gapped|max_gaps" value="3"/>
             <param name="gapped|min_aln_len" value="0.7"/>
-            <param name="add_log" value="yes" />
+            <param name="add_log" value="yes"/>
             <assert_command>
-                <has_text text="--keep_high_cov" />
-                <has_text text="-d" />
-                <has_text text="--high_cov_thres 2.0" />
-                <has_text text="--max_locus_stacks 4" />
-                <has_text text="--k_len 12" />
-                <has_text text="--max_gaps 3" />
-                <has_text text="--min_aln_len 0.7" />
+                <has_text text="--keep_high_cov"/>
+                <has_text text="-d"/>
+                <has_text text="--high_cov_thres 2.0"/>
+                <has_text text="--max_locus_stacks 4"/>
+                <has_text text="--k_len 12"/>
+                <has_text text="--max_gaps 3"/>
+                <has_text text="--min_aln_len 0.7"/>
             </assert_command>
             <output name="output_log" ftype="txt"><assert_contents><has_text text="ustacks is done."/></assert_contents></output>
             <output_collection name="tabs" count="6">
-                <element name="PopA_01.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_01.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.tags"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.snps"><assert_contents><has_text text="generated on " /></assert_contents></element>
-                <element name="PopA_02.alleles"><assert_contents><has_text text="generated on " /></assert_contents></element>
+                <element name="PopA_01.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_01.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.tags"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.snps"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
+                <element name="PopA_02.alleles"><assert_contents><has_text text="# ustacks completed on "/></assert_contents></element>
             </output_collection>
         </test>
     </tests>
@@ -294,5 +294,5 @@
 @STACKS_INFOS@
 ]]>
     </help>
-    <expand macro="citation" />
+    <expand macro="citation"/>
 </tool>