view boxplot.xml @ 2:de03693b75b1 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:45:30 +0000
parents 43776659edf4
children 6eae290d762b
line wrap: on
line source

<tool id="ampvis2_boxplot" name="ampvis2 boxplot" 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[
            #if $tax_add
                #set ta='c("' + '", "'.join(str($tax_add).split(",")) + '")'
            #else
                #set ta='NULL'
            #end if
            library(ampvis2, quietly = TRUE)
            d <- readRDS("$data")
            plot <- amp_boxplot(
                d,
                #if $group_by
                    group_by = "$group_by",
                #end if
                sort_by = "$sort_by",
                plot_type = "$plot_type",
                point_size = $point_size,
                tax_aggregate = "$tax_aggregate",
                tax_add = $ta,
                @TAX_SHOW@
                tax_empty = "$tax_empty",
                ## tax_class = NULL,
                ## order_group = NULL,
                ## order_y = NULL,
                plot_flip = $plot_flip,
                plot_log = $plot_log,
                #if str($adjust_zero) != ""
                    adjust_zero = $adjust_zero,
                #end if
                normalise = $normalise
                ## detailed_output = TRUE
            )
            @OUTPUT_TOKEN@
        ]]></configfile>
    </configfiles>
    <inputs>
        <expand macro="rds_metadata_input_macro"/>
        <expand macro="metadata_select_discrete" argument="group_by" label="Group the samples" help="by a discrete variable in the metadata"/>
        <param argument="sort_by" type="select" label="Sort boxplots by">
            <option value="median">Median</option>
            <option value="mean">Mean</option>
            <option value="total">Total</option>
        </param>
        <param argument="plot_type" type="select" label="Plot type">
            <option value="boxplot">Boxplot</option>
            <option value="point">Points</option>
        </param>
        <param argument="point_size" type="integer" value="1" min="0" label="Point size"/>
        <expand macro="taxlevel_macro" argument="tax_aggregate" label="The taxonomic level to aggregate the OTUs">
            <option value="Genus" selected="true">Genus</option>
        </expand>
        <expand macro="taxlevel_macro" argument="tax_add" multiple="true" optional="true" label="Additional taxonomic level(s) to display"/>
        <expand macro="tax_show_macro" value="20"/>
        <expand macro="tax_empty_macro"/>
        <param argument="plot_flip" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Flip the axes of the plot"/>
        <param argument="plot_log" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Log10-scale the plot"/>
        <param argument="adjust_zero" type="integer" value="" min="1" optional="true" label="Add value to abundances" help="in order to keep abundances of 0 in the calculation of medians"/>
        <expand macro="normalise_macro"/>
        <expand macro="out_format_macro"/>
    </inputs>
    <outputs>
        <expand macro="out_macro"/>
    </outputs>
    <tests>
        <test>
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <output name="plot" value="AalborgWWTPs-boxplot.pdf" ftype="pdf"/>
        </test>
        <test>
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="group_by" value="Plant"/>
            <param name="sort_by" value="total"/>
            <param name="tax_show" value="5"/>
            <param name="plot_flip" value="true"/>
            <param name="plot_log" value="true"/>
            <param name="adjust_zero" value="100000"/>
            <param name="normalise" value="true"/>
            <output name="plot" value="AalborgWWTPs-boxplot-group.pdf" ftype="pdf"/>
        </test>
        <test>
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="plot_type" value="point"/>
            <param name="point_size" value="5"/>
            <param name="tax_aggregate" value="Order"/>
            <param name="tax_add" value="Phylum"/>
            <output name="plot" value="AalborgWWTPs-boxplot-point.pdf" ftype="pdf"/>
        </test>
    </tests>
    <help><![CDATA[
What it does
============

Generates boxplots of the most abundant taxa.

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

Input
=====

@HELP_RDS_INPUT@

@HELP_METADATA_LIST_INPUT@

Output
======

Boxplot in the chosen output format.

    ]]></help>
    <expand macro="citations"/>
</tool>