diff stacks_cstacks.xml @ 2:fcce77c09289 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:23:04 -0400
parents da351b9031de
children 0cd2df8af811
line wrap: on
line diff
--- a/stacks_cstacks.xml	Mon Sep 30 14:18:15 2019 -0400
+++ b/stacks_cstacks.xml	Thu Jul 16 07:23:04 2020 -0400
@@ -8,11 +8,10 @@
     <command detect_errors="aggressive"><![CDATA[
 #import re
 
-mkdir stacks_inputs stacks_outputs
-&&
+trap ">&2 cat '$output_log'" err exit &&
+mkdir stacks_inputs stacks_outputs &&
 
 @LINK_STACKS_INPUT@
-
 cstacks
 
 -p \${GALAXY_SLOTS:-1}
@@ -38,25 +37,23 @@
 #end if
 $report_mmatches
 @TEE_APPEND_LOG@
-@CAT_LOG_TO_STDERR@
 
 #if $popmap
     ## When using a popmap, cstacks writes to the input dir
     && mv stacks_inputs/catalog.*.tsv stacks_outputs/
 #end if
-
     ]]></command>
 
     <inputs>
         <expand macro="input_stacks_macro"/>
 
-        <param name="popmap" type="data" format="tabular,txt" label="Population map" help="If set, the catalog will be built from samples listed in this file" optional="true" argument="-M" />
+        <param name="popmap" type="data" format="tabular,txt" label="Population map" help="If set, the catalog will be built from samples listed in this file" optional="true" argument="-M"/>
 
         <param argument="-n" type="integer" value="1" label="Number of mismatches allowed between sample loci when building the catalog" help="(default 1; suggested: set to ustacks -M)"/>
 
         <expand macro="gap_options"/>
         <param argument="--k_len" type="integer" min="5" max="31" value="" optional="true" label="K-mer size for matching between between catalog loci" help="default: automatic"/>
-        <param argument="--report_mmatches" type="boolean" checked="false" truevalue="--report_mmatches" falsevalue="" label="Report query loci that match more than one catalog locus" />
+        <param argument="--report_mmatches" type="boolean" checked="false" truevalue="--report_mmatches" falsevalue="" label="Report query loci that match more than one catalog locus"/>
         <expand macro="in_log"/>
     </inputs>
 
@@ -67,72 +64,84 @@
 
     <tests>
         <!-- test w default options + popmap -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_stacks">
                 <collection type="list">
-                    <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
-                    <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
-                    <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
-                    <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
-                    <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
-                    <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
+                    <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv"/>
+                    <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv"/>
+                    <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv"/>
+                    <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv"/>
+                    <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv"/>
+                    <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv"/>
                </collection>
             </param>
-            <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
-            <param name="add_log" value="yes" />
+            <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv"/>
+            <assert_command>
+                <has_text text="-M "/>
+                <has_text text="--max_gaps 2.0"/>
+                <has_text text="--min_aln_len 0.8"/>
+            </assert_command>
+            <param name="add_log" value="yes"/>
             <output name="output_log" ftype="txt" file="cstacks/cstacks.log"/>
+            <!-- 1st test checks for file content allowing differences in the 2 comment lines that contain date and version -->
             <output_collection name="catalog" type="list">
-                <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="2" />
-                <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
+                <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="4"/>
+                <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="4"/>
+                <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="4"/>
             </output_collection>
         </test>
         <!-- test w default options -->
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_stacks">
                 <collection type="list">
-                    <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
-                    <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
-                    <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
-                    <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
-                    <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
-                    <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
+                    <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv"/>
+                    <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv"/>
+                    <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv"/>
+                    <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv"/>
+                    <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv"/>
+                    <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv"/>
                </collection>
             </param>
-            <param name="add_log" value="yes" />
-            <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
+            <assert_command>
+                <not_has_text text="-M "/>
+                <has_text text="--max_gaps 2.0"/>
+                <has_text text="--min_aln_len 0.8"/>
+            </assert_command>
+            <param name="add_log" value="yes"/>
+            <output name="output_log"><assert_contents><has_text text="done."/></assert_contents></output>
             <output_collection name="catalog" type="list">
-                <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="2" />
-                <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
+                <element name="catalog.alleles"><assert_contents><has_text text="# cstacks completed on "/></assert_contents></element>
+                <element name="catalog.snps"><assert_contents><has_text text="# cstacks completed on "/></assert_contents></element>
+                <element name="catalog.tags"><assert_contents><has_text text="# cstacks completed on "/></assert_contents></element>
             </output_collection>
         </test>
         <!-- test w non default options (wo gapped, because tested already in ustacks) -->
-        <test>
+        <test expect_num_outputs="1">
             <param name="input_stacks">
                 <collection type="list">
-                    <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv" />
-                    <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv" />
-                    <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv" />
-                    <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv" />
-                    <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv" />
-                    <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv" />
+                    <element name="PopA_01.alleles" ftype="tabular" value="ustacks/PopA_01.alleles.tsv"/>
+                    <element name="PopA_01.snps" ftype="tabular" value="ustacks/PopA_01.snps.tsv"/>
+                    <element name="PopA_01.tags" ftype="tabular" value="ustacks/PopA_01.tags.tsv"/>
+                    <element name="PopA_02.alleles" ftype="tabular" value="ustacks/PopA_02.alleles.tsv"/>
+                    <element name="PopA_02.snps" ftype="tabular" value="ustacks/PopA_02.snps.tsv"/>
+                    <element name="PopA_02.tags" ftype="tabular" value="ustacks/PopA_02.tags.tsv"/>
                </collection>
             </param>
             <param name="n" value="2"/>
             <param name="k_len" value="23"/>
-            <param name="report_mmatches" value="--report_mmatches" />
+            <param name="report_mmatches" value="--report_mmatches"/>
             <assert_command>
-                <has_text text="--k_len 23" />
-                <has_text text="-n 2" />
-                <has_text text="--report_mmatches" />
+                <not_has_text text="-M "/>
+                <has_text text="--k_len 23"/>
+                <has_text text="-n 2"/>
+                <has_text text="--report_mmatches"/>
             </assert_command>
-            <param name="add_log" value="yes" />
-            <output name="output_log"><assert_contents><has_text text="done." /></assert_contents></output>
+            <param name="add_log" value="no"/>
+            <assert_stderr><has_text text="done."/></assert_stderr>
             <output_collection name="catalog" type="list">
-                <element name="catalog.alleles" file="cstacks/catalog.alleles.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="catalog.snps" file="cstacks/catalog.snps.tsv" ftype="tabular" lines_diff="2" />
-                <element name="catalog.tags" file="cstacks/catalog.tags.tsv" ftype="tabular" lines_diff="2" />
+                <element name="catalog.alleles"><assert_contents><has_text text="# cstacks completed on "/></assert_contents></element>
+                <element name="catalog.snps"><assert_contents><has_text text="# cstacks completed on "/></assert_contents></element>
+                <element name="catalog.tags"><assert_contents><has_text text="# cstacks completed on "/></assert_contents></element>
             </output_collection>
         </test>
     </tests>
@@ -173,5 +182,5 @@
 @STACKS_INFOS@
 ]]>
     </help>
-    <expand macro="citation" />
+    <expand macro="citation"/>
 </tool>