agentsclimarketplace

Spectral intensity normalisation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/spectral-intensity-normalisation

Use when processing raw MS/MS spectra (in MGF, mzML, mzXML, JSON, or MSP format) prior to MS2Query library matching or MS2Deepscore embedding calculation.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill spectral-intensity-normalisation

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

  • 15 stars15 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.6 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

spectral-intensity-normalisation

Summary

Standardization of peak intensities across raw MS/MS spectra to a uniform scale before library matching. This preprocessing step ensures that spectral similarity scoring and analogue detection are not biased by differences in absolute intensity values across query spectra.

When to use

Apply this skill when processing raw MS/MS spectra (in MGF, mzML, mzXML, JSON, or MSP format) prior to MS2Query library matching or MS2Deepscore embedding calculation. Normalization is essential when query spectra originate from different instruments, acquisition conditions, or have varying dynamic ranges that could otherwise skew cosine similarity and random forest re-ranking scores.

When NOT to use

  • Input spectra are already normalized or pre-processed by an upstream tool (e.g., GNPS or MZmine output already includes normalization).
  • Relative intensity ranking rather than absolute scale is the only concern; in that case, rank-based normalization may be more appropriate than intensity scaling.
  • Peak picking or noise filtering have not yet been performed; normalization should follow clustering and feature selection, not precede it.

Inputs

  • Raw MS/MS spectra (MGF, mzML, mzXML, JSON, or MSP format)
  • Peak list with m/z and intensity values
  • Metadata including precursor m/z and ionization mode

Outputs

  • Normalized MS/MS spectra with standardized intensity scale
  • Preprocessed spectrum objects compatible with MS2Deepscore and MS2Query matching

How to apply

After peak picking and feature selection (e.g., via MZmine clustering), load raw query spectra and apply intensity normalization to standardize spectral peak heights to a common scale. The normalization should be applied sequentially within a preprocessing pipeline before spectral similarity scoring. MS2Query does not perform peak picking internally, so normalization must be part of an upstream or integrated preprocessing step. Verify that normalized spectra retain the relative intensity relationships between peaks while bringing absolute intensities into a comparable range suitable for the MS2Deepscore embeddings and random forest model that re-ranks library matches.

Related tools

  • MS2Query (Performs spectral-based library matching on preprocessed (normalized) query spectra using MS2Deepscore embeddings and random forest re-ranking) — https://github.com/iomega/ms2query
  • MZmine (Performs upstream peak picking, clustering, and feature selection to reduce redundant spectra before normalization and MS2Query processing)
  • matchms (Python library for spectrum object representation and manipulation, supports normalization operations on MS/MS spectra)

Evaluation signals

  • Normalized spectra have maximum intensity peaks within expected range (e.g., 0–1 or 0–100) across all query spectra.
  • Relative peak height ratios within individual spectra are preserved after normalization (compare rank order before and after).
  • MS2Query model prediction scores and library match rankings remain consistent or improve when normalized spectra are compared to non-normalized query spectra (validated on dummy or benchmark datasets).
  • No spectra are lost or truncated during normalization; output spectrum count equals input count.
  • Normalized spectra pass schema validation and format checks required by MS2Query and MS2Deepscore (e.g., all peaks have m/z and intensity values, no NaN or inf values).

Limitations

  • MS2Query documentation does not explicitly detail the normalization function signature or algorithm used internally; practitioners must implement or choose normalization logic independently based on domain knowledge.
  • Normalization effectiveness depends on upstream peak picking quality; poor peak detection or excessive noise cannot be fully corrected by intensity scaling alone.
  • The optimal normalization method may vary by ionization mode (positive vs. negative) and instrument type, requiring validation on reference spectra for each experimental context.
  • Normalized spectra are no longer directly comparable to raw intensity measurements; archival of raw spectra is necessary for reproducibility and manual validation.

Evidence

  • [readme] MS2Query does not do any peak picking or clustering of similar MS2 spectra. If your files contain many MS2 spectra per feature it is advised to first reduce the number of MS2 spectra by clustering or feature selection.: "MS2Query does not do any peak picking or clustering of similar MS2 spectra. If your files contain many MS2 spectra per feature it is advised to first reduce the number of MS2 spectra by clustering or"
  • [other] 1. Define spectrum pre-processing function signatures for normalisation and filtering operations on raw query spectral data. 2. Implement normalisation logic to standardize spectral intensities across raw query spectra.: "Define spectrum pre-processing function signatures for normalisation and filtering operations on raw query spectral data. Implement normalisation logic to standardize spectral intensities across raw"
  • [other] Validate cleaned spectra meet expected format and quality criteria before library matching.: "Validate cleaned spectra meet expected format and quality criteria before library matching."
  • [readme] The top 2000 spectra with the highest MS2Deepscore are selected. MS2Query optimizes re-ranking the best analogue or exact match at the top by using a random forest that combines 5 features.: "The top 2000 spectra with the highest MS2Deepscore are selected. MS2Query optimizes re-ranking the best analogue or exact match at the top by using a random forest that combines 5 features."
  • [readme] As input for MS2Query you can use the MGF file of the FBMN output of MZMine: "As input for MS2Query you can use the MGF file of the FBMN output of MZMine"

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 325,949. 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.