Mercurial > repos > recetox > msmetaenhancer
changeset 14:646ef66527da draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/msmetaenhancer commit 187cd20cfa1502639fa2678dbcd69d2f3158d436
author | recetox |
---|---|
date | Thu, 29 May 2025 11:21:26 +0000 |
parents | b5467dead5b1 |
children | |
files | macros.xml msmetaenhancer.xml msmetaenhancer_wrapper.py test-data/msme_sample.tsv test-data/msme_sample_out.tabular test-data/sample_out.msp |
diffstat | 6 files changed, 76 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/macros.xml Fri May 31 07:51:40 2024 +0000 +++ b/macros.xml Thu May 29 11:21:26 2025 +0000 @@ -1,5 +1,5 @@ <macros> - <token name="@TOOL_VERSION@">0.4.0</token> + <token name="@TOOL_VERSION@">0.4.1</token> <xml name="creator"> <creator>
--- a/msmetaenhancer.xml Fri May 31 07:51:40 2024 +0000 +++ b/msmetaenhancer.xml Thu May 29 11:21:26 2025 +0000 @@ -1,4 +1,4 @@ -<tool id="msmetaenhancer" name="MSMetaEnhancer" version="@TOOL_VERSION@+galaxy1" profile="21.09"> +<tool id="msmetaenhancer" name="MSMetaEnhancer" version="@TOOL_VERSION@+galaxy0" profile="21.09"> <description>annotate MS data</description> <macros> @@ -26,7 +26,11 @@ <configfile name="msmetaenhancer_python_cli"> python3 ${__tool_directory__}/msmetaenhancer_wrapper.py \ --input_file "$input_file" \ + #if $input_file.ext == "tabular": + --file_format "tsv" \ + #else --file_format "$input_file.ext" \ + #end if --output_file "$output_file" \ #if $options.logging.output_log == "TRUE": --log_file "$log_file" \ @@ -48,7 +52,7 @@ </configfiles> <inputs> - <param label="Input spectra dataset" name="input_file" type="data" format="msp,mgf,json,csv,tsv,xlsx" /> + <param label="Input spectra dataset" name="input_file" type="data" format="msp,mgf,json,csv,tabular,xlsx" /> <repeat name="ordered_jobs" title="Ordered conversions"> <param name="ordered_jobs_select" type="select" label="Available conversions" multiple="false" optional="true"> @@ -80,13 +84,11 @@ </inputs> <outputs> - <data label="MSMetaEnhancer on ${on_string}" name="output_file" format="msp"> + <data label="MSMetaEnhancer on ${on_string}" name="output_file" format_source="input_file"> <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="tsv" /> - <when input="input_file.ext" value="tsv" format="tsv" /> - <when input="input_file.ext" value="xlsx" format="xlsx" /> + <when input="input_file.ext" value="csv" format="tabular" /> + <when input="input_file.ext" value="tsv" format="tabular" /> + <when input="input_file.ext" value="xlsx" format="tabular" /> </change_format> </data> <data label="Log of MSMetaEnhancer on ${on_string}" name="log_file" format="txt"> @@ -100,6 +102,16 @@ <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/> <output name="output_file" file="sample_out.msp" ftype="msp"/> </test> + <test expect_num_outputs="2"> + <param name="input_file" value="msme_sample.tsv" ftype="tsv" /> + <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/> + <output name="output_file" file="msme_sample_out.tabular" ftype="tabular"/> + </test> + <test expect_num_outputs="2"> + <param name="input_file" value="msme_sample.tsv" ftype="tabular" /> + <param name="jobs" value="compound_name inchi PubChem,inchi canonical_smiles PubChem"/> + <output name="output_file" file="msme_sample_out.tabular" ftype="tabular"/> + </test> </tests> <help>
--- a/msmetaenhancer_wrapper.py Fri May 31 07:51:40 2024 +0000 +++ b/msmetaenhancer_wrapper.py Thu May 29 11:21:26 2025 +0000 @@ -56,7 +56,7 @@ if args.file_format == 'xlsx': handle_xlsx_file(app, args.output_file) else: - if args.file_format == 'csv': + if args.file_format in ['csv', 'tsv', 'tabular']: app.save_data(args.output_file, file_format="tsv") else: app.save_data(args.output_file, file_format=args.file_format)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/msme_sample.tsv Thu May 29 11:21:26 2025 +0000 @@ -0,0 +1,7 @@ +comment name id num_peaks casno formula mw +NIST MS# 245692, Seq# M1 Hydrogen 1 2 1333740 H2 2 +NIST MS# 61316, Seq# M2 Deuterium 2 2 7782390 D2 4 +Any=100 ; NIST MS# 61313, Seq# M64 Methane 3 6 74828 CH4 16 +Any=100 ; NIST MS# 18807, Seq# R26 Methane 4 6 74828 CH4 16 +Any=100 ; NIST MS# 18809, Seq# R27 Methane 5 6 74828 CH4 16 +Any=100 ; NIST MS# 423924, Seq# R28 Methane 6 6 74828 CH4 16
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/msme_sample_out.tabular Thu May 29 11:21:26 2025 +0000 @@ -0,0 +1,7 @@ +comment name id num_peaks casno formula mw +NIST MS# 245692, Seq# M1 Hydrogen 1 2 1333-74-0 H2 2 +NIST MS# 61316, Seq# M2 Deuterium 2 2 7782-39-0 D2 4 +Any=100 ; NIST MS# 61313, Seq# M64 Methane 3 6 74-82-8 CH4 16 +Any=100 ; NIST MS# 18807, Seq# R26 Methane 4 6 74-82-8 CH4 16 +Any=100 ; NIST MS# 18809, Seq# R27 Methane 5 6 74-82-8 CH4 16 +Any=100 ; NIST MS# 423924, Seq# R28 Methane 6 6 74-82-8 CH4 16
--- a/test-data/sample_out.msp Fri May 31 07:51:40 2024 +0000 +++ b/test-data/sample_out.msp Thu May 29 11:21:26 2025 +0000 @@ -1,88 +1,88 @@ +COMPOUND_NAME: Hydrogen 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 -1.0 20.98 -2.0 999.0 +1.0 20.98 +2.0 999.0 +COMPOUND_NAME: Deuterium 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 -2.0 14.99 -4.0 999.0 +2.0 14.99 +4.0 999.0 +COMPOUND_NAME: Methane 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 -12.0 37.97 -13.0 105.9 -14.0 203.82 -15.0 886.2 -16.0 999.0 -17.0 15.99 +12.0 37.97 +13.0 105.9 +14.0 203.82 +15.0 886.2 +16.0 999.0 +17.0 15.99 +COMPOUND_NAME: Methane 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 -12.0 25.98 -13.0 85.92 -14.0 170.85 -15.0 855.23 -16.0 999.0 -17.0 10.99 +12.0 25.98 +13.0 85.92 +14.0 170.85 +15.0 855.23 +16.0 999.0 +17.0 10.99 +COMPOUND_NAME: Methane 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 -12.0 7.99 -13.0 28.97 -14.0 74.93 -15.0 753.32 -16.0 999.0 -17.0 11.99 +12.0 7.99 +13.0 28.97 +14.0 74.93 +15.0 753.32 +16.0 999.0 +17.0 11.99 +COMPOUND_NAME: Methane 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 -12.0 25.98 -13.0 74.93 -14.0 152.86 -15.0 829.25 -16.0 999.0 -17.0 10.99 +12.0 25.98 +13.0 74.93 +14.0 152.86 +15.0 829.25 +16.0 999.0 +17.0 10.99