view mothur/tools/mothur/merge.groups.xml @ 25:bfbaf823be4c

Change metagenomics datatypes to include labels and groups metadata. change Mothur tool configs to get label and group select options from a data_meta filter rather than using the options from_dataset attribute. This grealty decreases memory demand for the galaxy server.
author Jim Johnson <jj@umn.edu>
date Wed, 16 May 2012 12:28:44 -0500
parents 09740be2bc9c
children 49058b1f8d3f
line wrap: on
line source

<tool id="mothur_merge_groups" name="Merge.groups" version="1.24.0" >
 <description>Merge groups in a shared file</description>
 <command interpreter="python">
  mothur_wrapper.py 
  --cmd='merge.groups'
  ## 98_sq_phylip_amazon.fn.merge.shared
  #set results = ["'^mothur.\S+\.logfile$:'" + $logfile.__str__]
  --outputdir='$logfile.extra_files_path'
  #if $otu.__str__ != "None" and len($otu.__str__) > 0:
   --shared=$otu
   #set results = $results + ["'" + $re.sub(r'(^.*)\.(.*?)',r'\1.merge.\2',$os.path.basename($otu.__str__)) + ":'" + $merge_shared.__str__]
  #end if
  #if $group.__str__ != "None" and len($group.__str__) > 0:
   --group=$group
   #set results = $results + ["'" + $re.sub(r'(^.*)\.(.*?)',r'\1.merge.\2',$os.path.basename($group.__str__)) + ":'" + $merge_group.__str__]
  #end if
  #if $design.source == 'hist':
   --design=$design_dataset
  #else:
   --design=$generated_design
  #end if
  #if $groups.__str__ != "None" and len($groups.__str__) > 0:
   --groups=$groups
  #end if
  #if $label.__str__ != "None" and len($label.__str__) > 0:
   --label='$label'
  #end if
  --result=#echo ','.join($results)
 </command>
 <inputs>
  <param name="otu" type="data" format="shared" optional="true" label="shared - OTU Shared Dataset"/>
  <param name="group" type="data" format="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>
  <param name="label" type="select" label="label - Pick OTU Labels to include" optional="true" multiple="true">
   <options>
    <filter type="data_meta" ref="otu" key="labels" />
   </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> <!-- design -->
 </inputs>
 <configfiles>
  <configfile name="generated_design">
#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>
 <outputs>
  <data format="html" name="logfile" label="${tool.name} on ${on_string}: logfile" />
  <data format="shared" name="merged_shared" label="${tool.name} on ${on_string}: merge.shared" >
    <filter>otu != None</filter>
  </data>
  <data format="groups" name="merged_group" label="${tool.name} on ${on_string}: merge.groups" >
    <filter>groups != None</filter>
  </data>
 </outputs>
 <requirements>
  <requirement type="binary">mothur</requirement>
 </requirements>
 <tests>
 </tests>
 <help>
**Mothur Overview**

Mothur_, initiated by Dr. Patrick Schloss and his software development team
in the Department of Microbiology and Immunology at The University of Michigan,
provides bioinformatics for the microbial ecology community.

.. _Mothur: http://www.mothur.org/wiki/Main_Page

**Command Documenation**

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: http://www.mothur.org/wiki/Shared_file
.. _merge.groups: http://www.mothur.org/wiki/Merge.groups

 </help>
</tool>