agentsclimarketplace

Mzml file format writing

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/mzml-file-format-writing

Use when you have peak properties (mass, intensity, retention time) for biomolecules, selected noise and fragmentation models, and instrument parameters (e.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mzml-file-format-writing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.9 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

mzml-file-format-writing

Summary

Write synthetic LC-MS/MS data to mzML format by integrating peak-property definitions, noise models, and fragmentation models through SMITER's modular design. This skill enables reproducible gold-standard MS dataset generation where ground truth is known.

When to use

You have peak properties (mass, intensity, retention time) for biomolecules, selected noise and fragmentation models, and instrument parameters (e.g., gradient_length), and you need to generate a synthetic LC-MS/MS dataset in mzML format for algorithm validation, parameter optimization, or co-elution/co-fragmentation prediction studies.

When NOT to use

  • Input peak properties lack chemical formula information — SMITER's isotopic patterns and fragmentation rely on accurate chemical formulas via pyQms.
  • You are processing real experimental MS data rather than generating synthetic data — this skill is for simulation, not import/conversion of existing acquisitions.
  • Fragmentation rules for your biomolecule type are not available (SMITER provides peptide and nucleoside models; other classes require custom fragmentor implementation).

Inputs

  • peak properties dictionary (mass, intensity, retention-time per analyte)
  • CSV file containing analyte properties (optional; convert via csv_to_peak_properties)
  • fragmentor object (PeptideFragmentor, nucleoside fragmentation model, or custom)
  • noise injector object (UniformNoiseInjector or custom intensity-specific noise model)
  • general simulation parameters (gradient_length, instrument configuration)

Outputs

  • synthetic mzML file (LC-MS/MS dataset in mzML format)
  • gold-standard MS dataset with known ground truth

How to apply

First, load or construct peak properties (mass, intensity, retention time) for analytes, optionally converting from CSV via smiter.lib.csv_to_peak_properties. Second, instantiate a fragmentor object (e.g., fragmentation_functions.PeptideFragmentor for peptides or nucleoside fragmentation model) to define fragmentation rules. Third, instantiate a noise generator (e.g., smiter.noise_functions.UniformNoiseInjector or intensity-specific noise model) to model instrument noise. Fourth, define general simulation parameters including gradient_length and other instrument-configuration settings. Finally, call smiter.synthetic_mzml.write_mzml with the peak properties, noise injector, fragmentor, and general parameters to execute the modular simulation pipeline and write the output mzML file. The modular design allows substitution of default noise/fragmentation models with custom implementations.

Related tools

  • SMITER (Primary tool; orchestrates peak properties, noise, and fragmentation models to write synthetic mzML files) — https://github.com/LeidelLab/SMITER
  • pyQms (Dependency for highly-accurate isotopic pattern calculation used by SMITER) — https://github.com/pyQms/pyqms
  • Python (Runtime environment and scripting language for SMITER)

Examples

from smiter.lib import csv_to_peak_properties; from smiter.fragmentation_functions import PeptideFragmentor; from smiter.noise_functions import UniformNoiseInjector; from smiter.synthetic_mzml import write_mzml; peaks = csv_to_peak_properties('example_data.csv'); write_mzml(peaks, UniformNoiseInjector(), PeptideFragmentor(), 'output.mzML', gradient_length=30)

Evaluation signals

  • Output mzML file is valid XML and compliant with mzML schema (parseable by standard MS software).
  • Synthetic peak m/z values match input chemical formulas with expected isotopic fine structure via pyQms.
  • Noise injection produces expected intensity ranges or distributions (uniform or intensity-specific noise model as selected).
  • Fragmentation spectra (MS2) contain expected peptide b/y ions or nucleoside fragments consistent with selected fragmentor rules.
  • Retention time values in output file match input peak properties; gradient_length parameter correctly scales RT distribution.

Limitations

  • SMITER supports peptide and modified nucleoside fragmentation by default; other biomolecule classes require custom fragmentor implementation.
  • Retention time prediction is not built-in; external modules (e.g., deep learning models) must be integrated for realistic RT simulation.
  • Noise models are simplified (uniform or intensity-specific); real instrument noise complexity may not be fully captured.
  • No changelog documented; version history and breaking changes not formally tracked across releases.

Evidence

  • [other] Peak-property definitions, noise models, and fragmentation models integration: "SMITER's write_mzml function executes the final simulation step by accepting peak-property definitions along with selectable noise and fragmentation models, which are integrated through a modular"
  • [readme] Modular design for custom noise and fragmentation: "As SMITER features a modular design, noise and fragmentation models can easily be implemented or adapted."
  • [readme] Gold-standard dataset purpose: "This allows for the facile creation of defined gold-standard-LC-MS/MS datasets for any type of experiment. Such gold standards, where the ground truth is known, are required in computational mass"
  • [readme] Chemical formula basis and isotopic accuracy: "It enables the simulation of any biomolecule since all calculations are based on the chemical formulas. ...usage of highly-accurate isotopic patterns enabled by pyQms"
  • [other] Five-step workflow for write_mzml: "1. create the peak properties dict...2. Choose a fragmentor...3. Choose a Noise generator...4. Define general params...5. Run the simulation and write the resulting mzML using"
  • [readme] Co-elution and co-fragmentation prediction use case: "Similarly, gold-standard datasets can be used to evaluate analytical hurdles e.g. by predicting co-elution and co-fragmentation of molecules."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,834. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.