diff timeseries.xml @ 0:e77090960f62 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 7c0ecbffdb5e993f5af7e3b52c424c2761fb91d3"
author iuc
date Mon, 04 Apr 2022 10:19:59 +0000
parents
children 3c16699f39d6
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/timeseries.xml	Mon Apr 04 10:19:59 2022 +0000
@@ -0,0 +1,109 @@
+<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"/>
+        </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"/>
+        </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"/>
+        </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://madsalbertsen.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>
\ No newline at end of file