diff rarecurve.xml @ 0:65cc862ec3c4 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:23:15 +0000
parents
children 37c1c0ba406c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rarecurve.xml	Mon Apr 04 10:23:15 2022 +0000
@@ -0,0 +1,97 @@
+<tool id="ampvis2_rarecurve" name="ampvis2 rarefaction curve" 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_rarecurve(
+                data,
+                stepsize = $stepsize
+                #if $color_by
+                    , color_by = "$color_by",
+                #end if
+                #if $facet_by
+                    , facet_by = "$facet_by",
+                    #if $facet_scales
+                        , facet_scales = "$facet_scales"
+                    #end if
+                #end if
+            )
+            
+            @OUTPUT_TOKEN@
+        ]]></configfile>
+    </configfiles>
+    <inputs>
+        <expand macro="rds_metadata_input_macro"/>
+        <!-- TODO if no metadata_list is given that the color/facet_by selects
+            give a warnings in the logs:
+            WARNI [galaxy.tools.parameters.dynamic_options] could not create dynamic options from_dataset: metadata_list not a data or collection paramete
+
+            - introduce a conditional color_facet_cond wich optionally shows these options
+              and make metadata_list required?
+            - or use a filter + proper message instead of from_datatable ?  
+            
+            here and everywhere else -->
+        <param argument="stepsize" type="integer" value="1000" min="1" label="Step size" help="Lower is prettier but takes more time to generate."/>
+        <expand macro="metadata_select" argument="color_by" label="Color curves by"/>
+        <expand macro="metadata_select_discrete" argument="facet_by" label="Facet curves by"/>
+        <expand macro="facet_scales_macro" argument="facet_scales" help="Only relevant if for facet_by a value is selected"/>
+        <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-rarecurve.pdf" ftype="pdf"/>
+        </test>
+        <test>
+            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
+            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
+            <param name="stepsize" value="100"/> 
+            <param name="color_by" value="Plant"/> 
+            <output name="plot" value="AalborgWWTPs-rarecurve-color.pdf" ftype="pdf"/>
+        </test>
+        <test>
+            <param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/> 
+            <param name="metadata_list" value="AalborgWWTPs-metadata.list"/> 
+            <param name="stepsize" value="100"/> 
+            <param name="facet_by" value="Plant"/> 
+            <param name="facet_scales" value="fixed"/> 
+            <output name="plot" value="AalborgWWTPs-rarecurve-facet.pdf" ftype="pdf"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+What it does
+============
+
+Generates a rarefaction curve (number of reads vs number of observed OTUs) for each sample.
+The plot can be colored or faceted (i.e. split into multiple panels) by metadata
+
+The Galaxy tool calls the `amp_rarecurve
+<https://madsalbertsen.github.io/ampvis2/reference/amp_rarecurve.html>`_ function
+of the ampvis2 package. 
+
+Input
+=====
+
+@HELP_RDS_INPUT@
+
+@HELP_METADATA_LIST_INPUT@
+
+Output
+======
+
+Rarefaction curves in the chosen output format.
+
+    ]]></help>
+    <expand macro="citations"/>
+</tool>
\ No newline at end of file