diff stacks_refmap.xml @ 3:26ad8a52d9fd draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks commit e1c1550e0bd61c88ffead2b1c4f6ab7393052393
author iuc
date Sat, 25 Jun 2016 17:29:09 -0400
parents 66d3c1ae3937
children 827c8c6ec4c1
line wrap: on
line diff
--- a/stacks_refmap.xml	Wed Jun 15 06:25:14 2016 -0400
+++ b/stacks_refmap.xml	Sat Jun 25 17:29:09 2016 -0400
@@ -1,4 +1,4 @@
-<tool id="stacks_refmap" name="Stacks: reference map" version="@WRAPPER_VERSION@.0">
+<tool id="stacks_refmap" name="Stacks: reference map" version="@WRAPPER_VERSION@.1">
     <description>the Stacks pipeline with a reference genome (ref_map.pl)</description>
     <macros>
         <import>macros.xml</import>
@@ -12,11 +12,11 @@
         #if str( $options_usage.rad_analysis_type ) == "genetic":
             #for $input_parent in $options_usage.parent_alignments:
                 #if $input_parent.ext == "sam":
-                    #set $data_path = splitext($input_parent.name)[0]
+                    #set $data_path = splitext($input_parent.element_identifier)[0]
                     #set $data_path = re.sub(r'\.1$', '', $data_path)
                     #set $data_path = $data_path + ".sam"
                 #else:
-                    #set $data_path = splitext($input_parent.name)[0]
+                    #set $data_path = splitext($input_parent.element_identifier)[0]
                     #set $data_path = re.sub(r'\.1$', '', $data_path)
                     #set $data_path = $data_path + ".bam"
                 #end if
@@ -26,27 +26,29 @@
 
             #for $input_progeny in $options_usage.progeny_alignments:
 
-                #if $input_progeny.ext == "sam":
-                    #set $data_path = splitext($input_progeny.name)[0]
-                    #set $data_path = re.sub(r'\.1$', '', $data_path)
-                    #set $data_path = $data_path + ".sam"
-                #else:
-                    #set $data_path = splitext($input_progeny.name)[0]
-                    #set $data_path = re.sub(r'\.1$', '', $data_path)
-                    #set $data_path = $data_path + ".bam"
+                #if $input_progeny:
+                    #if $input_progeny.ext == "sam":
+                        #set $data_path = splitext($input_progeny.element_identifier)[0]
+                        #set $data_path = re.sub(r'\.1$', '', $data_path)
+                        #set $data_path = $data_path + ".sam"
+                    #else:
+                        #set $data_path = splitext($input_progeny.element_identifier)[0]
+                        #set $data_path = re.sub(r'\.1$', '', $data_path)
+                        #set $data_path = $data_path + ".bam"
+                    #end if
+
+                    ln -s "${input_progeny}" "${data_path}" &&
                 #end if
-
-                ln -s "${input_progeny}" "${data_path}" &&
             #end for
         #else:
             #for $input_indiv in $options_usage.individual_sample:
 
                 #if $input_indiv.ext == "sam":
-                    #set $data_path = splitext($input_indiv.name)[0]
+                    #set $data_path = splitext($input_indiv.element_identifier)[0]
                     #set $data_path = re.sub(r'\.1$', '', $data_path)
                     #set $data_path = $data_path + ".sam"
                 #else:
-                    #set $data_path = splitext($input_indiv.name)[0]
+                    #set $data_path = splitext($input_indiv.element_identifier)[0]
                     #set $data_path = re.sub(r'\.1$', '', $data_path)
                     #set $data_path = $data_path + ".bam"
                 #end if
@@ -66,11 +68,11 @@
             #if str( $options_usage.rad_analysis_type ) == "genetic":
                 #for $input_parent in $options_usage.parent_alignments:
                     #if $input_parent.ext == "sam":
-                        #set $data_path = splitext($input_parent.name)[0]
+                        #set $data_path = splitext($input_parent.element_identifier)[0]
                         #set $data_path = re.sub(r'\.1$', '', $data_path)
                         #set $data_path = $data_path + ".sam"
                     #else:
-                        #set $data_path = splitext($input_parent.name)[0]
+                        #set $data_path = splitext($input_parent.element_identifier)[0]
                         #set $data_path = re.sub(r'\.1$', '', $data_path)
                         #set $data_path = $data_path + ".bam"
                     #end if
