changeset 13:f4a90c68e2de draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/msmetaenhancer commit 1d1ecf792f5ea1c8a8f443dd1c3f55c810c5b00d
author recetox
date Mon, 27 May 2024 12:40:12 +0000
parents 5de89437323f
children
files macros.xml msmetaenhancer.xml msmetaenhancer_wrapper.py test-data/sample_out.msp
diffstat 4 files changed, 47 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Thu Jun 22 14:10:33 2023 +0000
+++ b/macros.xml	Mon May 27 12:40:12 2024 +0000
@@ -1,5 +1,5 @@
 <macros>
-    <token name="@TOOL_VERSION@">0.3.0</token>
+    <token name="@TOOL_VERSION@">0.4.0</token>
 
     <xml name="creator">
         <creator>
@@ -28,11 +28,19 @@
         The execution speed and results themselves can be affected by specifying the conversions, or their order.
 
         For detailed documentation of the tool please visit https://msmetaenhancer.readthedocs.io/.
+
+        ## Developer instructions
+
+        When updating this tool, it is necessary to make sure that `job_options` in `macros.xml` config file are up-to-date.
+        This can be done by running `galaxy/generate_options.py` script in [MSMetaEnhancer](https://github.com/RECETOX/MSMetaEnhancer) tool and 
+        copying generated options to the macro.
+
     ]]>
     </token>
 
     <xml name="job_options">
         <option value="canonical_smiles mw RDKit">RDKit: canonical_smiles -> mw</option>
+        <option value="formula mw RDKit">RDKit: formula -> mw</option>
         <option value="inchi canonical_smiles RDKit">RDKit: inchi -> canonical_smiles</option>
         <option value="inchi isomeric_smiles RDKit">RDKit: inchi -> isomeric_smiles</option>
         <option value="isomeric_smiles mw RDKit">RDKit: isomeric_smiles -> mw</option>
@@ -75,8 +83,19 @@
         <option value="inchi isomeric_smiles PubChem">PubChem: inchi -> isomeric_smiles</option>
         <option value="inchi iupac_name PubChem">PubChem: inchi -> iupac_name</option>
         <option value="inchi pubchemid PubChem">PubChem: inchi -> pubchemid</option>
+        <option value="inchikey canonical_smiles PubChem">PubChem: inchikey -> canonical_smiles</option>
+        <option value="inchikey formula PubChem">PubChem: inchikey -> formula</option>
+        <option value="inchikey inchi PubChem">PubChem: inchikey -> inchi</option>
+        <option value="inchikey isomeric_smiles PubChem">PubChem: inchikey -> isomeric_smiles</option>
+        <option value="inchikey iupac_name PubChem">PubChem: inchikey -> iupac_name</option>
+        <option value="inchikey pubchemid PubChem">PubChem: inchikey -> pubchemid</option>
+        <option value="pubchemid canonical_smiles PubChem">PubChem: pubchemid -> canonical_smiles</option>
+        <option value="pubchemid formula PubChem">PubChem: pubchemid -> formula</option>
         <option value="pubchemid hmdbid PubChem">PubChem: pubchemid -> hmdbid</option>
         <option value="pubchemid inchi PubChem">PubChem: pubchemid -> inchi</option>
+        <option value="pubchemid inchikey PubChem">PubChem: pubchemid -> inchikey</option>
+        <option value="pubchemid isomeric_smiles PubChem">PubChem: pubchemid -> isomeric_smiles</option>
+        <option value="pubchemid iupac_name PubChem">PubChem: pubchemid -> iupac_name</option>
         <option value="chebiid chemspiderid BridgeDb">BridgeDb: chebiid -> chemspiderid</option>
         <option value="chebiid hmdbid BridgeDb">BridgeDb: chebiid -> hmdbid</option>
         <option value="chebiid keggid BridgeDb">BridgeDb: chebiid -> keggid</option>
--- a/msmetaenhancer.xml	Thu Jun 22 14:10:33 2023 +0000
+++ b/msmetaenhancer.xml	Mon May 27 12:40:12 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="msmetaenhancer" name="MSMetaEnhancer" version="@TOOL_VERSION@+galaxy1">
+<tool id="msmetaenhancer" name="MSMetaEnhancer" version="@TOOL_VERSION@+galaxy0"  profile="21.09">
     <description>annotate MS data</description>
 
     <macros>
@@ -13,22 +13,22 @@
         <requirement type="package" version="@TOOL_VERSION@">msmetaenhancer</requirement>
     </requirements>
 
+    <command detect_errors="exit_code"><![CDATA[
+        sh ${msmetaenhancer_python_cli}
+    ]]> </command>
+
     <environment_variables>
         <environment_variable name="MPLCONFIGDIR">\$_GALAXY_JOB_TMP_DIR</environment_variable>
         <environment_variable name="XDG_CACHE_HOME">\$_GALAXY_JOB_TMP_DIR</environment_variable>
     </environment_variables>
 
-    <command detect_errors="exit_code"><![CDATA[
-        sh ${msmetaenhancer_python_cli}
-    ]]> </command>
-
     <configfiles>
         <configfile name="msmetaenhancer_python_cli">
             python3 ${__tool_directory__}/msmetaenhancer_wrapper.py \
             --input_file "$input_file" \
             --file_format "$input_file.ext" \
             --output_file "$output_file" \
