view subset_taxa.xml @ 2:1332619ad9ec draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 09b56ef3e09ad6c5923c88616fea5cbd77d87616
author iuc
date Mon, 18 Dec 2023 09:44:32 +0000
parents 8cb9c749b2fc
children
line wrap: on
line source

<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://kasperskytte.github.io/ampvis2/reference/amp_filter_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>