view merge.groups.xml @ 1:e7aa450e9d86 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit 721531d2e9fd1e208a3fba8cfbe5dcd572599ca2
author iuc
date Tue, 05 Sep 2017 17:01:08 -0400
parents 4170555c36c1
children 0efffd5559c6
line wrap: on
line source

<tool profile="16.07" id="mothur_merge_groups" name="Merge.groups" version="@WRAPPER_VERSION@.0">
    <description>Merge groups in a shared file</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
        @SHELL_OPTIONS@

        ## create symlinks to input datasets
        ln -s "$otu" otu.dat &&
        ln -s "$group" group.dat &&
        #if $design.source == "hist":
            ln -s "$design.design_dataset" design_dataset.dat &&
        #else:
            ln -s "$generated_design" generated_design.dat &&
        #end if

        echo 'merge.groups(
            #if $design.source == "hist":
                design=design_dataset.dat
            #else:
                design=generated_design.dat
            #end if
            #if $otu:
                ,shared=otu.dat
            #end if
            #if $group:
                ,group=group.dat
            #end if
            #if $groups:
                ,groups=${ str($groups).replace(",","-") }
            #end if
            #if $label:
                ,label=${ str($label).replace(",","-") }
            #end if
        )'
        | sed 's/ //g'  ## mothur trips over whitespace
        | mothur
        | tee mothur.out.log
    ]]></command>
    <configfiles>
        <configfile name="generated_design"><![CDATA[
            #if $design.source == 'build':
                #for $grouping in $design.groupings:
                    #set grp_str = $grouping.groups.__str__
                    #if grp_str != None and len(grp_str) > 0:
                        #for $grp in grp_str.split(','):
                            $grp	$grouping.name
                        #end for
                    #end if
                #end for
            #end if
        ]]></configfile>
    </configfiles>
    <inputs>
        <param name="otu" type="data" format="mothur.shared" optional="true" label="shared - OTU Shared Dataset"/>
        <param name="label" type="select" label="label - Pick OTU Labels to include" optional="true" multiple="true">
            <expand macro="labeloptions"/>
        </param>
        <param name="group" type="data" format="mothur.groups" optional="true" label="group - Group Dataset"/>
        <param name="groups" type="select" optional="true" label="groups - Pick groups to include" multiple="true">
            <options>
                <filter type="data_meta" ref="otu" key="groups"/>
            </options>
        </param>
        <conditional name="design">
            <param name="source" type="select" label="Grouping Design from" help="">
                <option value="hist">Your History</option>
                <option value="build">Build a grouping design</option>
            </param>
            <when value="hist">
                <param name="design_dataset" type="data" format="tabular" label="design - assign groups to new grouping" help="design has 2 columns: group(col 1) and grouping(col 2) (separated by a TAB character)"/>
            </when>
            <when value="build">
                <repeat name="groupings" title="Grouping">
                    <param name="name" type="text" label="Name for a new combined grouping"/>
                    <param name="groups" type="select" multiple="true" label="Select groups for to include in this grouping">
                        <options>
                            <filter type="data_meta" ref="otu" key="groups"/>
                        </options>
                    </param>
                </repeat>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <expand macro="logfile-output"/>
        <data name="merged_shared" format="mothur.shared" from_work_dir="otu*.merge.*" label="${tool.name} on ${on_string}: merge.shared">
            <filter>otu</filter>
        </data>
        <data name="merged_group" format="mothur.groups" from_work_dir="group*.merge.*" label="${tool.name} on ${on_string}: merge.groups">
            <filter>group</filter>
        </data>
    </outputs>
    <tests>
        <test><!-- test with shared file -->
            <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/>
            <param name="source" value="hist"/>
            <param name="design_dataset" value="toymothur.design2"/>
            <output name="merged_shared" md5="60f9e715c948911a61986bf1d1db7747" ftype="mothur.shared"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with shared file and label and group select -->
            <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/>
            <param name="label" value="0.05,0.22,0.38"/>
            <param name="groups" value="forest,pasture"/>
            <param name="source" value="hist"/>
            <param name="design_dataset" value="toymothur.design2"/>
            <output name="merged_shared" md5="11818d535bf88938dc063afca3f95b23" ftype="mothur.shared"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with group file -->
            <param name="group" value="amazon.groups" ftype="mothur.groups"/>
            <param name="source" value="hist"/>
            <param name="design_dataset" value="toymothur.design2"/>
            <output name="merged_group" md5="023ebd0668522e9531da5b061e6e9137" ftype="mothur.groups"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with design creation -->
            <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/>
            <param name="source" value="build"/>
            <repeat name="groupings">
                <param name="name" value="tardis"/>
                <param name="groups" value="forest"/>
            </repeat>
            <repeat name="groupings">
                <param name="name" value="dalek"/>
                <param name="groups" value="pasture"/>
            </repeat>
            <output name="merged_shared" md5="60f9e715c948911a61986bf1d1db7747" ftype="mothur.shared"/>
            <expand macro="logfile-test"/>
        </test>
    </tests>
    <help>
<![CDATA[

@MOTHUR_OVERVIEW@

**Command Documentation**

The merge.groups_ command reads a shared_ file and a design file and merges the groups in the shared file that are in the same grouping in the design file.

A design file partitions a list of names into groups.  It is a tab-delimited file with 2 columns: name and group, e.g. :
                                ======= =======
                                duck    bird
                                cow     mammal
                                pig     mammal
                                goose   bird
                                cobra   reptile
                                ======= =======

The Make_Design tool can construct a design file from a Mothur dataset that contains group names.

.. _shared: https://www.mothur.org/wiki/Shared_file
.. _merge.groups: https://www.mothur.org/wiki/Merge.groups
]]>
    </help>
    <expand macro="citations"/>
</tool>