diff tools/mothur/get.oturep.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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/mothur/get.oturep.xml	Fri Jun 03 09:32:47 2016 -0400
@@ -0,0 +1,202 @@
+<tool profile="16.07" id="mothur_get_oturep" name="Get.oturep" version="@WRAPPER_VERSION@.0">
+    <description>Generate a fasta with a representative sequence for each OTU</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="version_command"/>
+    <command detect_errors="aggressive"><![CDATA[
+        echo 'get.oturep(
+            list=$otu,
+            #if $fasta:
+                fasta=$fasta,
+            #end if
+            #if $input.source == "column":
+                column=$input.dist,
+                name=$input.name,
+            #elif $input.source == "phylip":
+                phylip=$input.dist,
+                #if $input.name:
+                    name=$input.name,
+                #end if
+            #end if
+            #if $label:
+                label=${ str($label).replace(",","-") },
+            #end if
+            #if $pick.type == "yes":
+                #if $pick.group:
+                    group=$pick.group,
+                #end if
+                #if $pick.groups:
+                    groups=${ str($pick.groups).replace(",","-") },
+                #end if
+            #end if
+            #if $sorted:
+                sorted=$sorted,
+            #end if
+            #if $count and not $input.name:
+                count=$count,
+            #end if
+            method=$method,
+            large=$large
+        )'
+        | sed 's/ //g'  ## mothur trips over whitespace
+        | mothur &&
+
+        ## move output files to correct destination
+        prefix="$otu" &&
+        #if $fasta:
+            mv \${prefix%.dat}*.rep.fasta . &&
+        #end if
+        #if $count and not $input.name:
+            mv \${prefix%.dat}*.rep.count_table . &&
+        #else
+            mv \${prefix%.dat}*.rep.names . &&
+        #end if
+        mv mothur.*.logfile "$logfile"
+    ]]></command>
+    <inputs>
+        <param name="otu" type="data" format="mothur.list" label="list - OTU List"/>
+        <conditional name="input">
+            <param name="source" type="select" label="Distance Matrix Format">
+                <option value="column">Pairwise Column Distance Matrix</option>
+                <option value="phylip">Phylip Distance Matrix</option>
+            </param>
+            <when value="column">
+                <param name="dist" type="data" format="mothur.pair.dist" label="column - Distance Matrix"/>
+                <param name="name" type="data" format="mothur.names" label="name - Sequences Name reference"/>
+            </when>
+            <when value="phylip">
+                <param name="dist" type="data" format="mothur.lower.dist,mothur.square.dist" label="phylip - Distance Matrix"/>
+                <param name="name" type="data" format="mothur.names" optional="true" label="name - Names"/>
+            </when>
+        </conditional>
+        <param name="fasta" type="data" format="fasta" optional="true" label="fasta - Fasta"/>
+        <conditional name="pick">
+            <param name="type" type="select" label="Parse a group file into abundant and rare groups?" help="">
+                <option value="no" selected="true">No</option>
+                <option value="yes">Yes</option>
+            </param>
+            <when value="no"/>
+            <when value="yes">
+                <param name="group" type="data" format="mothur.groups" label="group - Group file for the OTU List"/>
+                <param name="groups" type="select" label="groups - Group Selection (all used if none are selected)" multiple="true">
+                    <options>
+                        <filter type="data_meta" ref="group" key="groups"/>
+                    </options>
+                </param>
+            </when>
+        </conditional>
+        <param name="label" type="select" label="label - OTU Labels" multiple="true">
+            <expand macro="labeloptions"/>
+        </param>
+        <param name="sorted" type="select" label="sorted - Sort Sequences by">
+            <option value="">Don't sort</option>
+            <option value="name">Sequence Name</option>
+            <option value="number">Bin Number</option>
+            <option value="size">Bin Size</option>
+            <option value="group">Group</option>
+        </param>
+        <param name="large" type="boolean" checked="false" truevalue="true" falsevalue="false" label="large - Distance Matrix is very Large"/>
+        <param name="count" type="data" format="mothur.count_table" optional="true" label="count - a count_table" help="Cannot supply both a names and count table. Will be ignored if you also supplied a name file. Generated by count.seqs"/>
+        <param name="method" type="select" label="method - select the method of selecting the representative sequence" help="the distance method finds the sequence with the smallest maximum distance to other sequences. The abundance method chooses the abundant sequence in the OTU as the representative. Default=distance">
+            <option value="distance" selected="true">distance</option>
+            <option value="abundance">abundance</option>
+        </param>
+    </inputs>
+    <outputs>
+        <data name="logfile" format="txt" label="${tool.name} on ${on_string}: logfile"/>
+        <collection name="names_out" type="list" label="${tool.name} on ${on_string}: rep.names">
+            <filter>input['name'] or not count</filter>
+            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.rep\.names" format="mothur.names"/>
+        </collection>
+        <collection name="fasta_out" type="list" label="${tool.name} on ${on_string}: rep.fasta">
+            <filter>fasta</filter>
+            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.rep\.fasta" format="fasta"/>
+        </collection>
+        <collection name="count_out" type="list" label="${tool.name} on ${on_string}: rep.count_table">
+            <filter>count and not input['name']</filter>
+            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.rep\.count_table" format="mothur.count_table"/>
+        </collection>
+    </outputs>
+    <tests>
+        <test><!-- test with phylip -->
+            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
+            <param name="source" value="phylip"/>
+            <param name="dist" value="98_sq_phylip_amazon.dist" ftype="mothur.square.dist"/>
+            <param name="name" value="amazon1.names" ftype="mothur.names"/>
+            <output_collection name="names_out" count="36">
+                <element name="0.27" md5="39ff2858909d49633871d5a625585de5" ftype="mothur.names"/>
+            </output_collection>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with column and label select -->
+            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
+            <param name="source" value="column"/>
+            <param name="dist" value="amazon.pair.dist" ftype="mothur.pair.dist"/>
+            <param name="name" value="amazon1.names" ftype="mothur.names"/>
+            <param name="label" value="unique,0.05,0.27,0.45"/>
+            <output_collection name="names_out" count="4">
+                <element name="0.27" md5="be6dccdd3d4619c3ac465246c826209a" ftype="mothur.names"/>
+            </output_collection>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with fasta and sorting-->
+            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
+            <param name="source" value="phylip"/>
+            <param name="dist" value="98_sq_phylip_amazon.dist" ftype="mothur.square.dist"/>
+            <param name="fasta" value="amazon.fasta" ftype="fasta"/>
+            <param name="label" value="0.05,0.27"/>
+            <param name="sorted" value="name"/>
+            <output_collection name="names_out" count="2">
+                <element name="0.27" md5="39ff2858909d49633871d5a625585de5" ftype="mothur.names"/>
+            </output_collection>
+            <output_collection name="fasta_out" count="2">
+                <element name="0.27" md5="a9d9622b6f5fcbe8acdc05df5484ffc4" ftype="fasta"/>
+            </output_collection>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with group file -->
+            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
+            <param name="source" value="column"/>
+            <param name="dist" value="amazon.pair.dist" ftype="mothur.pair.dist"/>
+            <param name="name" value="amazon1.names" ftype="mothur.names"/>
+            <param name="label" value="unique,0.05,0.27,0.45"/>
+            <param name="type" value="yes"/>
+            <param name="group" value="amazon.groups" ftype="mothur.groups"/>
+            <param name="groups" value="forest,pasture"/>
+            <param name="count" value="amazon1.count_table" ftype="mothur.count_table"/> <!-- should be ignored as we also supplied name file -->
+            <output_collection name="names_out" count="8">
+                <element name="0.27.pasture" md5="34f87d93fd9ebbefed9754f627f502fd" ftype="mothur.names"/>
+            </output_collection>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with count table -->
+            <param name="otu" value="amazon.an.list" ftype="mothur.list"/>
+            <param name="source" value="phylip"/>
+            <param name="dist" value="98_sq_phylip_amazon.dist" ftype="mothur.square.dist"/>
+            <param name="label" value="unique,0.05,0.27"/>
+            <param name="count" value="amazon1.count_table" ftype="mothur.count_table"/>
+            <output_collection name="count_out" count="3">
+                <element name="0.27" md5="6b1afd712825af4bf8cb4ab8304df903" ftype="mothur.count_table"/>
+            </output_collection>
+            <expand macro="logfile-test"/>
+        </test>
+    </tests>
+    <help>
+<![CDATA[
+
+@MOTHUR_OVERVIEW@
+
+
+**Command Documenation**
+
+The get.oturep_ command generates a fasta-formatted sequence file containing only a representative sequence for each OTU.  The opposite of the bin.seqs command.
+
+.. _get.oturep: http://www.mothur.org/wiki/Get.oturep
+
+v1.23.0: Updated to Mothur 1.33, added count and method parameter
+]]>
+    </help>
+    <expand macro="citations"/>
+</tool>