agentsclimarketplace

Mass spectrum similarity scoring

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/mass-spectrum-similarity-scoring

Use when when you have a query MS/MS spectrum (m/z and intensity pairs) that you need to match against a library of reference spectra, and you want to identify the -matching library entry while accounting for unmatched peaks that may indicate spectral contamination or chimerism.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mass-spectrum-similarity-scoring

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

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

mass-spectrum-similarity-scoring

Summary

Quantify the similarity between query and library MS/MS spectra using penalty-factor-enhanced scoring that balances spectral match sensitivity against quality control. This skill is essential for disambiguating chimeric spectra in metabolite annotation workflows.

When to use

When you have a query MS/MS spectrum (m/z and intensity pairs) that you need to match against a library of reference spectra, and you want to identify the best-matching library entry while accounting for unmatched peaks that may indicate spectral contamination or chimerism. Apply this skill when standard symmetric spectral search is insufficient and you need to penalize low-quality matches containing unmatched fragment ions.

When NOT to use

  • When the input spectra are already pre-filtered or consensus spectra with chimeric fragments removed by other means—the penalty factor is designed to detect and downweight chimerism, not to handle already-clean spectra.
  • When you need symmetric scoring only (query→library and library→query must yield identical scores); the reverse search penalty mechanism is asymmetric by design to favor library-explained peaks.

Inputs

  • Query MS/MS spectrum (m/z-intensity pairs)
  • Library MS/MS spectrum (m/z-intensity pairs)
  • m/z tolerance threshold (numeric, typically in ppm or Da)
  • Penalty factor coefficient (numeric, 0–1 range typical)

Outputs

  • Penalized match score (scalar float)
  • List of matched peak pairs (m/z_query, m/z_library, intensity_query, intensity_library)
  • Unmatched peaks in query spectrum

How to apply

Load the query MS/MS spectrum and the library MS/MS spectrum as paired m/z and intensity values. Specify an m/z tolerance threshold (e.g., typical values in the repository code) for peak matching. Identify matched peaks between query and library within the tolerance window. Calculate the base match score using cosine similarity, entropy similarity, or Bhattacharyya angle—all three are implemented in the reverse_search repository. For each unmatched peak in the query spectrum (peaks with no library counterpart within tolerance), apply a penalty factor to the base score. The penalty factor mechanism increases the number of spectral matches identified while maintaining rigorous quality control by downweighting spectra with unexplained fragment ions. Return the final penalized match score as a scalar value; higher scores indicate better-quality matches less likely to be chimeric.

Related tools

Evaluation signals

  • Matched peaks are within the specified m/z tolerance threshold for both query and library m/z values.
  • Unmatched peaks identified in the query spectrum have no counterpart in the library within tolerance; verify the list is complete by checking query peaks against library peaks exhaustively.
  • Final penalized match score is lower than the base match score (before penalty); the reduction magnitude correlates with the number and intensity of unmatched peaks.
  • Spectra with few unmatched peaks receive higher scores than spectra with many unmatched peaks, indicating improved discrimination of chimeric spectra.
  • The returned score is a scalar between 0 and 1 (or as normalized by the chosen similarity metric); verify it falls within the expected range for your metric.

Limitations

  • Penalty factor effectiveness depends on correct specification of the m/z tolerance threshold; overly loose thresholds may mask chimerism, while overly tight thresholds may artificially penalize valid matches due to instrument calibration drift.
  • The penalty mechanism assumes unmatched peaks are true contaminants; peaks from post-translational modifications, adducts, or loss products not represented in the library will be penalized even if genuine.
  • No changelog is available in the repository, limiting reproducibility across versions and making it difficult to track when penalty-factor parameters were modified.

Evidence

  • [readme] Chimeric spectra are ubiquitous in MS/MS data, which compromises the quality and reliability of MS/MS matching-based metabolite annotation: "Chimeric spectra are ubiquitous in MS/MS data, which compromises the quality and reliability of MS/MS matching-based metabolite annotation."
  • [readme] enhanced the reverse search by introducing a penalty factor to unmatched peaks, which increases the number of spectral matches while maintaining rigorous quality control: "enhanced the reverse search by introducing a penalty factor to unmatched peaks, which increases the number of spectral matches while maintaining rigorous quality control."
  • [other] The reverse spectral search enhancement applies a penalty factor to unmatched peaks in the match scoring calculation, designed to increase spectral matches while maintaining rigorous quality control standards.: "The reverse spectral search enhancement applies a penalty factor to unmatched peaks in the match scoring calculation, designed to increase spectral matches while maintaining rigorous quality control"
  • [other] Identify matched peaks between query and library using a specified m/z tolerance threshold. Calculate the base match score from matched peak pairs (e.g., cosine similarity or intensity-weighted sum). Identify unmatched peaks in the query spectrum that have no corresponding library peak within tolerance. Apply a penalty factor to the base match score for each unmatched peak to reduce the final score.: "Identify matched peaks between query and library using a specified m/z tolerance threshold. Calculate the base match score from matched peak pairs (e.g., cosine similarity or intensity-weighted sum)."

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.