@@ -81,27 +83,29 @@
                 -A $options_usage.cross_type
 
                 #for $input_progeny in $options_usage.progeny_alignments:
-                    #if $input_progeny.ext == "sam":
-                        #set $data_path = splitext($input_progeny.name)[0]
-                        #set $data_path = re.sub(r'\.1$', '', $data_path)
-                        #set $data_path = $data_path + ".sam"
-                    #else:
-                        #set $data_path = splitext($input_progeny.name)[0]
-                        #set $data_path = re.sub(r'\.1$', '', $data_path)
-                        #set $data_path = $data_path + ".bam"
+                    #if $input_progeny:
+                        #if $input_progeny.ext == "sam":
+                            #set $data_path = splitext($input_progeny.element_identifier)[0]
+                            #set $data_path = re.sub(r'\.1$', '', $data_path)
+                            #set $data_path = $data_path + ".sam"
+                        #else:
+                            #set $data_path = splitext($input_progeny.element_identifier)[0]
+                            #set $data_path = re.sub(r'\.1$', '', $data_path)
+                            #set $data_path = $data_path + ".bam"
+                        #end if
+
+                        -r "${data_path}"
                     #end if
-
-                    -r "${data_path}"
                 #end for
             #else:
                 #for $input_indiv in $options_usage.individual_sample:
 
                     #if $input_indiv.ext == "sam":
-                        #set $data_path = splitext($input_indiv.name)[0]
+                        #set $data_path = splitext($input_indiv.element_identifier)[0]
                         #set $data_path = re.sub(r'\.1$', '', $data_path)
                         #set $data_path = $data_path + ".sam"
                     #else:
-                        #set $data_path = splitext($input_indiv.name)[0]
+                        #set $data_path = splitext($input_indiv.element_identifier)[0]
                         #set $data_path = re.sub(r'\.1$', '', $data_path)
                         #set $data_path = $data_path + ".bam"
                     #end if
@@ -140,7 +144,7 @@
             #end if
 
             ## If input is in bam format, stacks will output gzipped files (no option to control this)
