view tools/mothur/remove.groups.xml @ 0:ee4fee239fe7 draft default tip

planemo upload commit 68a4fd4cc5332c57ac39bef73db224425af0706c-dirty
author sanbi-uwc
date Fri, 03 Jun 2016 09:32:47 -0400
parents
children
line wrap: on
line source

<tool profile="16.07" id="mothur_remove_groups" name="Remove.groups" version="@WRAPPER_VERSION@.0">
    <description>Remove groups from groups,fasta,names,list,taxonomy</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="aggressive"><![CDATA[
        echo 'remove.groups(
            #if $groupnames.source == "other":
                #if $group_in.is_of_type("mothur.groups"):
                    group=$groupnames.group_in
                #else
                    count=$groupnames.group_in
                #end if
                #if $groupnames.fasta_in:
                    ,fasta=$groupnames.fasta_in
                #end if
                #if $groupnames.name_in:
                    ,name=$groupnames.name_in
                #end if
                #if $groupnames.list_in:
                    ,list=$groupnames.list_in
                #end if
                #if $groupnames.taxonomy_in:
                    ,taxonomy=$groupnames.taxonomy_in
                #end if
            #else
                shared=$groupnames.shared_in
            #end if
            ,groups=${ str($groupnames.groups).replace(",","-") }
        )'
        | sed 's/ //g'  ## mothur trips over whitespace
        | mothur &&

        ## move output files to correct destination
        #if $groupnames.source == "shared":
            prefix="$groupnames.shared_in" &&
            mv \${prefix%.dat}*.pick.* . &&
        #else
            prefix="$groupnames.group_in" &&
            mv \${prefix%.dat}*.pick.* "$group_out" &&
            #if $groupnames.fasta_in:
                prefix="$groupnames.fasta_in" &&
                mv \${prefix%.dat}*.pick.* "$fasta_out" &&
            #end if
            #if $groupnames.name_in:
                prefix="$groupnames.name_in" &&
                mv \${prefix%.dat}*.pick.* "$name_out" &&
            #end if
            #if $groupnames.taxonomy_in:
                prefix="$groupnames.taxonomy_in" &&
                mv \${prefix%.dat}*.pick.* "$taxonomy_out" &&
            #end if
            #if $groupnames.list_in:
                prefix="$groupnames.list_in" &&
                mv \${prefix%.dat}*.pick.* . &&
            #end if
        #end if
        mv mothur.*.logfile "$logfile"
    ]]></command>
    <inputs>
        <conditional name="groupnames">
            <param name="source" type="select" label="Select Input Type">
                <option value="shared">shared file</option>
                <option value="other">fasta, name, taxonomy, or list with a group file or count table</option>
            </param>
            <when value="other">
                <param name="group_in" type="data" format="mothur.groups,mothur.count_table" label="group or count table - Groups"/>
                <param name="groups" type="select" label="groups - Pick groups to remove" multiple="true" optional="false">
                    <options>
                        <filter type="data_meta" ref="group_in" key="groups"/>
                    </options>
                </param>
                <param name="fasta_in" type="data" format="fasta" optional="true" label="fasta - Fasta Sequences"/>
                <param name="name_in" type="data" format="mothur.names" optional="true" label="name - Sequences Name reference"/>
                <param name="list_in" type="data" format="mothur.list" optional="true" label="list - OTU List"/>
                <param name="taxonomy_in" type="data" format="mothur.seq.taxonomy" optional="true" label="taxonomy - Taxonomy"/>
            </when>
            <when value="shared">
                <param name="shared_in" type="data" format="mothur.shared" optional="true" label="shared - OTU Shared"/>
                <param name="groups" type="select" label="groups - Pick groups to remove" multiple="true" optional="false">
                    <options>
                        <filter type="data_meta" ref="shared_in" key="groups"/>
                    </options>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="logfile" format="txt" label="${tool.name} on ${on_string}: logfile"/>
        <data name="fasta_out" format_source="fasta_in" label="${tool.name} on ${on_string}: pick.fasta">
            <filter>groupname['source'] == 'other' and fasta_in</filter>
        </data>
        <data name="group_out" format="mothur.groups" label="${tool.name} on ${on_string}: pick.groups">
            <filter>groupname['source'] == 'other' and group_in</filter>
        </data>
        <data name="name_out" format="mothur.names" label="${tool.name} on ${on_string}: pick.names">
            <filter>groupname['source'] == 'other' and name_in</filter>
        </data>
        <data name="taxonomy_out" format="mothur.seq.taxonomy" label="${tool.name} on ${on_string}: pick.taxonomy">
            <filter>groupname['source'] == 'other' and taxonomy_in</filter>
        </data>
        <collection name="list_out" type="list" label="${tool.name} on ${on_string}: pick.list">
            <filter>groupname['source'] == 'other' and list_in</filter>
            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.pick\.dat" format="mothur.list"/>
        </collection>
        <collection name="shared_out" type="list" label="${tool.name} on ${on_string}: pick.shared">
            <filter>groupname['source'] == 'shared'</filter>
            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.pick\.dat" format="mothur.shared"/>
        </collection>
    </outputs>
    <tests>
        <test><!-- test with shared file -->
            <param name="source" value="shared"/>
            <param name="shared_in" value="amazon.an.shared"/>
            <param name="groups" value="pasture"/>
            <output_collection name="shared_out" count="36">
                <element name="0.26" md5="c5043237225f0292ce1bfbd2766b96ea" ftype="mothur.shared"/>
            </output_collection>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with group file and fasta/names/list/taxonomy files -->
            <param name="source" value="other"/>
            <param name="group_in" value="amazon.groups" ftype="mothur.groups"/>
            <param name="fasta_in" value="amazon.fasta" ftype="fasta"/>
            <param name="name_in" value="amazon.names" ftype="mothur.names"/>
            <param name="list_in" value="amazon.an.list" ftype="mothur.list"/>
            <param name="taxonomy_in" value="amazon.wang.wang.taxonomy" ftype="mothur.seq.taxonomy"/>
            <param name="groups" value="pasture"/>
            <output name="fasta_out" md5="f0e662d1d82e96b4977864925493dbf5" ftype="fasta"/>
            <output name="taxonomy_out" md5="8fcaadcb5ad40873e270ad7e2cebe7fa" ftype="mothur.seq.taxonomy"/>
            <output name="group_out" md5="6d689ead98f3eb1af41f1a78386d0b50" ftype="mothur.groups"/>
            <output name="name_out" md5="55dbcadbb414d95bae8a282a93c10e63" ftype="mothur.names"/>
            <output_collection name="list_out" count="36">
                <element name="0.26" md5="71282909924de5f43452f1a5dbf623e8" ftype="mothur.list"/>
            </output_collection>
            <expand macro="logfile-test"/>
        </test>
    </tests>
    <help><![CDATA[

@MOTHUR_OVERVIEW@

**Command Documenation**

The remove.groups_ command removes sequences from a specific group or set of groups from the following file types: fasta, name_, group_, list_, taxonomy_.

.. _name: http://www.mothur.org/wiki/Name_file
.. _group: http://www.mothur.org/wiki/Group_file
.. _list: http://www.mothur.org/wiki/List_file
.. _taxonomy: http://www.mothur.org/wiki/Taxonomy_outline
.. _remove.groups: http://www.mothur.org/wiki/Remove.groups

]]>
    </help>
    <expand macro="citations"/>
</tool>