view stacks_cstacks.xml @ 0:da351b9031de draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit b395fa36fa826e26085820ba3a9faacaeddcb460
author iuc
date Mon, 01 Jul 2019 11:03:59 -0400
parents
children fcce77c09289
line wrap: on
line source

<tool id="stacks2_cstacks" name="Stacks2: cstacks" profile="@PROFILE@" version="@STACKS_VERSION@+galaxy@WRAPPER_VERSION@">
    <description>Generate catalog of loci</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_cmd"/>
    <command detect_errors="aggressive"><![CDATA[
#import re

mkdir stacks_inputs stacks_outputs
&&

@LINK_STACKS_INPUT@

cstacks

-p \${GALAXY_SLOTS:-1}

#if $popmap
    -P stacks_inputs
    -M '$popmap'
#else
    #for $sample in $samples
        -s 'stacks_inputs/$sample'
    #end for
    -o stacks_outputs
#end if

-n $n
## -c not implemented in Galaxy (appending can be done in Galaxy)

@GAP_OPTIONS@

## Advanced Options
#if $k_len:
    --k_len $k_len
#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 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" />
        <expand macro="in_log"/>
    </inputs>

    <outputs>
        <expand macro="out_log"/>
        <expand macro="cstacks_outputs_macro"/>
    </outputs>

    <tests>
        <!-- test w default options + popmap -->
        <test>
            <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" />
               </collection>
            </param>
            <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv" />
            <param name="add_log" value="yes" />
            <output name="output_log" ftype="txt" file="cstacks/cstacks.log"/>
            <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" />
            </output_collection>
        </test>
        <!-- test w default options -->
        <test>
            <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" />
               </collection>
            </param>
            <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" />
            </output_collection>
        </test>
        <!-- test w non default options (wo gapped, because tested already in ustacks) -->
        <test>
            <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" />
               </collection>
            </param>
            <param name="n" value="2"/>
            <param name="k_len" value="23"/>
            <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" />
            </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" />
            </output_collection>
        </test>
    </tests>
    <help>
<![CDATA[
.. class:: infomark

**What it does**

A catalog can be built from any set of samples processed by ustacks. It will create a set of consensus loci, merging alleles together. In the case of a genetic cross, a catalog would be constructed from the parents of the cross to create a set of all possible alleles expected in the progeny of the cross.

--------

**Input files**

Output from denovo_map or ustacks

**Output files**

- catalog.tags 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.


- catalog.snps 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.


- catalog.alleles file:

See `Stacks output description <http://catchenlab.life.illinois.edu/stacks/manual/#files>`_

@STACKS_INFOS@
]]>
    </help>
    <expand macro="citation" />
</tool>