comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:8cb9c749b2fc
1 <tool id="ampvis2_subset_taxa" name="ampvis2 subset data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
2 <description>by taxonomy</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="header"/>
7 <command detect_errors="exit_code"><![CDATA[
8 Rscript '$rscript'
9 ]]></command>
10 <configfiles>
11 <configfile name="rscript"><![CDATA[
12 library(ampvis2, quietly = TRUE)
13 data <- readRDS("$data")
14 #set tax_vector = 'c("' + '", "'.join(str($tax_vector).split(",")) + '")'
15 data <- amp_subset_taxa(
16 data,
17 tax_vector = $tax_vector,
18 normalise = $normalise,
19 remove = $remove
20 )
21 saveRDS(data, "$ampvis")
22 @SAVE_TAX_LIST@
23 ]]></configfile>
24 </configfiles>
25 <inputs>
26 <expand macro="rds_input_macro"/>
27 <!-- add validator -->
28 <param name="taxonomy_list" type="data" optional="false" format="tabular" label="Taxonomy list" help="Generated with ampvis2: load"/>
29 <expand macro="taxonomy_select_macro" argument="tax_vector" label="Taxa to keep"/>
30 <expand macro="normalise_macro"/>
31 <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."/>
32 </inputs>
33 <outputs>
34 <data name="ampvis" format="ampvis2"/>
35 <data name="taxonomy_list_out" format="tabular" label="${tool.name} on ${on_string}: taxonomy list"/>
36 </outputs>
37 <tests>
38 <!-- defaults -->
39 <test expect_num_outputs="2">
40 <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/>
41 <param name="taxonomy_list" value="AalborgWWTPs-taxonomy.list"/>
42 <param name="tax_vector" value="f__Caldilineaceae,p__Elusimicrobia"/>
43 <output name="ampvis" value="AalborgWWTPs-subset_taxa.rds" ftype="ampvis2" compare="sim_size"/>
44 <output name="taxonomy_list_out" ftype="tabular">
45 <assert_contents>
46 <has_text text="f__Caldilineaceae"/>
47 <has_text text="p__Elusimicrobia"/>
48 </assert_contents>
49 </output>
50 </test>
51 <!-- defaults -->
52 <test expect_num_outputs="2">
53 <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/>
54 <param name="taxonomy_list" value="AalborgWWTPs-taxonomy.list"/>
55 <param name="tax_vector" value="f__Caldilineaceae,p__Elusimicrobia"/>
56 <param name="remove" value="true"/>
57 <output name="ampvis" value="AalborgWWTPs-subset_taxa.rds" ftype="ampvis2" compare="sim_size"/>
58 <output name="taxonomy_list_out" ftype="tabular">
59 <assert_contents>
60 <not_has_text text="f__Caldilineaceae"/>
61 <not_has_text text="p__Elusimicrobia"/>
62 </assert_contents>
63 </output>
64 </test>
65 </tests>
66 <help><![CDATA[
67 What it does
68 ============
69
70 Subsets the data in ampvis2 objects based on taxonomy and returns the subsetted object.
71
72 The Galaxy tool calls the `amp_subset_taxa
73 <https://madsalbertsen.github.io/ampvis2/reference/amp_subset_taxa.html>`_ function
74 of the ampvis2 package.
75
76 The taxonomy subset is done by providing a tax_vector of taxa names which are
77 then matched to the taxonomy table, where all other taxa not matching the
78 "Taxa to keep" (``tax_vector``) are removed. If "Remove" is enabled, then the
79 matching taxa are the ones being removed instead. The taxa names
80 will be matched in all columns of the taxonomy table.
81
82 @HELP_RELATIVE_ABUNDANCES@
83
84 Input
85 =====
86
87 @HELP_RDS_INPUT@
88
89 @HELP_METADATA_LIST_INPUT@
90
91 Output
92 ======
93
94 An ampvis2_rds dataset containing subsetted data and an updated taxonomy list dataset.
95
96 ]]></help>
97 <expand macro="citations"/>
98 </tool>