diff stacks_ustacks.xml @ 0:7c5004f8cd49 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks commit f3a59c91c231cc1582479109e776d05602b7f24d-dirty
author iuc
date Tue, 14 Jun 2016 14:06:23 -0400
parents
children 216c469422d2
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stacks_ustacks.xml	Tue Jun 14 14:06:23 2016 -0400
@@ -0,0 +1,189 @@
+<tool id="stacks_ustacks" name="Stacks: ustacks" version="@WRAPPER_VERSION@.0">
+    <description>align short reads into stacks</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="stdio"/>
+    <command><![CDATA[
+        #from os.path import splitext
+        #import re
+
+        mkdir stacks_inputs stacks_outputs
+
+        &&
+
+        #if $sample.ext == "fastqsanger":
+            #set $data_path = splitext($sample.name)[0]
+            #set $data_path = re.sub(r'\.1$', '', $data_path)
+            #set $data_path = "stacks_inputs/" + $data_path + ".fq"
+            #set inputype = "fastq"
+        #else:
+            #set $data_path = splitext($sample.name)[0]
+            #set $data_path = re.sub(r'\.1$', '', $data_path)
+            #set $data_path = "stacks_inputs/" + $data_path + ".fa"
+            #set inputype = "fasta"
+        #end if
+
+        ln -s "${sample}" "${data_path}"
+
+        &&
+
+        ustacks
+
+            -p \${GALAXY_SLOTS:-1}
+
+            -f $data_path
+
+            -t $inputype
+
+            ## Batch description
+            -i $sample_id
+
+            -m $m
+            -M $M
+            $R
+            $H
+
+            ## Assembly
+            $assembly_options.r
+            $assembly_options.d
+            --max_locus_stacks $assembly_options.max_locus_stacks
+            #if str($assembly_options.k_len):
+                --k_len $assembly_options.k_len
+            #end if
+
+            #if $gapped.use_gapped:
+                --gapped
+                --max_gaps $gapped.max_gaps
+                --min_aln_len $gapped.min_aln_len
+            #end if
+
+            ## snp_model
+            #if str( $snp_options.select_model.model_type) == "bounded":
+                --model_type bounded
+                --bound_low $snp_options.select_model.bound_low
+                --bound_high $snp_options.select_model.bound_high
+                --alpha $snp_options.select_model.alpha
+            #else if str( $snp_options.select_model.model_type) == "snp":
+                --model_type snp
+                --alpha $snp_options.select_model.alpha
+            #else
+                --model_type fixed
+                --bc_err_freq $bc_err_freq
+            #end if
+
+            -o stacks_outputs
+    ]]></command>
+
+    <inputs>
+        <param name="sample" argument="-f" format="fastqsanger,fasta" type="data" label="Input short reads from an individual" />
+
+        <param name="sample_id" argument="-i" type="integer" value="" label="Give a unique numeric ID to this sample"/>
+
+        <param name="m" argument="-m" type="integer" value="2" label="Minimum depth of coverage required to create a stack"/>
+        <param name="M" argument="-M" type="integer" value="2" label="Maximum distance (in nucleotides) allowed between stacks"/>
+        <param name="R" argument="-R" type="boolean" checked="false" truevalue="-R" falsevalue="" label="Retain unused reads" />
+        <param name="H" 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 name="r" argument="-r" type="boolean" checked="false" truevalue="-r" falsevalue="" label="Enable the Removal algorithm, to drop highly-repetitive stacks (and nearby errors) from the algorithm" />
+            <param name="d" argument="-d" type="boolean" checked="false" truevalue="-d" falsevalue="" label="Enable the Deleveraging algorithm, used for resolving over merged tags" />
+            <param name="max_locus_stacks" argument="--max_locus_stacks" type="integer" value="3" label="Maximum number of stacks at a single de novo locus"/>
+            <param name="k_len" argument="--k_len" type="integer" value="" optional="true" label="K-mer size for matching between alleles and loci (automatically calculated by default)"/>
+        </section>
+
+        <conditional name="gapped">
+            <param name="use_gapped" argument="--gapped" type="boolean" checked="false" label="Perform gapped alignments between stacks" />
+            <when value="false"></when>
+            <when value="true">
+                <param name="max_gaps" argument="--max_gaps" type="integer" value="2" label="Number of gaps allowed between stacks before merging"/>
+                <param name="min_aln_len" argument="--min_aln_len" type="float" value="0.8" min="0.0" max="1.0" label="Minimum length of aligned sequence in a gapped alignment"/>
+            </when>
+        </conditional>
+
+        <!-- SNP Model options -->
+        <section name="snp_options" title="SNP Model Options (ustacks options)" expanded="False">
+            <expand macro="snp_options_full"/>
+        </section>
+    </inputs>
+
+    <outputs>
+        <collection name="tabs" type="list" label="Stacks from ${on_string}">
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.tags)\.tsv" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.snps)\.tsv" ext="tabular" directory="stacks_outputs" />>
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.alleles)\.tsv" ext="tabular" directory="stacks_outputs" />
+            <discover_datasets pattern="(?P&lt;name&gt;.+\.models)\.tsv" ext="tabular" directory="stacks_outputs" />
+        </collection>
+    </outputs>
+
+    <tests>
+        <test>
+            <param name="sample" value="demultiplexed/PopA_01.1.fq" ftype="fastqsanger" />
+            <param name="sample_id" value="4" />
+
+            <output_collection name="tabs">
+                <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_01.models">
+                    <assert_contents>
+                        <has_text text="generated on " />
+                    </assert_contents>
+                </element>
+            </output_collection>
+        </test>
+    </tests>
+
+    <help>
+<![CDATA[
+.. class:: infomark
+
+**What it does**
+
+The unique stacks program will take as input a set of short-read sequences and align them into exactly-matching stacks. Comparing the stacks it will form a set of loci and detect SNPs at each locus using a maximum likelihood framework
+
+--------
+
+**Input files**
+
+FASTQ, FASTA
+
+**Output files**
+
+- XXX.tags.tsv file:
+
+See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
+
+Notes: For the tags file, each stack will start in the file with a consensus sequence for the entire stack followed by the flags for that stack. Then, each individual read that was merged into that stack will follow. The next stack will start with another consensus sequence.
+
+
+- XXX.snps.tsv file:
+
+See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
+
+Notes: If a stack has two SNPs called within it, then there will be two lines in this file listing each one.
+
+
+- XXX.alleles.tsv file:
+
+See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_
+
+@STACKS_INFOS@
+]]>
+    </help>
+    <expand macro="citation" />
+</tool>
+