-            && gunzip stacks_outputs/*.gz
+            && if ls stacks_outputs/*.gz > /dev/null 2>&1; then gunzip stacks_outputs/*.gz; fi
     ]]></command>
 
     <inputs>
@@ -150,15 +154,15 @@
                 <option value="population">Population</option>
             </param>
             <when value="genetic">
-                <param name="parent_alignments" format="sam,bam" type="data" multiple="true" label="Files containing parent alignments" argument="-p" />
-                <param name="progeny_alignments" format="sam,bam" type="data" multiple="true" optional="true" label="Files containing progeny alignments" argument="-r" />
+                <param name="parent_alignments" format="sam,bam" type="data" multiple="true" label="Files containing parent alignments" argument="-p" help="Dataset names will be used as sample name (no space allowed)." />
+                <param name="progeny_alignments" format="sam,bam" type="data" multiple="true" optional="true" label="Files containing progeny alignments" argument="-r" help="Dataset names will be used as sample name (no space allowed)." />
 
                 <param name="cross_type" argument="-A" type="select" label="Cross type">
                     <expand macro="cross_types"/>
                 </param>
             </when>
             <when value="population">
-                <param name="individual_sample" format="sam,bam" type="data" multiple="true" label="Files containing an individual sample from a population" argument="-s" />
+                <param name="individual_sample" format="sam,bam" type="data" multiple="true" label="Files containing an individual sample from a population" argument="-s" help="Dataset names will be used as sample name (no space allowed)." />
                 <param name="popmap" type="data" format="tabular,txt" label="Specify a population map" argument="-O" />
             </when>
         </conditional>
@@ -182,25 +186,25 @@
         <expand macro="populations_output_light"/>
 
         <collection name="tags" type="list" label="Assembled loci (tags) from ${on_string}">
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.tags)\.tsv" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.tags)\.tsv$" ext="tabular" directory="stacks_outputs" />
         </collection>
 
         <collection name="snps" type="list" label="Model calls (snps) from each locus on ${on_string}">
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.snps)\.tsv" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.snps)\.tsv$" ext="tabular" directory="stacks_outputs" />
         </collection>
 
         <collection name="alleles" type="list" label="Haplotypes (alleles) recorded from each locus on ${on_string}">
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.alleles)\.tsv" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.alleles)\.tsv$" ext="tabular" directory="stacks_outputs" />
         </collection>
 
         <collection name="matches" type="list" label="Matches to the catalog on ${on_string}">
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.matches)\.tsv" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.matches)\.tsv$" ext="tabular" directory="stacks_outputs" />
         </collection>
 
         <collection name="all_output" type="list" label="Full output from ref_map on ${on_string}">
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.(tags|snps|alleles|matches))\.tsv" ext="tabular" directory="stacks_outputs" />
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.(haplotypes|genotypes|markers|hapstats|sumstats|sumstats_summary))\.tsv" ext="tabular" directory="stacks_outputs" />
-            <discover_datasets pattern="(?P&lt;name&gt;.+\.(genotypes))\.(loc|txt)" ext="txt" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.(tags|snps|alleles|matches))\.tsv$" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.(haplotypes|genotypes|markers|hapstats|sumstats|sumstats_summary))\.tsv$" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.(genotypes))\.(loc|txt)$" ext="txt" directory="stacks_outputs" />
         </collection>
     </outputs>
 
@@ -208,6 +212,94 @@
         <test>
             <param name="options_usage|rad_analysis_type" value="genetic"/>
             <param name="options_usage|parent_alignments" value="refmap/PopA_01.bam" />
+            <output name="output_log">
+                <assert_contents>
+                    <has_text text="ref_map.pl completed" />
+                </assert_contents>
+            </output>
+
+            <!-- catalog -->
+            <output name="catalogsnps">
+                <assert_contents>
+                    <has_text text="catalog generated" />
+                </assert_contents>
+            </output>
+            <output name="catalogalleles">
+                <assert_contents>
+                    <has_text text="catalog generated" />
+                </assert_contents>
+            </output>
+            <output name="catalogtags">
+                <assert_contents>
+                    <has_text text="catalog generated" />
+                </assert_contents>
+            </output>
+
+            <!-- genotypes -->
+            <output name="out_generic_haplo">
+                <assert_contents>
+                    <has_text text="Catalog ID" />
+                </assert_contents>
+            </output>
+            <output name="out_sql_markers">
+                <assert_contents>
+                    <has_text text="Total Genotypes" />
+                </assert_contents>
+            </output>
+            <output name="out_joinmap">
+                <assert_contents>
+                    <has_text text="batch_1.genotypes_" />
+                </assert_contents>
+            </output>
+            <output name="out_sql_genotypes">
+                <assert_contents>
+                    <has_text text="SQL ID" />
+                </assert_contents>
+            </output>
+            <output name="out_generic_haplo">
+                <assert_contents>
+                    <has_text text="Seg Dist" />
+                </assert_contents>
+            </output>
+            <output name="out_sql_markers">
+                <assert_contents>
+                    <has_text text="Total Genotypes" />
+                </assert_contents>
+            </output>
+
+            <!-- samples -->
+            <output_collection name="tags">
+                <element name="PopA_01.tags">
+                    <assert_contents>
+                        <has_text text="generated on " />
+                    </assert_contents>
+                </element>
+            </output_collection>
+            <output_collection name="snps">
+                <element name="PopA_01.snps">
+                    <assert_contents>
+                        <has_text text="generated on " />
+                    </assert_contents>
+                </element>
+            </output_collection>
+            <output_collection name="alleles">
+                <element name="PopA_01.alleles">
+                    <assert_contents>
+                        <has_text text="generated on " />
+                    </assert_contents>
+                </element>
+            </output_collection>
+            <output_collection name="matches">
+                <element name="PopA_01.matches">
+                    <assert_contents>
+                        <has_text text="generated on " />
+                    </assert_contents>
+                </element>
+            </output_collection>
+        </test>
+        <test>
+            <param name="options_usage|rad_analysis_type" value="genetic"/>
+            <param name="options_usage|parent_alignments" value="refmap/PopA_01.bam" />
             <param name="options_usage|progeny_alignments" value="refmap/PopA_02.bam" />
             <output name="output_log">
                 <assert_contents>