diff xmsannotator_simple.xml @ 3:412d8bb4b54d draft

"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/xmsannotator commit 339f3b1b1243f353dd3ed115ac66320fdd2d2b68"
author recetox
date Mon, 14 Dec 2020 03:33:21 +0000
parents 041052875af0
children cd0729b7c3dc
line wrap: on
line diff
--- a/xmsannotator_simple.xml	Thu Oct 08 00:41:12 2020 +0000
+++ b/xmsannotator_simple.xml	Mon Dec 14 03:33:21 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="xmsannotator_simple" name="xMSannotator (simple)" version="@TOOL_VERSION@+galaxy0">
+<tool id="xmsannotator_simple" name="xMSannotator (simple)" version="@TOOL_VERSION@+galaxy2">
     <macros>
         <import>xmsannotator_macros.xml</import>
     </macros>
@@ -8,29 +8,46 @@
     </requirements>
 
     <command detect_errors="aggressive"><![CDATA[
-        Rscript -e 'annotation <- xmsannotator::simple_annotation(
-                        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 'xmsannotator::save_hdf("$annotation", "annotation", annotation)'
+        Rscript $wrapper
     ]]></command>
 
+    <configfiles>
+        <configfile name="wrapper"><![CDATA[
+            library(xmsannotator)
+
+            annotation <- simple_annotation(
+            #if $peak_table.is_of_type("h5")
+                peak_table = load_peak_table_hdf("${peak_table}"),
+            #elif $peak_table.is_of_type("parquet")
+                peak_table = load_peak_table_parquet("${peak_table}"),
+            #end if
+                adduct_table = load_adduct_table_parquet("${adduct_table}"),
+                compound_table = load_compound_table_parquet("${compound_table}"),
+                mass_tolerance = 1e-6 * ${mass_tolerance_ppm}
+            )
+
+            save_parquet(data = annotation, file = "${annotation_parquet}")
+        ]]></configfile>
+    </configfiles>
+
     <inputs>
-        <expand macro="annotation"/>
+        <expand macro="inputs"/>
+        <expand macro="tolerance"/>
     </inputs>
 
     <outputs>
-        <data format="h5" name="annotation"/>
+        <expand macro="outputs"/>
     </outputs>
 
     <help><![CDATA[
-        Annotate the peak intensity table (such as outputted from apLCMS) with metabolites from the metabolite database.
+        Annotate the peak intensity table (such as outputted from apLCMS) with compounds from the compounds database.
 
-        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.
+        The annotation process generates all possible compound-adduct pairs and matches those pairs to the measured
+        peaks. A compound-adduct pair is pronounced as a match to a certain peak when the difference of their masses are
+        withing some tolerance.
     ]]></help>
 
-    <expand macro="citations"/>
+    <citations>
+        <expand macro="citations"/>
+    </citations>
 </tool>