view stacks_sstacks.xml @ 7:a819ec3b362d draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit feda4e2ea70c013fcddd1dbdeab73158fe9c86a4
author iuc
date Mon, 23 May 2022 17:55:08 +0000
parents 9586f08634c0
children
line wrap: on
line source

<tool id="stacks2_sstacks" name="Stacks2: sstacks" profile="@PROFILE@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>Match samples to the catalog</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_cmd"/>
    <command detect_errors="aggressive"><![CDATA[
#import re

trap ">&2 cat '$output_log'" err exit &&
mkdir stacks_inputs stacks_outputs &&

@LINK_STACKS_INPUT@
@LINK_CAT_INPUT@

sstacks

-p \${GALAXY_SLOTS:-1}

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

$x

@GAP_OPTIONS_ONOFF@
@TEE_APPEND_LOG@

#if $popmap
    ## When using a popmap, stacks write to the input dir
    && mv stacks_inputs/*matches.tsv stacks_outputs/
#end if
    ]]></command>

    <inputs>
        <expand macro="input_stacks_macro"/>
        <expand macro="input_cat_macro"/>
        <param name="popmap" type="data" format="tabular,txt" label="Population map" help="If set, matching will be done only for samples listed in this file" optional="true" argument="-M"/>
        <param argument="-x" type="boolean" checked="true" truevalue="" falsevalue="-x" label="Verify haplotype of matching locus"/>
        <expand macro="gap_options_onoff"/>
        <expand macro="in_log"/>
    </inputs>

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

    <tests>
        <!-- test w default parameters and popmap -->
        <test expect_num_outputs="2">
            <param name="input_cat">
                <collection type="list">
                    <element name="catalog.alleles" ftype="tabular" value="cstacks/catalog.alleles.tsv"/>
                    <element name="catalog.snps" ftype="tabular" value="cstacks/catalog.snps.tsv"/>
                    <element name="catalog.tags" ftype="tabular" value="cstacks/catalog.tags.tsv"/>
               </collection>
            </param>
            <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"/>
            <assert_command>
                <not_has_text text="-x"/>
                <not_has_text text="--disable-gapped"/>
                <has_text text="-M"/>
            </assert_command>
            <output name="output_log" ftype="txt" file="sstacks/sstacks.log"/>
            <output_collection name="matches" type="list">
                <element name="PopA_01.matches" file="sstacks/PopA_01.matches.tsv" ftype="tabular" lines_diff="4"/>
                <element name="PopA_02.matches" file="sstacks/PopA_02.matches.tsv" ftype="tabular" lines_diff="4"/>
            </output_collection>
        </test>
        <!-- test w default parameters -->
        <test expect_num_outputs="2">
            <param name="input_cat">
                <collection type="list">
                    <element name="catalog.alleles" ftype="tabular" value="cstacks/catalog.alleles.tsv"/>
                    <element name="catalog.snps" ftype="tabular" value="cstacks/catalog.snps.tsv"/>
                    <element name="catalog.tags" ftype="tabular" value="cstacks/catalog.tags.tsv"/>
               </collection>
            </param>
            <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"/>
            <assert_command>
                <not_has_text text="-x"/>
                <not_has_text text="--disable-gapped"/>
                <not_has_text text="-M"/>
            </assert_command>
            <output name="output_log" ftype="txt"><assert_contents><has_text text="done."/></assert_contents></output>
            <output_collection name="matches" type="list" count="2">
                <expand macro="test_element_stacks_completed" element_name="PopA_01.matches" />
                <expand macro="test_element_stacks_completed" element_name="PopA_02.matches" />
            </output_collection>
        </test>

        <!-- test w non default parameters and popmap-->
        <test expect_num_outputs="1">
            <param name="input_cat">
                <collection type="list">
                    <element name="catalog.alleles" ftype="tabular" value="cstacks/catalog.alleles.tsv"/>
                    <element name="catalog.snps" ftype="tabular" value="cstacks/catalog.snps.tsv"/>
                    <element name="catalog.tags" ftype="tabular" value="cstacks/catalog.tags.tsv"/>
               </collection>
            </param>
            <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="gapped|use_gapped" value="yes"/>
            <param name="x" value="-x"/>
            <param name="popmap" ftype="tabular" value="denovo_map/popmap_cstacks.tsv"/>
            <param name="add_log" value="no"/>
            <assert_command>
                <has_text text="-x"/>
                <not_has_text text="--disable-gapped"/>
                <has_text text="-M"/>
            </assert_command>
            <assert_stderr><has_text text="done."/></assert_stderr>
            <output_collection name="matches" type="list" count="2">
                <expand macro="test_element_stacks_completed" element_name="PopA_01.matches" />
                <expand macro="test_element_stacks_completed" element_name="PopA_02.matches" />
            </output_collection>
        </test>
    </tests>

    <help>
<![CDATA[
.. class:: infomark

**What it does**

Sets of stacks constructed by ustacks can be searched against a catalog produced by cstacks. In the case of a genetic map, stacks from the progeny would be matched against the catalog to determine which progeny contain which parental alleles.

--------

**Input files**

Output from denovo_map, refmap or cstacks/ustack

**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>`_

- XXX.matches.tsv file:

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

Notes: Each line in this file records a match between a catalog locus and a locus in an individual, for a particular haplotype. The Batch ID plus the Catalog ID together represent a unique locus in the entire population, while the Sample ID and the Stack ID together represent a unique locus in an individual sample.

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