# HG changeset patch
# User recetox
# Date 1647963217 0
# Node ID ce612a11b45513e42f07adbe30424c054ac67016
"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/msmetaenhancer commit 26bede767f65ec97ac84b8cc3309db0aced22d53"
diff -r 000000000000 -r ce612a11b455 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Tue Mar 22 15:33:37 2022 +0000
@@ -0,0 +1,106 @@
+
+ 0.2.0
+
+
+
+
+
+
+
+
+
+ smiles` uses PubChem to convert
+ InChI to SMILES.
+
+ 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/.
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r ce612a11b455 msmetaenhancer.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/msmetaenhancer.xml Tue Mar 22 15:33:37 2022 +0000
@@ -0,0 +1,80 @@
+
+ annotate MS data
+
+
+ macros.xml
+
+
+
+
+ msmetaenhancer
+
+
+
+
+
+
+ python3 ${__tool_directory__}/msmetaenhancer_wrapper.py \
+ --input_file "$input_file" \
+ --output_file "$output_file" \
+ #if $options.output_log:
+ --log_file "$log_file"\
+ #end if
+ #if len($ordered_jobs) != 0:
+ #set ordered_jobs = ",".join([str($job.ordered_jobs_select) for $job in $ordered_jobs]) + ","
+ #else:
+ #set ordered_jobs = ""
+ #end if
+ #if $jobs != 'None':
+ #set random_jobs = str($jobs)
+ #else:
+ #set random_jobs = ""
+ #end if
+ #set all_jobs = str($ordered_jobs) + str($random_jobs)
+ --jobs "$all_jobs"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ options['output_log']
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r ce612a11b455 msmetaenhancer_wrapper.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/msmetaenhancer_wrapper.py Tue Mar 22 15:33:37 2022 +0000
@@ -0,0 +1,44 @@
+import argparse
+import asyncio
+import sys
+
+
+from MSMetaEnhancer import Application
+
+
+def main(argv):
+ parser = argparse.ArgumentParser(description="Annotate MSP file.")
+ parser.add_argument("--input_file", type=str, help="Path to query spectra file in MSP format.")
+ parser.add_argument("--output_file", type=str, help="Path to output spectra file.")
+ parser.add_argument("--jobs", type=str, help="Sequence of conversion jobs to be used.")
+ parser.add_argument("--log_file", type=str, help="Path to log with details of the annotation process.")
+ args = parser.parse_args()
+
+ app = Application(log_file=args.log_file)
+
+ # import .msp file
+ app.load_spectra(args.input_file, file_format='msp')
+
+ # curate given metadata
+ app.curate_spectra()
+
+ # specify requested services and jobs
+ services = ['PubChem', 'CTS', 'CIR', 'NLM', 'RDKit', 'IDSM', 'BridgeDB']
+
+ if len(args.jobs) != 0:
+ jobs = []
+ for job in args.jobs.split(","):
+ if len(job) != 0:
+ jobs.append(job.split())
+ asyncio.run(app.annotate_spectra(services, jobs))
+ else:
+ # execute without jobs parameter to run all possible jobs
+ asyncio.run(app.annotate_spectra(services))
+
+ # export .msp file
+ app.save_spectra(args.output_file, file_format="msp")
+ return 0
+
+
+if __name__ == "__main__":
+ main(argv=sys.argv[1:])
diff -r 000000000000 -r ce612a11b455 test-data/sample.msp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample.msp Tue Mar 22 15:33:37 2022 +0000
@@ -0,0 +1,75 @@
+NAME: Hydrogen
+FORMULA: H2
+MW: 2
+CASNO: 1333740
+ID: 1
+COMMENT: NIST MS# 245692, Seq# M1
+NUM PEAKS: 2
+1.0 20.98
+2.0 999.0
+
+NAME: Deuterium
+FORMULA: D2
+MW: 4
+CASNO: 7782390
+ID: 2
+COMMENT: NIST MS# 61316, Seq# M2
+NUM PEAKS: 2
+2.0 14.99
+4.0 999.0
+
+NAME: Methane
+FORMULA: CH4
+MW: 16
+CASNO: 74828
+ID: 3
+COMMENT: Any=100 ; NIST MS# 61313, Seq# M64
+NUM PEAKS: 6
+12.0 37.97
+13.0 105.9
+14.0 203.82
+15.0 886.2
+16.0 999.0
+17.0 15.99
+
+NAME: Methane
+FORMULA: CH4
+MW: 16
+CASNO: 74828
+ID: 4
+COMMENT: Any=100 ; NIST MS# 18807, Seq# R26
+NUM PEAKS: 6
+12.0 25.98
+13.0 85.92
+14.0 170.85
+15.0 855.23
+16.0 999.0
+17.0 10.99
+
+NAME: Methane
+FORMULA: CH4
+MW: 16
+CASNO: 74828
+ID: 5
+COMMENT: Any=100 ; NIST MS# 18809, Seq# R27
+NUM PEAKS: 6
+12.0 7.99
+13.0 28.97
+14.0 74.93
+15.0 753.32
+16.0 999.0
+17.0 11.99
+
+NAME: Methane
+FORMULA: CH4
+MW: 16
+CASNO: 74828
+ID: 6
+COMMENT: Any=100 ; NIST MS# 423924, Seq# R28
+NUM PEAKS: 6
+12.0 25.98
+13.0 74.93
+14.0 152.86
+15.0 829.25
+16.0 999.0
+17.0 10.99
\ No newline at end of file
diff -r 000000000000 -r ce612a11b455 test-data/sample_out.msp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample_out.msp Tue Mar 22 15:33:37 2022 +0000
@@ -0,0 +1,84 @@
+FORMULA: H2
+MW: 2
+CASNO: 1333-74-0
+ID: 1
+COMMENT: NIST MS# 245692, Seq# M1
+COMPOUND_NAME: Hydrogen
+INCHI: InChI=1S/H2/h1H
+CANONICAL_SMILES: [HH]
+NUM PEAKS: 2
+1.0 20.98
+2.0 999.0
+
+FORMULA: D2
+MW: 4
+CASNO: 7782-39-0
+ID: 2
+COMMENT: NIST MS# 61316, Seq# M2
+COMPOUND_NAME: Deuterium
+INCHI: InChI=1S/H2/h1H/i1+1D
+CANONICAL_SMILES: [HH]
+NUM PEAKS: 2
+2.0 14.99
+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
+INCHI: InChI=1S/CH4/h1H4
+NUM PEAKS: 6
+12.0 37.97
+13.0 105.9
+14.0 203.82
+15.0 886.2
+16.0 999.0
+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
+INCHI: InChI=1S/CH4/h1H4
+NUM PEAKS: 6
+12.0 25.98
+13.0 85.92
+14.0 170.85
+15.0 855.23
+16.0 999.0
+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
+INCHI: InChI=1S/CH4/h1H4
+NUM PEAKS: 6
+12.0 7.99
+13.0 28.97
+14.0 74.93
+15.0 753.32
+16.0 999.0
+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
+INCHI: InChI=1S/CH4/h1H4
+NUM PEAKS: 6
+12.0 25.98
+13.0 74.93
+14.0 152.86
+15.0 829.25
+16.0 999.0
+17.0 10.99
+