changeset 0:884e26ef99ce 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:44 +0000
parents
children
files macros.xml mzspeclib_validate.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, 302 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:44 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_validate.xml	Mon Jun 30 08:11:44 2025 +0000
@@ -0,0 +1,81 @@
+<tool id="mzspeclib_validate" name="mzspeclib validate" version="@TOOL_VERSION@+galaxy0" profile="23.0">
+    <description>Validate mzspeclib files for format and content correctness 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 validate -i mzspeclib.${input.ext} ${profile} ${input} > ${output}
+    ]]></command>
+
+    <inputs>
+        <param name="input" type="data" format="txt,json" label="Input mzspeclib file" help="Input mzspeclib file (text or JSON) to be validated."/>
+        <param name="profile" type="select" label="Validation profile" help="Choose the validation profile to use for checking the mzspeclib file.">
+            <option value="" selected="true">base</option>
+            <option value="-p consensus">consensus</option>
+            <option value="-p single">single</option>
+            <option value="-p silver">silver</option>
+            <option value="-p peptide">peptide</option>
+            <option value="-p gold">gold</option>
+        </param>
+    </inputs>
+
+    <outputs>
+        <data name="output" format="txt"/>
+    </outputs>
+
+    <tests>
+        <test>
+            <param name="input" value="sample.txt"/>
+            <output name="output" file="sample_validate_report_base.txt"/>
+        </test>
+
+        <test>
+            <param name="input" value="sample.txt"/>
+            <param name="profile" value="-p consensus"/>
+            <output name="output" file="sample_validate_report_consensus.txt"/>
+        </test>
+    </tests>
+
+    <help><![CDATA[
+.. _mzspeclib_validate:
+
+==========================
+mzspeclib Validate Tool
+==========================
+
+**Tool Description**
+
+This tool validates mzspeclib files for format and content correctness using the mzspeclib library. It checks that the input file conforms to the mzspeclib specification and reports any errors or warnings found.
+
+Inputs
+------
+
+- **Input mzspeclib file**  
+  The mzspeclib file to be validated. Supported formats: text (txt), JSON.
+
+Outputs
+-------
+
+- **Validation report**  
+  A text file containing the results of the validation, including any errors or warnings.
+
+Example
+-------
+
+Suppose you have a file `sample.txt` in mzspeclib text format. Upload this file as input and run the tool. The output will be a validation report listing any issues found in the file.
+
+Notes
+-----
+
+- Ensure your input file is in mzspeclib text or JSON format.
+- Use this tool to check your mzspeclib files before sharing or using them in downstream workflows.
+    ]]></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:44 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:44 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:44 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