diff stacks_denovomap.xml @ 4:a70c766ce64f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit 4e87a14a5479800df9675c1cbcdbe1b11f63653b-dirty
author matthias
date Wed, 27 Feb 2019 09:55:08 -0500
parents 58b5c841fa51
children 3680074758c5
line wrap: on
line diff
--- a/stacks_denovomap.xml	Fri Jan 04 03:33:53 2019 -0500
+++ b/stacks_denovomap.xml	Wed Feb 27 09:55:08 2019 -0500
@@ -1,28 +1,17 @@
-<tool id="stacks2_denovomap" name="Stacks2: de novo map" version="@STACKS_VERSION@+galaxy@WRAPPER_VERSION@">
+<tool id="stacks2_denovomap" name="Stacks2: de novo map" profile="@PROFILE@" version="@STACKS_VERSION@+galaxy@WRAPPER_VERSION@">
     <description>the Stacks pipeline without a reference genome (denovo_map.pl)</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements"/>
-    <expand macro="stdio"/>
-    <command><![CDATA[
-@CLEAN_EXT@
+    <expand macro="version_cmd"/>
+    <command detect_errors="aggressive"><![CDATA[
+@FASTQ_INPUT_FUNCTIONS@
 mkdir stacks_inputs stacks_outputs&&
 
-## link input reads
-## - for paired lists NAME.1.EXT and NAME.2.EXT files are created
-## - otherwise NAME.EXT
-#for $sample in $input_type.samples
-    #if $sample.is_collection:
-        #set $read_direction="forward"
-        @FASTQ_INPUT@
-        #set $read_direction="reverse"
-        @FASTQ_INPUT@
-    #else
-        #set $read_direction=None
-        @FASTQ_INPUT@
-    #end if
-#end for
+
+#set ($link_command, $inputype) = $fastq_input_nonbatch( $input_type.fqinputs, $input_type.input_type_select, ".%d" )
+$link_command
 
 denovo_map.pl
 --samples stacks_inputs
@@ -38,17 +27,15 @@
 --gt-alpha $model_options.gt_alpha
 $paired
 
-
-
 ## the catalog.calls output is a gzip-ed vcf extract it
-## to make it usable in Galaxy (with the downside that we 
+## to make it usable in Galaxy (with the downside that we
 ## need to gzip it again for downstream calls like populations)
 && gunzip -c stacks_outputs/catalog.calls > stacks_outputs/catalog.calls.vcf
 && mv stacks_outputs/denovo_map.log $output_log
     ]]></command>
 
     <inputs>
-        <expand macro="fastq_input_macro"/>
+        <expand macro="fastq_input"/>
         <param argument="--popmap" type="data" format="tabular,txt" label="Population map" />
         <section name="assembly_options" title="Assembly options" expanded="true">
             <param name="M" argument="-M" type="integer" value="2" label="Number of mismatches allowed between loci when processing a single individual" help="used in ustacks"/>
@@ -71,11 +58,31 @@
     </outputs>
 
     <tests>
-        <!-- SE input as multi selection, defaults testing against the output of the pipeline components -->    
+       <!-- paired input using also reverse reads,
+            the results are tested for equality, the tools corresponding the the programs
+            used in the pipeline have also a test (should be the first) that test for
+            equality thereby it is "ensured" that the pipeline w defaults is doing the same
+            as the components w defaults. -->
         <test>
-            <param name="input_type|input_type_selector" value="manual"/>
-            <param name="input_type|samples" value="demultiplexed/PopA_01.1.fq,demultiplexed/PopA_02.1.fq" ftype="fastqsanger" />
+            <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="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="reverse" value="demultiplexed/PopA_02.2.fq" ftype="fastqsanger"/>
+                        </collection>
+                    </element>
+                </collection>
+            </param>
             <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
+            <param name="paired" value="--paired" />
             <output_collection name="tabs" count="6">
                 <element name="PopA_01.tags" file="ustacks/PopA_01.tags.tsv" ftype="tabular" lines_diff="2"/>
                 <element name="PopA_01.snps" file="ustacks/PopA_01.snps.tsv" ftype="tabular" lines_diff="2"/>
@@ -98,20 +105,37 @@
                 <element name="PopA_02.matches" file="tsv2bam/PopA_02.matches.bam" ftype="bam" compare="sim_size"  />
             </output_collection>
             <output_collection name="gstacks_out" type="list" count="2">
-                <element name="catalog.calls.vcf" file="gstacks/catalog.calls.tsv" ftype="vcf" lines_diff="2"/>
+                <element name="catalog.calls.vcf" file="gstacks/catalog.calls.vcf" ftype="vcf"/>
                 <element name="catalog.fa.gz" file="gstacks/catalog.fa.gz" ftype="fasta.gz" compare="sim_size"/>
             </output_collection>
             <output ftype="tabular" name="out_haplotypes" value="populations/populations.haplotypes.tsv"/>
-            <output ftype="tabular" name="out_hapstats" value="populations/populations.hapstats.tsv"/>
-            <output ftype="txt" name="out_populations_log_distribs" value="populations/populations.log.distribs"/>
+            <output ftype="tabular" name="out_hapstats" value="populations/populations.hapstats.tsv" compare="sim_size"/>
+            <output ftype="txt" name="out_populations_log_distribs" value="populations/populations.log.distribs" compare="sim_size"/>
             <output ftype="tabular" name="out_sumstats_sum" value="populations/populations.sumstats_summary.tsv"/>
-            <output ftype="tabular" name="out_sumstats" value="populations/populations.sumstats.tsv"/>
+            <output ftype="tabular" name="out_sumstats" value="populations/populations.sumstats.tsv" compare="sim_size"/>
             <output ftype="tabular" name="out_sql" value="populations/populations.markers.tsv"/>
         </test>
+        <!-- SE input as multi selection, defaults testing against the output of the pipeline components -->
+        <test>
+            <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="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
+            <output_collection name="tabs" count="6"/>
+            <output_collection name="catalog" type="list" count="3"/>
+            <output_collection name="matches" type="list" count="2"/>
+            <output_collection name="bams" type="list" count="2"/>
+            <output_collection name="gstacks_out" type="list" count="2"/>
+            <output ftype="tabular" name="out_haplotypes"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_hapstats"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="txt" name="out_populations_log_distribs"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sumstats_sum"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sumstats"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sql"><assert_contents><has_text text="#"/></assert_contents></output>
+        </test>
         <!-- SE input as list, non-defaults, testing only correct size of the collections -->
         <test>
-            <param name="input_type|input_type_selector" value="list"/>
-            <param name="input_type|samples">
+            <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_02" value="demultiplexed/PopA_02.1.fq" ftype="fastqsanger"/>
@@ -125,19 +149,25 @@
             <assert_command>
                 <has_text text="-M 3" />
                 <has_text text="-n 3" />
-                <has_text text="--var-alpha 0.1" />
-                <has_text text="--gt-alpha 0.1" />
+                <has_text text="\-\-var-alpha 0.1" />
+                <has_text text="\-\-gt-alpha 0.1" />
             </assert_command>
             <output_collection name="tabs" count="6"/>
             <output_collection name="catalog" type="list" count="3"/>
             <output_collection name="matches" type="list" count="2"/>
             <output_collection name="bams" type="list" count="2"/>
             <output_collection name="gstacks_out" type="list" count="2"/>
+            <output ftype="tabular" name="out_haplotypes"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_hapstats"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="txt" name="out_populations_log_distribs"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sumstats_sum"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sumstats"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sql"><assert_contents><has_text text="#"/></assert_contents></output>
         </test>
-        <!-- paired input, deafults (not using reverse reads), testing against the output of the pipeline components (note, this is equal because reverse reads are not used) -->    
+        <!-- paired input, deafults (not using reverse reads), testing against the output of the pipeline components (note, this is equal because reverse reads are not used) -->
         <test>
-            <param name="input_type|input_type_selector" value="list"/>
-            <param name="input_type|samples">
+            <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">
@@ -154,64 +184,17 @@
                 </collection>
             </param>
             <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
-            <output_collection name="tabs" count="6">
-                <element name="PopA_01.tags" file="ustacks/PopA_01.tags.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="PopA_01.snps" file="ustacks/PopA_01.snps.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="PopA_01.alleles" file="ustacks/PopA_01.alleles.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="PopA_02.tags" file="ustacks/PopA_02.tags.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="PopA_02.snps" file="ustacks/PopA_02.snps.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="PopA_02.alleles" file="ustacks/PopA_02.alleles.tsv" ftype="tabular" lines_diff="2"/>
-            </output_collection>
-            <output_collection name="catalog" type="list" count="3">
-                <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" />
-            </output_collection>
-            <output_collection name="matches" type="list" count="2">
-                <element name="PopA_01.matches" file="sstacks/PopA_01.matches.tsv" ftype="tabular" lines_diff="2"/>
-                <element name="PopA_02.matches" file="sstacks/PopA_02.matches.tsv" ftype="tabular" lines_diff="2"/>
-            </output_collection>
-            <output_collection name="bams" type="list" count="2">
-                <element name="PopA_01.matches" file="tsv2bam/PopA_01.matches.bam" ftype="bam" compare="sim_size"/>
-                <element name="PopA_02.matches" file="tsv2bam/PopA_02.matches.bam" ftype="bam" compare="sim_size"  />
-            </output_collection>
-            <output_collection name="gstacks_out" type="list" count="2">
-                <element name="catalog.calls.vcf" file="gstacks/catalog.calls.tsv" ftype="vcf" lines_diff="2"/>
-                <element name="catalog.fa.gz" file="gstacks/catalog.fa.gz" ftype="fasta.gz" compare="sim_size"/>
-            </output_collection>
-            <output ftype="tabular" name="out_haplotypes" value="populations/populations.haplotypes.tsv"/>
-            <output ftype="tabular" name="out_hapstats" value="populations/populations.hapstats.tsv"/>
-            <output ftype="txt" name="out_populations_log_distribs" value="populations/populations.log.distribs"/>
-            <output ftype="tabular" name="out_sumstats_sum" value="populations/populations.sumstats_summary.tsv"/>
-            <output ftype="tabular" name="out_sumstats" value="populations/populations.sumstats.tsv"/>
-            <output ftype="tabular" name="out_sql" value="populations/populations.markers.tsv"/>
-        </test>
-        <!-- paired input using also reverse reads, testing number of collection outputs -->    
-        <test>
-            <param name="input_type|input_type_selector" value="list"/>
-            <param name="input_type|samples">
-                <collection type="list:paired">
-                    <element name="PopA_01">
-                        <collection type="paired">
-                            <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="reverse" value="demultiplexed/PopA_02.2.fq" ftype="fastqsanger"/>
-                        </collection>
-                    </element>
-                </collection>
-            </param>
-            <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
-            <param name="paired" value="--paired" />
             <output_collection name="tabs" count="6"/>
             <output_collection name="catalog" type="list" count="3"/>
             <output_collection name="matches" type="list" count="2"/>
             <output_collection name="bams" type="list" count="2"/>
             <output_collection name="gstacks_out" type="list" count="2"/>
+            <output ftype="tabular" name="out_haplotypes"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_hapstats"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="txt" name="out_populations_log_distribs"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sumstats_sum"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sumstats"><assert_contents><has_text text="#"/></assert_contents></output>
+            <output ftype="tabular" name="out_sql"><assert_contents><has_text text="#"/></assert_contents></output>
         </test>
     </tests>