view mergereplicates.xml @ 4:c77bb786712b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/ampvis2 commit e0ad9ce8f508215ec6af69be2682a0faf38415da
author iuc
date Mon, 10 Nov 2025 12:49:23 +0000
parents 2297a352423e
children
line wrap: on
line source

<tool id="ampvis2_mergereplicates" name="ampvis2 merge replicates" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
    <description></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")
            data <- amp_mergereplicates(
                data,
                merge_var = "$merge_var",
                #if $round != ""
                    round = "$round"
                #end if
            )
            saveRDS(data, "$ampvis")
            @SAVE_METADATA_LIST@
        ]]></configfile>
    </configfiles>
    <inputs>
        <expand macro="rds_metadata_input_macro"/>
        <expand macro="metadata_select_discrete" argument="merge_var" label="Variable that defines the sample groups"/>
        <param argument="round" type="select" label="Round decimals after merging" help="If the read counts are integers, any decimals present after merging will be rounded either up or down. Make sure this makes sense if the read counts have been normalised, as it may result in 0's, 1's, and 2's everywhere. ">
            <option value="">Don't round</option>
            <option value="up">up</option>
            <option value="down">down</option>
        </param>
    </inputs>
    <outputs>
        <data name="ampvis" format="ampvis2"/>
        <data name="metadata_list_out" format="tabular" label="${tool.name} on ${on_string}: metadata list"/>
    </outputs>
    <tests>
        <!-- defaults -->
        <test expect_num_outputs="2">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="merge_var" value="Period"/>
            <output name="ampvis" value="AalborgWWTPs-mergereplicates.rds" ftype="ampvis2" compare="sim_size"/>
            <output name="metadata_list_out">
                <assert_contents>
                    <has_line line="Period&#9;Winter&#9;TRUE&#9;character"/>
                    <has_n_lines n="13"/>
                    <has_n_columns n="4"/>
                </assert_contents>
            </output>
        </test>
        <!-- defaults -->
        <test expect_num_outputs="2">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="merge_var" value="Period"/>
            <param name="round" value="up"/>
            <output name="ampvis" value="AalborgWWTPs-mergereplicates.rds" ftype="ampvis2" compare="sim_size"/>
            <output name="metadata_list_out">
                <assert_contents>
                    <has_line line="Period&#9;Winter&#9;TRUE&#9;character"/>
                    <has_n_lines n="13"/>
                    <has_n_columns n="4"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
What it does
============

Aggregates read counts in replicate samples by calculating the mean abundances of OTU's

The Galaxy tool calls the `amp_mergereplicates
<https://kasperskytte.github.io/ampvis2/reference/amp_merge_replicates.html>`_ function
of the ampvis2 package.

Input
=====

@HELP_RDS_INPUT@

@HELP_METADATA_LIST_INPUT@

Output
======

An rank abundance plot in the chosen output format.
    ]]></help>
    <expand macro="citations"/>
</tool>