diff cluster.xml @ 2:6f2cdccbfa48 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit 3418f23b9768f5aafb86488f5ec1cb97530d4fb3
author iuc
date Tue, 20 Mar 2018 22:08:08 -0400
parents 8c1b609f566d
children 3bb756df109c
line wrap: on
line diff
--- a/cluster.xml	Tue Sep 05 17:13:06 2017 -0400
+++ b/cluster.xml	Tue Mar 20 22:08:08 2018 -0400
@@ -3,66 +3,89 @@
     <macros>
         <import>macros.xml</import>
     </macros>
-    <expand macro="requirements"/>
+    <expand macro="requirements">
+        <requirement type="package" version="2.6.0">vsearch</requirement>
+    </expand>
     <expand macro="stdio"/>
     <expand macro="version_command"/>
     <command><![CDATA[
-        @SHELL_OPTIONS@
+@SHELL_OPTIONS@
 
-        ## create symlinks to input datasets
-        ln -s "$matrix.dist" matrix.dist.dat &&
-        ln -s "$matrix.name" matrix.name.dat &&
-        ln -s "$count" count.dat &&
+## create symlinks to input datasets
+ln -s '$matrix.dist' matrix.dist.dat &&
+ln -s '$matrix.name' matrix.name.dat &&
+ln -s '$count' count.dat &&
 
-        echo 'cluster(
-            #if $matrix.format == "phylip":
-                phylip=matrix.dist.dat,
-            #else
-                column=matrix.dist.dat,
-            #end if
-            #if $matrix.name:
-                name=matrix.name.dat,
-            #end if
-            #if $count:
-                count=count.dat,
-            #end if
-            hard=$hard,
-            #if float($cutoff) > 0.0:
-                cutoff=$cutoff,
-            #end if
-            precision=$precision,
-            sim=$sim,
-            method=$method
-        )'
-        | sed 's/ //g'  ## mothur trips over whitespace
-        | mothur
-        | tee mothur.out.log
+echo 'cluster(
+    #if $matrix.format == "phylip":
+        phylip=matrix.dist.dat,
+    #else
+        column=matrix.dist.dat,
+    #end if
+    #if $matrix.name:
+        name=matrix.name.dat,
+    #end if
+    #if $count:
+        count=count.dat,
+    #end if
+    #if float($cutoff) > 0.0:
+        cutoff=$cutoff,
+    #end if
+    #if $select_method.method =="opti":
+        metric=$select_method.metric,
+        initialize=$select_method.initialize,
+        delta=$select_method.delta,
+        iters=$select_method.iters,
+    #end if
+    precision=$precision,
+    sim=$sim,
+    method=$select_method.method
+)'
+| sed 's/ //g'  ## mothur trips over whitespace
+| mothur
+| tee mothur.out.log
     ]]></command>
     <inputs>
         <conditional name="matrix">
-            <param name="format" type="select" label="Select a Distance Matrix Format" help="">
+            <param name="format" type="select" label="Cluster based on" help="">
                 <option value="column">Pairwise Column Matrix</option>
                 <option value="phylip">Phylip Distance Matrix</option>
+                <option value="fasta">Fasta (VSEARCH)</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" optional="true" label="name - Sequences Name reference"/>
+                <param name="dist" argument="column" type="data" format="mothur.pair.dist" label="column - Distance Matrix"/>
+                <param argument="name" type="data" format="mothur.names" optional="true" label="name - Sequences Name reference"/>
             </when>
             <when value="phylip">
-                <param name="dist" type="data" format="mothur.dist,mothur.lower.dist,mothur.square.dist" label="phylip - Distance Matrix"/>
-                <param name="name" type="data" format="mothur.names" optional="true" label="name - Sequences Name reference"/>
+                <param name="dist" argument="phylip" type="data" format="mothur.dist,mothur.lower.dist,mothur.square.dist" label="phylip - Distance Matrix"/>
+                <param argument="name" type="data" format="mothur.names" optional="true" label="name - Sequences Name reference"/>
+            </when>
+            <when value="fasta">
+                <param argument="fasta" type="data" format="mothur.align,fasta" label="Fasta file"/>
             </when>
         </conditional>
-        <param name="count" type="data" format="mothur.count_table" optional="true" label="count - a count_table" help="generated by count.seqs"/>
-        <param name="method" type="select" label="method - Select a Clustering Method" help="">
-            <option value="furthest">Furthest neighbor</option>
-            <option value="nearest">Nearest neighbor</option>
-            <option value="average" selected="true">Average neighbor</option>
-            <option value="weighted">Weighted</option>
-        </param>
-        <param name="cutoff" type="float" value="0.0" label="cutoff - Distance Cutoff threshold - ignored if not > 0.0" help="Ignore pairwise distances larger than this, a common value would be 0.10"/>
-        <param name="hard" type="boolean" checked="true" truevalue="true" falsevalue="false" label="hard - Use hard cutoff instead of rounding"/>
-        <param name="precision" type="select" optional="true" label="precision - Precision for rounding distance values" help="Set higher precision for longer genome scale sequence lengths">
+        <param argument="count" type="data" format="mothur.count_table" optional="true" label="count - a count_table" help="generated by count.seqs"/>
+        <conditional name="select_method">
+            <expand macro="param-clustermethods">
+                <expand macro="option-vsearch-clustermethods"/>
+            </expand>
+            <when value="furthest"/>
+            <when value="nearest"/>
+            <when value="average"/>
+            <when value="agc">
+                <param argument="fasta" type="data" format="mothur.align,fasta" label="Fasta file"/>
+            </when>
+            <when value="dgc">
+                <param argument="fasta" type="data" format="mothur.align,fasta" label="Fasta file"/>
+            </when>
+            <when value="opti">
+                <expand macro="params-opticlust"/>
+            </when>
+        </conditional>
+        <param argument="cutoff" type="float" value="0.0" label="cutoff - Distance Cutoff threshold - ignored if not > 0.0"
+            help="Ignore pairwise distances larger than this, a common value would be 0.10"/>
+        <param name="precision" type="select" optional="true" label="precision - Precision for rounding distance values"
+            help="Set higher precision for longer genome scale sequence lengths">
             <option value="10">.1</option>
             <option value="100" selected="true">.01</option>
             <option value="1000">.001</option>
