diff tools/mothur/get.groups.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.groups.xml	Fri Jun 03 09:32:47 2016 -0400
@@ -0,0 +1,179 @@
+<tool profile="16.07" id="mothur_get_groups" name="Get.groups" version="@WRAPPER_VERSION@.0">
+    <description>Select groups</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="version_command"/>
+    <command detect_errors="aggressive"><![CDATA[
+        echo 'get.groups(
+            #if $group_in.is_of_type("mothur.groups"):
+                group=$group_in
+            #else
+                count=$group_in
+            #end if
+            #if $groupnames.source == 'groups':
+                #if $groupnames.groups:
+                    ,groups=${ str($groupnames.groups).replace(",","-") }
+                #end if
+            #else
+                ,accnos=$groupnames.accnos
+            #end if
+            #if $fasta_in:
+                ,fasta=$fasta_in
+            #end if
+            #if $name_in:
+                ,name=$name_in
+            #end if
+            #if $list_in:
+                ,list=$list_in
+            #end if
+            #if $shared_in:
+                ,shared=$shared_in
+            #end if
+            #if $taxonomy_in:
+                ,taxonomy=$taxonomy_in
+            #end if
+            #if $design_in:
+                ,design=$design_in
+            #end if
+        )'
+        | sed 's/ //g'  ## mothur trips over whitespace
+        | mothur &&
+
+        ## move output files to correct destination
+        prefix="$group_in" &&
+        mv \${prefix%.dat}*.pick.* "$group_out" &&
+        #if $fasta_in:
+            prefix2="$fasta_in" &&
+            mv \${prefix2%.dat}*.pick.* "$fasta_out" &&
+        #end if
+        #if $name_in:
+            prefix2="$name_in" &&
+            mv \${prefix2%.dat}*.pick.* "$name_out" &&
+        #end if
+        #if $shared_in:
+            prefix2="$shared_in" &&
+            mkdir sharedout &&
+            mv \${prefix2%.dat}*.pick.* sharedout/ &&
+        #end if
+        #if $list_in:
+            prefix2="$list_in" &&
+            mkdir listout &&
+            mv \${prefix2%.dat}*.pick.* listout/ &&
+        #end if
+        #if $taxonomy_in:
+            prefix2="$taxonomy_in" &&
+            mv \${prefix2%.dat}*.pick.* "$taxonomy_out" &&
+        #end if
+        #if $design_in:
+            prefix2="$design_in" &&
+            mv \${prefix2%.dat}*.pick.* "$design_out" &&
+        #end if
+        mv mothur.*.logfile "$logfile"
+    ]]></command>
+    <inputs>
+        <param name="group_in" type="data" format="mothur.groups,mothur.count_table" label="group or count_table file"/>
+        <conditional name="groupnames">
+            <param name="source" type="select" label="Select Group Names from">
+                <option value="groups">A List of Group Names</option>
+                <option value="accnos">A History Group Name Accnos Dataset</option>
+            </param>
+            <when value="groups">
+                <param name="groups" type="select" label="groups - Pick groups to include" multiple="true">
+                    <options>
+                        <filter type="data_meta" ref="group_in" key="groups"/>
+                    </options>
+                </param>
+            </when>
+            <when value="accnos">
+                <param name="accnos" type="data" format="mothur.accnos" label="accnos - Group Names from your history"/>
+            </when>
+        </conditional>
+        <param name="fasta_in" type="data" format="fasta,mothur.align" optional="true" label="fasta - Fasta Sequences"/>
+        <param name="name_in" type="data" format="mothur.names" optional="true" label="name - Sequences Name reference"/>
+        <param name="list_in" type="data" format="mothur.list" optional="true" label="list - OTU List"/>
+        <param name="shared_in" type="data" format="mothur.shared" optional="true" label="shared - OTU Shared"/>
+        <param name="taxonomy_in" type="data" format="mothur.seq.taxonomy" optional="true" label="taxonomy - Taxonomy"/>
+        <param name="design_in" type="data" format="tabular" optional="true" label="design - assign groups to new grouping"
+               help="design has 2 columns: group(col 1) and grouping(col 2) (separated by a TAB character) use make.design"/>
+    </inputs>
+    <outputs>
+        <data name="logfile" format="txt" label="${tool.name} on ${on_string}: logfile"/>
+        <data name="group_out" format="mothur.groups" label="${tool.name} on ${on_string}: pick.groups"/>
+        <data format_source="fasta_in" name="fasta_out" label="${tool.name} on ${on_string}: pick.fasta">
+            <filter>fasta_in</filter>
+        </data>
+        <data name="name_out" format="mothur.names" label="${tool.name} on ${on_string}: pick.name">
+            <filter>name_in</filter>
+        </data>
+        <collection name="listfiles" type="list" label="${tool.name} on ${on_string}: pick.list">
+            <filter>list_in</filter>
+            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.pick\.dat" directory="listout" format="mothur.list"/>
+        </collection>
+        <collection name="sharedfiles" type="list" label="${tool.name} on ${on_string}: pick.shared">
+            <filter>shared_in</filter>
+            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.pick\.dat" directory="sharedout" format="mothur.shared"/>
+        </collection>
+        <data name="taxonomy_out" format="mothur.seq.taxonomy" label="${tool.name} on ${on_string}: pick.taxonomy">
+            <filter>taxonomy_in</filter>
+        </data>
+        <data name="design_out" format="mothur.design" label="${tool.name} on ${on_string}: pick.design">
+            <filter>design_in</filter>
+        </data>
+    </outputs>
+    <tests>
+        <test><!-- test with group file -->
+            <param name="group_in" value="amazon.groups" ftype="mothur.groups"/>
+            <param name="source" value="groups"/>
+            <param name="groups" value="forest,pasture"/>
+            <output name="group_out" md5="fb60628ae445e7b06f9833f632b2cd0c" ftype="mothur.groups"/>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with accnos file -->
+            <param name="group_in" value="amazon.groups" ftype="mothur.groups"/>
+            <param name="source" value="accnos"/>
+            <param name="accnos" value="amazon.groupaccnos" ftype="mothur.accnos"/>
+            <output name="group_out" md5="fb60628ae445e7b06f9833f632b2cd0c" ftype="mothur.groups"/>
+            <expand macro="logfile-test"/>
+        </test>
+        <test><!-- test with accnos file and most extra files-->
+            <param name="group_in" value="amazon.groups" ftype="mothur.groups"/>
+            <param name="source" value="accnos"/>
+            <param name="accnos" value="amazon.groupaccnos" ftype="mothur.accnos"/>
+            <param name="fasta_in" value="amazon.fasta" ftype="fasta"/>
+            <param name="name_in" value="amazon1.names" ftype="mothur.names"/>
+            <param name="list_in" value="amazon.an.list" ftype="mothur.list"/>
+            <param name="shared_in" value="amazon.an.shared" ftype="mothur.shared"/>
+            <output name="group_out" md5="fb60628ae445e7b06f9833f632b2cd0c" ftype="mothur.groups"/>
+            <output name="fasta_out" md5="0bc9320647234e8367c3b1b654f9302d" ftype="fasta"/>
+            <output name="name_out" md5="1f0324a017e1b71e6ed0af257b0013f3" ftype="mothur.names"/>
+            <output_collection name="listfiles" count="36">
+                <element name="0.38" md5="49878dfbe53d5144f3bd885c629de822" ftype="mothur.list"/>
+            </output_collection>
+            <output_collection name="sharedfiles" count="36">
+                <element name="0.38" md5="3c78742e0a480ca3353f9b591fc9bf36" ftype="mothur.shared"/>
+            </output_collection>
+            <expand macro="logfile-test"/>
+        </test>
+    </tests>
+    <help>
+<![CDATA[
+
+@MOTHUR_OVERVIEW@
+
+
+**Command Documenation**
+
+The get.groups_ command selects sequences from a specific group or set of groups from the following file types: fasta, fasta, name_, group_, list_, taxonomy_.
+
+.. _name: http://www.mothur.org/wiki/Name_file
+.. _group: http://www.mothur.org/wiki/Group_file
+.. _list: http://www.mothur.org/wiki/List_file
+.. _taxonomy: http://www.mothur.org/wiki/Taxonomy_outline
+.. _get.groups: http://www.mothur.org/wiki/Get.groups
+
+]]>
+    </help>
+    <expand macro="citations"/>
+</tool>