-            #if $options.logging.output_log:
+            #if $options.logging.output_log == "TRUE":
             --log_file "$log_file" \
             --log_level "$options.logging.log_level" \
             #end if
@@ -62,8 +62,10 @@
 
         <section name="options" title="Options">
             <conditional name="logging">
-                <param label="Save the log file" name="output_log" type="boolean" truevalue="TRUE" falsevalue="FALSE"
-                       checked="false" help="Preserve a log with details about the annotation process."/>
+                <param label="Save the log file" name="output_log" type="select" help="Preserve a log with details about the annotation process.">
+                    <option value="FALSE" selected="true">FALSE</option>
+                    <option value="TRUE">TRUE</option>
+                </param>
                 <when value="TRUE">
                     <param name="log_level" type="select" label="Log level"
                            help="Severity of log messages  present in the log file.">
@@ -72,6 +74,7 @@
                         <option value="info" selected="true">INFO</option>
                     </param>
                 </when>
+                <when value="FALSE"></when>
             </conditional>
         </section>
     </inputs>
@@ -81,7 +84,7 @@
             <change_format>
                 <when input="input_file.ext" value="mgf" format="mgf" />
                 <when input="input_file.ext" value="json" format="json" />
-                <when input="input_file.ext" value="csv" format="csv" />
+                <when input="input_file.ext" value="csv" format="tsv" />
                 <when input="input_file.ext" value="tsv" format="tsv" />
                 <when input="input_file.ext" value="xlsx" format="xlsx" />
             </change_format>
@@ -92,7 +95,7 @@
     </outputs>
 
     <tests>
-        <test>
+        <test expect_num_outputs="2">
             <param name="input_file" value="sample.msp" ftype="msp" />
             <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/>
             <output name="output_file" file="sample_out.msp" ftype="msp"/>
@@ -105,4 +108,8 @@
         ]]>
     </help>
 
+    <citations>
+        <citation type="doi">https://doi.org/10.21105/joss.04494</citation>
+    </citations>
+
 </tool>
--- a/msmetaenhancer_wrapper.py	Thu Jun 22 14:10:33 2023 +0000
+++ b/msmetaenhancer_wrapper.py	Mon May 27 12:40:12 2024 +0000
@@ -56,7 +56,10 @@
     if args.file_format == 'xlsx':
         handle_xlsx_file(app, args.output_file)
     else:
-        app.save_data(args.output_file, file_format=args.file_format)
+        if args.file_format == 'csv':
+            app.save_data(args.output_file, file_format="tsv")
+        else:
+            app.save_data(args.output_file, file_format=args.file_format)
     return 0
 
 
--- a/test-data/sample_out.msp	Thu Jun 22 14:10:33 2023 +0000
+++ b/test-data/sample_out.msp	Mon May 27 12:40:12 2024 +0000
@@ -1,9 +1,9 @@
 FORMULA: H2
+MW: 2
 CASNO: 1333-74-0
 ID: 1
 COMMENT: NIST MS# 245692, Seq# M1
 COMPOUND_NAME: Hydrogen
-NOMINAL_MASS: 2
 INCHI: InChI=1S/H2/h1H
 CANONICAL_SMILES: [HH]
 NUM PEAKS: 2
@@ -11,11 +11,11 @@
 2.0         999.0
 
 FORMULA: D2
+MW: 4
 CASNO: 7782-39-0
 ID: 2
 COMMENT: NIST MS# 61316, Seq# M2
 COMPOUND_NAME: Deuterium
-NOMINAL_MASS: 4
 INCHI: InChI=1S/H2/h1H/i1+1D
 CANONICAL_SMILES: [HH]
 NUM PEAKS: 2
@@ -23,11 +23,11 @@
 4.0         999.0
 
 FORMULA: CH4
+MW: 16
 CASNO: 74-82-8
 ID: 3
 COMMENT: Any=100 ; NIST MS# 61313, Seq# M64
 COMPOUND_NAME: Methane
-NOMINAL_MASS: 16
 INCHI: InChI=1S/CH4/h1H4
 CANONICAL_SMILES: C
 NUM PEAKS: 6
@@ -39,11 +39,11 @@
 17.0        15.99
 
 FORMULA: CH4
+MW: 16
 CASNO: 74-82-8
 ID: 4
 COMMENT: Any=100 ; NIST MS# 18807, Seq# R26
 COMPOUND_NAME: Methane
-NOMINAL_MASS: 16
 INCHI: InChI=1S/CH4/h1H4
 CANONICAL_SMILES: C
 NUM PEAKS: 6
@@ -55,11 +55,11 @@
 17.0        10.99
 
 FORMULA: CH4
+MW: 16
 CASNO: 74-82-8
 ID: 5
 COMMENT: Any=100 ; NIST MS# 18809, Seq# R27
 COMPOUND_NAME: Methane
-NOMINAL_MASS: 16
 INCHI: InChI=1S/CH4/h1H4
 CANONICAL_SMILES: C
 NUM PEAKS: 6
@@ -71,11 +71,11 @@
 17.0        11.99
 
 FORMULA: CH4
+MW: 16
 CASNO: 74-82-8
 ID: 6
 COMMENT: Any=100 ; NIST MS# 423924, Seq# R28
 COMPOUND_NAME: Methane
-NOMINAL_MASS: 16
 INCHI: InChI=1S/CH4/h1H4
 CANONICAL_SMILES: C
 NUM PEAKS: 6