@@ -70,7 +93,8 @@
             <option value="100000">.00001</option>
             <option value="1000000">.000001</option>
         </param>
-        <param name="sim" type="boolean" checked="false" truevalue="true" falsevalue="false" label="sim - Matrix values are Similary instead of Distance"/>
+        <param argument="sim" type="boolean" checked="false" truevalue="true" falsevalue="false" label="sim - Matrix values are Similary instead of Distance"/>
+        <expand macro="param-savelog"/>
     </inputs>
     <outputs>
         <expand macro="logfile-output"/>
@@ -82,23 +106,76 @@
         <test><!-- test with phylip input -->
             <param name="format" value="phylip"/>
             <param name="dist" value="amazon.dist"/>
-            <output name="rabund" file="amazon.an.rabund" ftype="mothur.rabund"/>
-            <output name="sabund" file="amazon.an.sabund" ftype="mothur.sabund"/>
-            <output name="otulist" md5="a6bf2a6ef7950b3ee2aa5bff4a662b6d" ftype="mothur.list"/>
+            <output name="rabund" ftype="mothur.rabund">
+                <assert_contents>
+                    <has_line_matching expression="^0\.03(\t\d+)+$"/>
+                </assert_contents>
+            </output>
+            <output name="sabund" ftype="mothur.sabund">
+                <assert_contents>
+                    <has_line_matching expression="^0\.03(\t\d+)+$"/>
+                </assert_contents>
+            </output>
+            <output name="otulist" ftype="mothur.list">
+                <assert_contents>
+                    <expand macro="test-list-format"/>
+                    <has_text text="0.03"/>
+                    <has_text text="U68688"/>
+                </assert_contents>
+            </output>
+            <param name="savelog" value="true"/>
             <expand macro="logfile-test"/>
         </test>
         <test><!-- test with column input -->
             <param name="format" value="column"/>
             <param name="dist" value="amazon.pair.dist"/>
             <param name="name" value="amazon.names"/>
-            <output name="rabund" md5="ec88216404729d0f4a0463e50e60c9ad" ftype="mothur.rabund"/>
-            <output name="sabund" md5="f2c714531430b98d8cdfd3497468eec2" ftype="mothur.sabund"/>
-            <output name="otulist" md5="1769463ed0b6680babe5801bf9c0a85c" ftype="mothur.list"/>
+            <output name="rabund" ftype="mothur.rabund">
+                <assert_contents>
+                    <has_line_matching expression="^0\.03(\t\d+)+$"/>
+                </assert_contents>
+            </output>
+            <output name="sabund" ftype="mothur.sabund">
+                <assert_contents>
+                    <has_line_matching expression="^0\.03(\t\d+)+$"/>
+                </assert_contents>
+            </output>
+            <output name="otulist" ftype="mothur.list">
+                <assert_contents>
+                    <expand macro="test-list-format"/>
+                    <has_text text="0.03"/>
+                    <has_text text="U68688"/>
+                </assert_contents>
+            </output>
+            <param name="savelog" value="true"/>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with column input -->
+            <param name="format" value="column"/>
+            <param name="dist" value="amazon.pair.dist"/>
+            <param name="name" value="amazon.names"/>
+            <output name="rabund" ftype="mothur.rabund">
+                <assert_contents>
+                    <has_line_matching expression="^0\.03(\t\d+)+$"/>
+                </assert_contents>
+            </output>
+            <output name="sabund" ftype="mothur.sabund">
+                <assert_contents>
+                    <has_line_matching expression="^0\.03(\t\d+)+$"/>
+                </assert_contents>
+            </output>
+            <output name="otulist" ftype="mothur.list">
+                <assert_contents>
+                    <expand macro="test-list-format"/>
+                    <has_text text="0.03"/>
+                    <has_text text="U68688"/>
+                </assert_contents>
+            </output>
+            <param name="savelog" value="true"/>
             <expand macro="logfile-test"/>
         </test>
     </tests>
-    <help>
-<![CDATA[
+    <help><![CDATA[
 
 @MOTHUR_OVERVIEW@
 
@@ -114,7 +191,6 @@
 .. _sabund: https://www.mothur.org/wiki/Sabund_file
 .. _cluster: https://www.mothur.org/wiki/Cluster
 
-]]>
-    </help>
+    ]]></help>
     <expand macro="citations"/>
 </tool>