diff make.group.xml @ 0:992d380f24ea draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit a9d1e0debcd357d8080a1c6c5f1d206dd45a7a4d
author iuc
date Fri, 19 May 2017 05:12:01 -0400
parents
children 4f91a75ac701
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make.group.xml	Fri May 19 05:12:01 2017 -0400
@@ -0,0 +1,102 @@
+<tool profile="16.07" id="mothur_make_group" name="Make.group" version="@WRAPPER_VERSION@.0">
+    <description>Make a group file</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="stdio"/>
+    <expand macro="version_command"/>
+    <command><![CDATA[
+        @SHELL_OPTIONS@
+
+        #set fastas = ''
+        #set groups = ''
+        #set count = 0
+
+        #if $method.how == 'collection':
+            #for $i in $method.fasta_collection:
+                ln -s '$i' fasta_${i.element_identifier}.dat &&
+                #set fastas+='fasta_'+$i.element_identifier+'.dat-'
+                #set groups+=$i.element_identifier+'-'
+            #end for
+        #else
+            #for $i in $method.inputs:
+                ln -s '$i.fasta' fasta_${count}.dat &&
+                #set fastas+='fasta_'+str($count)+'.dat-'
+                #set groups+=str($i.group)+'-'
+                #set count+=1
+            #end for
+        #end if
+
+        echo 'make.group(
+            fasta=${ str($fastas).rstrip('-') },
+            groups=${ str($groups).rstrip('-') }
+        )'
+        | sed 's/ //g'  ## mothur trips over whitespace
+        | mothur
+        | tee mothur.out.log
+
+    ]]></command>
+    <inputs>
+        <conditional name="method">
+            <param name="how" type="select" label="Method to create group file">
+                <option value="collection"> Automatically from collection </option>
+                <option value="manually"> Manually specify fasta files and group names</option>
+            </param>
+            <when value="collection">
+                <param name="fasta_collection" type="data_collection" collection_type="list" format="fasta" label="Collection with fasta files to group" help="group names will be named after the collection element names"/>
+            </when>
+            <when value="manually">
+                <repeat name="inputs" title="Additional">
+                    <param name="fasta" type="data" format="fasta" label="fasta - Fasta to group"/>
+                    <param name="group" type="text" label="group - Group name"/>
+                </repeat>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <expand macro="logfile-output"/>
+        <data name="output" format="mothur.groups" from_work_dir="*groups" label="${tool.name} on ${on_string}: group"/>
+    </outputs>
+    <tests>
+        <test> <!-- test manual groups creation -->
+            <param name="how" value="manually"/>
+            <repeat name="inputs">
+                <param name="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.good.align_head"/>
+                <param name="group" value="testgroup"/>
+            </repeat>
+            <repeat name="inputs">
+                <param name="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.good.align_head"/>
+                <param name="group" value="testgroup2"/>
+            </repeat>
+            <output name="output" file="Mock_S280_L001_R1_001_small.trim.contigs.good.Mock_S280_L001_R1_001_small.trim.contigs.good.groups"/>
+            <expand macro="logfile-test"/>
+        </test>
+        <test> <!-- test auto-creation from collection -->
+            <param name="how" value="collection"/>
+            <param name="fasta_collection">
+               <collection type="list">
+                   <element name="testgroup" ftype="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.good.align_head" />
+                   <element name="testgroup2" ftype="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.good.align_head" />
+              </collection>
+           </param>
+           <output name="output" file="Mock_S280_L001_R1_001_small.trim.contigs.good.Mock_S280_L001_R1_001_small.trim.contigs.good.groups"/>
+           <expand macro="logfile-test"/>
+        </test>
+    </tests>
+    <help>
+<![CDATA[
+
+@MOTHUR_OVERVIEW@
+
+**Command Documentation**
+
+The make.group_ command reads a fasta file or series of fasta files and creates a group_ file.
+
+.. _group: https://www.mothur.org/wiki/Group_file
+.. _make.group: https://www.mothur.org/wiki/Make.group
+
+]]>
+    </help>
+    <expand macro="citations"/>
+</tool>