agentsclimarketplace

Tandem mass spectrum normalization

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/tandem-mass-spectrum-normalization

Use when preparing tandem MS/MS datasets for cross-dataset similarity analysis or spectral matching, particularly when datasets originate from different instruments, acquisition dates, or sample preparation protocols that may introduce systematic variations in peak intensities.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill tandem-mass-spectrum-normalization

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.1 KB, 879 tokens by cl100k_base, as published. Nobody here has run it

tandem-mass-spectrum-normalization

Summary

Normalize fragment ion intensities within individual tandem mass spectra to enable fair pairwise comparison across datasets with varying instrument sensitivities and acquisition conditions. This preprocessing step produces intensity vectors suitable for cosine similarity computation without bias from absolute abundance differences.

When to use

Apply this skill when preparing tandem MS/MS datasets for cross-dataset similarity analysis or spectral matching, particularly when datasets originate from different instruments, acquisition dates, or sample preparation protocols that may introduce systematic variations in peak intensities. Use it before computing pairwise spectral similarities or constructing distance matrices for phylogenetic or quality-control applications.

When NOT to use

  • When absolute quantitative information (e.g., protein abundance, isoform ratios) must be preserved across datasets—normalization removes abundance information.
  • When comparing spectra from the same instrument run with consistent tuning and calibration; normalization within a single homogeneous dataset may introduce noise.
  • When input spectra are already pre-normalized or when the analysis goal is instrument-specific intensity profiling rather than spectral pattern matching.

Inputs

  • tandem mass spectrometry datasets (mzML or mzXML format)
  • parsed spectrum objects containing precursor mass, retention time, and fragment ion peaks (m/z and intensity pairs)

Outputs

  • normalized fragment ion intensity vectors (per spectrum)
  • normalized spectra ready for pairwise cosine similarity computation

How to apply

For each spectrum independently, extract the fragment ion m/z values and their corresponding intensities. Apply a normalization scheme (typically L2 normalization or intensity rank-based rescaling) to scale intensities to a common reference range (e.g., 0–1 or unit vector norm) within that spectrum only. Preserve the m/z axis unchanged; normalize only the intensity dimension. This ensures that two spectra with identical fragment patterns but different absolute intensities produce high cosine similarity, while preventing high-abundance spectra from dominating pairwise comparisons. After normalization, store normalized intensity vectors alongside m/z values for downstream similarity computation.

Related tools

  • compareMS2 (performs pairwise cosine similarity computation on normalized spectra and aggregates similarities into global dataset distance metrics) — https://github.com/524D/compareMS2

Evaluation signals

  • Each normalized spectrum's intensity vector should have unit L2 norm (or fall within [0, 1] if rank/percentile normalization is used)
  • Two spectra with identical m/z values but 10-fold intensity differences should produce cosine similarity ≥ 0.99 after normalization
  • Pairwise similarity distribution should remain bounded in [0, 1] with no negative or out-of-range values
  • Retention time and precursor mass values should remain unchanged after normalization
  • Global similarity scores computed from normalized spectra should be symmetric and reflexive (identical datasets yield distance 0)

Limitations

  • Normalization removes absolute abundance information; cannot be used to quantify protein copy numbers or isoform ratios post-hoc
  • Low-intensity fragment ions (below noise threshold) may be lost or distorted by normalization; noise filtering should precede normalization
  • Choice of normalization scheme (L2, L1, rank-based) affects downstream similarity thresholds and requires instrument-specific validation
  • Normalization assumes all spectra have sufficient signal; spectra with very few or very abundant peaks may become distorted

Evidence

  • [other] Normalize fragment ion intensities within each spectrum independently.: "Normalize fragment ion intensities within each spectrum independently."
  • [other] Compute pairwise cosine similarity between all spectra across the two datasets using normalized m/z and intensity vectors.: "Compute pairwise cosine similarity between all spectra across the two datasets using normalized m/z and intensity vectors."
  • [readme] compareMS2 is a tool for direct comparison of tandem mass spectrometry datasets, typically from liquid chromatography-tandem mass spectrometry (LC-MS/MS), defining similarity as a function of shared (similar) spectra and distance as the inverse of this similarity.: "compareMS2 is a tool for direct comparison of tandem mass spectrometry datasets, typically from liquid chromatography-tandem mass spectrometry (LC-MS/MS), defining similarity as a function of shared"
  • [readme] Data with identical spectral content thus have similarity 1 and distance 0.: "Data with identical spectral content thus have similarity 1 and distance 0."

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.