Mercurial > repos > recetox > mzspeclib_convert
changeset 0:02cf8faa2cd2 draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/main/tools/mzspeclib commit 6707579ea4c2d22b625b85c30e5b9705ae142b20
author | recetox |
---|---|
date | Mon, 30 Jun 2025 08:11:59 +0000 |
parents | |
children | |
files | macros.xml mzspeclib_convert.xml test-data/sample.msp test-data/sample.txt test-data/sample_describe_report.txt test-data/sample_validate_report_base.txt test-data/sample_validate_report_consensus.txt |
diffstat | 5 files changed, 288 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Mon Jun 30 08:11:59 2025 +0000 @@ -0,0 +1,23 @@ +<macros> + <token name="@TOOL_VERSION@">1.0.7</token> + + <xml name="creator"> + <creator> + <person + givenName="Helge" + familyName="Hecht" + url="https://github.com/hechth" + identifier="0000-0001-6744-996X" /> + <organization + url="https://www.recetox.muni.cz/" + email="GalaxyToolsDevelopmentandDeployment@space.muni.cz" + name="RECETOX MUNI" /> + </creator> + </xml> + + <xml name="citations"> + <citations> + <citation type="doi">10.1021/acs.analchem.4c04091</citation> + </citations> + </xml> +</macros> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mzspeclib_convert.xml Mon Jun 30 08:11:59 2025 +0000 @@ -0,0 +1,67 @@ +<tool id="mzspeclib_convert" name="mzspeclib convert" version="@TOOL_VERSION@+galaxy0" profile="23.0"> + <description>Convert mass spectra files to mzspeclib format using mzspeclib.</description> + <macros> + <import>macros.xml</import> + </macros> + <xrefs> + <xref type="bio.tools">mzspeclib</xref> + </xrefs> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">mzspeclib</requirement> + </requirements> + + <command detect_errors="exit_code"><![CDATA[ + mzspeclib convert -i ${input.ext} -f text ${input} ${output} + ]]></command> + + <inputs> + <param name="input" type="data" format="msp,json" label="Input file" help="Input mass spectral library file to be converted."/> + </inputs> + + <outputs> + <data name="output" format="txt"/> + </outputs> + + <tests> + <test> + <param name="input" value="sample.msp" ftype="msp"/> + <output name="output" file="sample.txt" compare="diff" lines_diff="2"/> + </test> + </tests> + + <help><![CDATA[ +.. _mzspeclib_convert: + +========================== +mzspeclib Convert Tool +========================== + +**Tool Description** + +This tool converts mass spectra files to the mzspeclib format using the mzspeclib library. It supports conversion from common formats such as MSP and JSON to the standardized mzspeclib text format, enabling interoperability and downstream analysis. + +Inputs +------ + +- **Input file** + The mass spectra file to be converted. Supported formats: MSP, JSON. + +Outputs +------- + +- **Output file** + The converted file in mzspeclib text format. + +Example +------- + +Suppose you have a file `example.msp` containing mass spectra. Upload this file as input and run the tool. The output will be a text file in mzspeclib format, ready for use in compatible tools and workflows. + +Notes +----- + +- Ensure your input file is in a supported format (MSP or JSON). +- The output file can be used for downstream processing with mzspeclib and other compatible tools. + ]]></help> + <expand macro="citations"/> +</tool> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sample.msp Mon Jun 30 08:11:59 2025 +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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sample.txt Mon Jun 30 08:11:59 2025 +0000 @@ -0,0 +1,118 @@ +<mzSpecLib> +MS:1003186|library format version=1.0 +MS:1003188|library name=dataset_37ac08b5-2367-4c10-9dc7-7750885ff733.dat +<AttributeSet Spectrum=all> +<AttributeSet Analyte=all> +<AttributeSet Interpretation=all> +<Spectrum=1> +MS:1003061|library spectrum name=Hydrogen +MS:1003059|number of peaks=2 +[1]MS:1003275|other attribute name=CASNO +[1]MS:1003276|other attribute value=1333740 +[2]MS:1003275|other attribute name=ID +[2]MS:1003276|other attribute value=1 +[3]MS:1003275|other attribute name=COMMENT +[3]MS:1003276|other attribute value=NIST MS# 245692, Seq# M1 +<Analyte=1> +MS:1000866|molecular formula=H2 +MS:1003243|adduct ion mass=2 +<Peaks> +1.0 20.98 ? +2.0 999.0 ? + +<Spectrum=2> +MS:1003061|library spectrum name=Deuterium +MS:1003059|number of peaks=2 +[1]MS:1003275|other attribute name=CASNO +[1]MS:1003276|other attribute value=7782390 +[2]MS:1003275|other attribute name=ID +[2]MS:1003276|other attribute value=2 +[3]MS:1003275|other attribute name=COMMENT +[3]MS:1003276|other attribute value=NIST MS# 61316, Seq# M2 +<Analyte=1> +MS:1000866|molecular formula=D2 +MS:1003243|adduct ion mass=4 +<Peaks> +2.0 14.99 ? +4.0 999.0 ? + +<Spectrum=3> +MS:1003061|library spectrum name=Methane +MS:1003059|number of peaks=6 +[1]MS:1003275|other attribute name=CASNO +[1]MS:1003276|other attribute value=74828 +[2]MS:1003275|other attribute name=ID +[2]MS:1003276|other attribute value=3 +[3]MS:1003275|other attribute name=COMMENT +[3]MS:1003276|other attribute value=Any=100 ; NIST MS# 61313, Seq# M64 +<Analyte=1> +MS:1000866|molecular formula=CH4 +MS:1003243|adduct ion mass=16 +<Peaks> +12.0 37.97 ? +13.0 105.9 ? +14.0 203.82 ? +15.0 886.2 ? +16.0 999.0 ? +17.0 15.99 ? + +<Spectrum=4> +MS:1003061|library spectrum name=Methane +MS:1003059|number of peaks=6 +[1]MS:1003275|other attribute name=CASNO +[1]MS:1003276|other attribute value=74828 +[2]MS:1003275|other attribute name=ID +[2]MS:1003276|other attribute value=4 +[3]MS:1003275|other attribute name=COMMENT +[3]MS:1003276|other attribute value=Any=100 ; NIST MS# 18807, Seq# R26 +<Analyte=1> +MS:1000866|molecular formula=CH4 +MS:1003243|adduct ion mass=16 +<Peaks> +12.0 25.98 ? +13.0 85.92 ? +14.0 170.85 ? +15.0 855.23 ? +16.0 999.0 ? +17.0 10.99 ? + +<Spectrum=5> +MS:1003061|library spectrum name=Methane +MS:1003059|number of peaks=6 +[1]MS:1003275|other attribute name=CASNO +[1]MS:1003276|other attribute value=74828 +[2]MS:1003275|other attribute name=ID +[2]MS:1003276|other attribute value=5 +[3]MS:1003275|other attribute name=COMMENT +[3]MS:1003276|other attribute value=Any=100 ; NIST MS# 18809, Seq# R27 +<Analyte=1> +MS:1000866|molecular formula=CH4 +MS:1003243|adduct ion mass=16 +<Peaks> +12.0 7.99 ? +13.0 28.97 ? +14.0 74.93 ? +15.0 753.32 ? +16.0 999.0 ? +17.0 11.99 ? + +<Spectrum=6> +MS:1003061|library spectrum name=Methane +MS:1003059|number of peaks=6 +[1]MS:1003275|other attribute name=CASNO +[1]MS:1003276|other attribute value=74828 +[2]MS:1003275|other attribute name=ID +[2]MS:1003276|other attribute value=6 +[3]MS:1003275|other attribute name=COMMENT +[3]MS:1003276|other attribute value=Any=100 ; NIST MS# 423924, Seq# R28 +<Analyte=1> +MS:1000866|molecular formula=CH4 +MS:1003243|adduct ion mass=16 +<Peaks> +12.0 25.98 ? +13.0 74.93 ? +14.0 152.86 ? +15.0 829.25 ? +16.0 999.0 ? +17.0 10.99 ? +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sample_describe_report.txt Mon Jun 30 08:11:59 2025 +0000 @@ -0,0 +1,5 @@ +Describing "/tmp/tmpl5cf8gh4/files/c/6/5/dataset_c6563ebf-2d17-451d-a1ba-b3f19426818f.dat" +Format: text +Spectrum Count: 6 +MS:1003186|library format version=1.0 +MS:1003188|library name=dataset_37ac08b5-2367-4c10-9dc7-7750885ff733.dat