changeset 2:041052875af0 draft

"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/xmsannotator commit de75adf885d616bbe94c8087d3208a2b5039418e"
author recetox
date Thu, 08 Oct 2020 00:41:12 +0000
parents 02a38a19405d
children 412d8bb4b54d
files xmsannotator_macros.xml xmsannotator_simple.xml
diffstat 2 files changed, 14 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/xmsannotator_macros.xml	Mon Oct 05 09:00:12 2020 +0000
+++ b/xmsannotator_macros.xml	Thu Oct 08 00:41:12 2020 +0000
@@ -1,24 +1,15 @@
 <macros>
     <token name="@TOOL_VERSION@">1.3.2</token>
-    <xml name="requirements">
-        <requirements>
-            <container type="docker">recetox/xmsannotator:1.3.2-recetox0</container>
-        </requirements>
-    </xml>
+    <token name="@DOCKER_IMAGE@">recetox/xmsannotator:1.3.2-recetox0</token>
 
     <xml name="annotation">
-        <param name="peaks" type="data" format="h5" label="Peaks" help="Table of peaks to annotate."/>
-        <param name="metabolites" type="data" format="h5" label="Metabolite database"/>
+        <param name="peaks" type="data" format="h5" label="Peaks" help="Peaks to annotate."/>
         <param name="adducts" type="data" format="h5" label="Adduct database"/>
-
+        <param name="compounds" type="data" format="h5" label="Compound database"/>
 
         <param name="mz_tolerance_ppm" type="float" value="5" min="0" label="Mass tolerance [ppm]" help="Mass tolerance in ppm for database matching."/>
     </xml>
 
-    <xml name="output">
-        <data format="h5" name="annotation"/>
-    </xml>
-
     <xml name="citations">
         <citations>
             <citation type="doi">10.1021/acs.analchem.6b01214</citation>
--- a/xmsannotator_simple.xml	Mon Oct 05 09:00:12 2020 +0000
+++ b/xmsannotator_simple.xml	Thu Oct 08 00:41:12 2020 +0000
@@ -3,23 +3,26 @@
         <import>xmsannotator_macros.xml</import>
     </macros>
 
-    <expand macro="requirements"/>
+    <requirements>
+        <container type="docker">@DOCKER_IMAGE@</container>
+    </requirements>
 
     <command detect_errors="aggressive"><![CDATA[
         Rscript -e 'annotation <- xmsannotator::simple_annotation(
-                        peaks = rhdf5::h5read("$peaks", "peaks"),
-                        adducts = rhdf5::h5read("$adducts", "adducts"),
-                        metabolites = rhdf5::h5read("$metabolites", "metabolites"),
-                        mz_tolerance_ppm = as.double($mz_tolerance_ppm)
+                        peaks = xmsannotator::load_hdf("$peaks", "peaks"),
+                        adducts = xmsannotator::load_hdf("$adducts", "adducts"),
+                        compounds = xmsannotator::load_hdf("$compounds", "compounds"),
+                        mass_tolerance = 1e-6 * $mz_tolerance_ppm
                    )'
-                -e 'rhdf5::h5write(annotation, "$annotation", "annotation")'
+                -e 'xmsannotator::save_hdf("$annotation", "annotation", annotation)'
     ]]></command>
 
     <inputs>
         <expand macro="annotation"/>
     </inputs>
+
     <outputs>
-        <expand macro="output"/>
+        <data format="h5" name="annotation"/>
     </outputs>
 
     <help><![CDATA[
@@ -28,5 +31,6 @@
         The annotation process generates all possible metabolite-adduct pairs from the metabolite and adduct databases and matches those pairs to the measured peaks.
         A metabolite-adduct pair is pronounced as a match to the peak when the difference of their masses are withing some tolerance.
     ]]></help>
+
     <expand macro="citations"/>
 </tool>