view frequency.xml @ 2:b8ecbc50af78 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:38:02 +0000
parents f77f7c426d6f
children cdba4eab5a54
line wrap: on
line source

<tool id="ampvis2_frequency" name="ampvis2 frequency plot" 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")
            plot <- amp_frequency(
                data,
                #if $group_by
                    group_by = "$group_by",
                #end if
                ## tax_class = NULL,
                tax_empty = "$tax_empty",
                tax_aggregate = "$tax_aggregate",
                weight = $weight,
                normalise = $normalise,
                ## TODO
                detailed_output = FALSE
            )
            @OUTPUT_TOKEN@
        ]]></configfile>
    </configfiles>
    <inputs>
        <expand macro="rds_metadata_input_macro"/>
        <expand macro="metadata_select_discrete" argument="group_by" label="Group the samples by "/>
        <expand macro="tax_empty_macro"/>
        <expand macro="taxlevel_macro" argument="tax_aggregate" label="The taxonomic level to aggregate the OTUs">
            <option value="OTU" selected="true">OTU/ASV</option>
        </expand>
        <param argument="weight" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Weight the frequency by abundance"/>
        <expand macro="normalise_macro" checked="true"/>
        <expand macro="out_format_macro"/>
    </inputs>
    <outputs>
        <expand macro="out_macro"/>
    </outputs>
    <tests>
        <!-- defaults -->
        <test expect_num_outputs="1">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <output name="plot" value="AalborgWWTPs-frequency.pdf" ftype="pdf"/>
        </test>
        <!-- group_by -->
        <test expect_num_outputs="1">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="group_by" value="Plant"/> 
            <output name="plot" value="AalborgWWTPs-frequency-group_by.pdf" ftype="pdf"/>
        </test>
    </tests>
    <help><![CDATA[
What it does
============

Generates a barplot with frequency vs read abundance.

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

Input
=====

@HELP_RDS_INPUT@

@HELP_METADATA_LIST_INPUT@

Output
======

A frequency plot in the chosen output format.
    ]]></help>
    <expand macro="citations"/>
</tool>