view make.shared.xml @ 11:d0967ae326be draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit 7599ef16dc8b83ee49236ed5bb229260c969b0ab
author iuc
date Mon, 17 Jun 2024 12:09:48 +0000
parents 4ad0836d0ade
children
line wrap: on
line source

<tool profile="16.07" id="mothur_make_shared" name="Make.shared" version="@WRAPPER_VERSION@.0">
    <description>Make a shared file from a list and a group</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="biotools"/>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
@SHELL_OPTIONS@

## create symlinks to input datasets
ln -s '$intype.otu' intype_otu.dat &&
#if $intype.infile == "otulist":
    ln -s '$intype.group' intype_group.dat &&
#end if

echo 'make.shared(
    #if $intype.infile == "biom":
        biom=intype_otu.dat
    #else
        #if $intype.group.is_of_type("mothur.groups"):
            group=intype_group.dat,
        #elif $intype.group.is_of_type("mothur.count_table"):
            count=intype_group.dat,
        #end if
        #if $intype.label:
            label=${ str($intype.label).replace(",","-") },
        #end if
        #if $intype.groups:
            groups=${ str($intype.groups).replace(",","-") },
        #end if
        list=intype_otu.dat
    #end if
)'
| sed 's/ //g'  ## mothur trips over whitespace
| mothur
| tee mothur.out.log &&

## move output files to correct destination
mv mothur.*.logfile "$logfile" &&
#if $intype.infile == 'otulist' and $intype.groups:
    mv intype_otu*.groups "$groupout"
#else
    mv intype_otu*.shared "$shared"
#end if
    ]]></command>
    <inputs>
        <conditional name="intype">
            <param name="infile" type="select" label="Select input type" help="">
                <option value="otulist">OTU list</option>
                <option value="biom">Biom 1.0 file</option>
            </param>
            <when value="otulist">
                <param name="otu" type="data" format="mothur.list" label="list - OTU List"/>
                <param name="group" type="data" format="mothur.groups,mothur.count_table" label="supply group or count table if you supplied OTU list"/>
                <param name="label" type="select" optional="true" label="label - Select OTU Labels to include" multiple="true" help="By default all are included if no selection is made.">
                    <expand macro="labeloptions"/>
                </param>
                <param name="groups" type="select" multiple="true" label="groups - Groups to include">
                    <options>
                        <filter type="data_meta" ref="group" key="groups"/>
                    </options>
                </param>
            </when>
            <when value="biom">
                <param name="otu" type="data" format="biom1" label="Biom 1.0 file"/>
            </when>
        </conditional>
        <expand macro="param-savelog"/>
    </inputs>
    <outputs>
        <expand macro="logfile-output"/>
        <data name="shared" format="mothur.shared" from_work_dir="intype_otu*.shared" label="${tool.name} on ${on_string}: shared"/>
        <data name="groupout" format="mothur.groups" from_work_dir="intype_otu*.groups" label="${tool.name} on ${on_string}: groups">
            <filter>intype['group'].ext == "mothur.groups"</filter>
        </data>
        <collection name="labelshares" type="list" label="${tool.name} on ${on_string}: share files per label">
            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.shared" format="mothur.shared"/>
            <filter>intype['groups']</filter>
        </collection>
    </outputs>
    <tests>
        <test><!-- test with biom file -->
            <param name="infile" value="biom"/>
            <param name="otu" value="example.biom"/>
            <output name="shared" md5="e44d5ca4e4a5dbc68e8219c5690aa156" ftype="mothur.shared"/>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with otu and group file-->
            <param name="infile" value="otulist"/>
            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
            <param name="group" value="amazon.groups" ftype="mothur.groups"/>
            <output name="shared" file="amazon.an.shared" ftype="mothur.shared"/>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with label and group select-->
            <param name="infile" value="otulist"/>
            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
            <param name="group" value="amazon.groups" ftype="mothur.groups"/>
            <param name="label" value="0.03,0.05,0.22"/>
            <param name="groups" value="forest,pasture"/>
            <output name="groupout" md5="fb60628ae445e7b06f9833f632b2cd0c" ftype="mothur.groups"/>
            <output_collection name="labelshares" count="3">
                <element name="0.22" md5="592b4fb84412de47be18e64ef26b7a80" ftype="mothur.shared"/>
            </output_collection>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
    </tests>
    <help><![CDATA[

@MOTHUR_OVERVIEW@

**Command Documentation**

The make.shared_ command takes a list_ and a group_ file and outputs a shared_ file, as well as a rabund_ file for each group.


.. _list: https://www.mothur.org/wiki/List_file
.. _group: https://www.mothur.org/wiki/Group_file
.. _shared: https://www.mothur.org/wiki/Shared_file
.. _rabund: https://www.mothur.org/wiki/Rabund_file
.. _make.shared: https://www.mothur.org/wiki/Make.shared

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