view timeseries.xml @ 4:9de032723f5b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit ab75ba7665d7fb5c18ad08dfbba92b273f991dfc
author iuc
date Sat, 16 Mar 2024 11:40:38 +0000
parents 3c16699f39d6
children
line wrap: on
line source

<tool id="ampvis2_timeseries" name="ampvis2 timeseries 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)
            #if $tax_add
                #set ta='c("' + '", "'.join(str($tax_add).split(",")) + '")'
            #else
                #set ta='NULL'
            #end if
            data <- readRDS("$data")
            plot <- amp_timeseries(
                data,
                time_variable = "$time_variable",
                #if $group_by
                    group_by = "$group_by",
                #end if
                tax_aggregate = "$tax_aggregate",
                tax_add = $ta,
                @TAX_SHOW@
                tax_class = NULL,
                tax_empty = "$tax_empty",
                split = $split,
                scales = "free_y",
                normalise = TRUE,
                plotly = FALSE,
                format = "%Y-%m-%d"
            )
            @OUTPUT_TOKEN@
        ]]></configfile>
    </configfiles>
    <inputs>
        <expand macro="rds_metadata_input_macro"/>
        <expand macro="metadata_select_date" argument="time_variable" optional="false" label="Time variable" help="Must be directly compatible with as_date and preferably of the form yyyy-mm-dd or %Y-%m-%d"/>
        <expand macro="metadata_select_discrete" argument="group_by" label="Group the samples by"/>
        <expand macro="taxlevel_macro" argument="tax_aggregate" label="The taxonomic level to aggregate the OTUs">
            <option value="OTU" selected="true">OTU/ASV</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="6"/>
        <expand macro="tax_empty_macro"/>
        <param argument="split" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Create a facet for each taxon"/>
        <expand macro="facet_scales_macro" argument="scales"/>
        <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"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="time_variable" value="Date"/>
            <output name="plot" value="AalborgWWTPs-timeseries.pdf" ftype="pdf" compare="sim_size"/>
        </test>
        <!-- group -->
        <test expect_num_outputs="1">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="time_variable" value="Date"/>
            <param name="group_by" value="Plant"/>
            <output name="plot" value="AalborgWWTPs-timeseries-group.pdf" ftype="pdf" compare="sim_size"/>
        </test>
        <!-- taxlevel -->
        <test expect_num_outputs="1">
            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
            <param name="time_variable" value="Date"/>
            <param name="tax_aggregate" value="Family"/>
            <param name="tax_add" value="Phylum"/>
            <output name="plot" value="AalborgWWTPs-timeseries-tax.pdf" ftype="pdf" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
What it does
============

Generates a timeseries plot showing relative read abundances over time.

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

@HELP_RELATIVE_ABUNDANCES@

Input
=====

@HELP_RDS_INPUT@

@HELP_METADATA_LIST_INPUT@

Output
======

A timeseries plot in the chosen output format.

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