diff subset_taxa.xml @ 0:8cb9c749b2fc draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 7c0ecbffdb5e993f5af7e3b52c424c2761fb91d3"
author iuc
date Mon, 04 Apr 2022 10:19:09 +0000
parents
children 1332619ad9ec
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/subset_taxa.xml	Mon Apr 04 10:19:09 2022 +0000
@@ -0,0 +1,98 @@
+<tool id="ampvis2_subset_taxa" name="ampvis2 subset data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
+    <description>by taxonomy</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="header"/>
+    <command detect_errors="exit_code"><![CDATA[
+        Rscript '$rscript'
+    ]]></command>
+    <configfiles>
+        <configfile name="rscript"><![CDATA[
+            library(ampvis2, quietly = TRUE)
+            data <- readRDS("$data")
+            #set tax_vector = 'c("' + '", "'.join(str($tax_vector).split(",")) + '")'
+            data <- amp_subset_taxa(
+                data,
+                tax_vector = $tax_vector,
+                normalise = $normalise,
+                remove = $remove
+            )
+            saveRDS(data, "$ampvis")
+            @SAVE_TAX_LIST@
+        ]]></configfile>
+    </configfiles>
+    <inputs>
+        <expand macro="rds_input_macro"/>
+        <!-- add validator -->
+        <param name="taxonomy_list" type="data" optional="false" format="tabular" label="Taxonomy list" help="Generated with ampvis2: load"/>
+        <expand macro="taxonomy_select_macro" argument="tax_vector" label="Taxa to keep"/>
+        <expand macro="normalise_macro"/>
+        <param argument="remove" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Remove" help="Selected taxa will be removed instead of being the only ones kept in the data."/>
+    </inputs>
+    <outputs>
+        <data name="ampvis" format="ampvis2"/>
+        <data name="taxonomy_list_out" format="tabular" label="${tool.name} on ${on_string}: taxonomy list"/>
+    </outputs>
+    <tests>
+        <!-- defaults -->
+        <test expect_num_outputs="2">
+            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
+            <param name="taxonomy_list" value="AalborgWWTPs-taxonomy.list"/> 
+            <param name="tax_vector" value="f__Caldilineaceae,p__Elusimicrobia"/>
+            <output name="ampvis" value="AalborgWWTPs-subset_taxa.rds" ftype="ampvis2" compare="sim_size"/>
+            <output name="taxonomy_list_out" ftype="tabular">
+                <assert_contents>
+                    <has_text text="f__Caldilineaceae"/>
+                    <has_text text="p__Elusimicrobia"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- defaults -->
+        <test expect_num_outputs="2">
+            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
+            <param name="taxonomy_list" value="AalborgWWTPs-taxonomy.list"/> 
+            <param name="tax_vector" value="f__Caldilineaceae,p__Elusimicrobia"/>
+            <param name="remove" value="true"/>
+            <output name="ampvis" value="AalborgWWTPs-subset_taxa.rds" ftype="ampvis2" compare="sim_size"/>
+            <output name="taxonomy_list_out" ftype="tabular">
+                <assert_contents>
+                    <not_has_text text="f__Caldilineaceae"/>
+                    <not_has_text text="p__Elusimicrobia"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+What it does
+============
+
+Subsets the data in ampvis2 objects based on taxonomy and returns the subsetted object.
+
+The Galaxy tool calls the `amp_subset_taxa
+<https://madsalbertsen.github.io/ampvis2/reference/amp_subset_taxa.html>`_ function
+of the ampvis2 package.
+
+The taxonomy subset is done by providing a tax_vector of taxa names which are
+then matched to the taxonomy table, where all other taxa not matching the
+"Taxa to keep" (``tax_vector``) are removed. If "Remove" is enabled, then the
+matching taxa are the ones being removed instead. The taxa names 
+will be matched in all columns of the taxonomy table.
+
+@HELP_RELATIVE_ABUNDANCES@
+
+Input
+=====
+
+@HELP_RDS_INPUT@
+
+@HELP_METADATA_LIST_INPUT@
+
+Output
+======
+
+An ampvis2_rds dataset containing subsetted data and an updated taxonomy list dataset.
+
+    ]]></help>
+    <expand macro="citations"/>
+</tool>
\ No newline at end of file