agentsclimarketplace

Global similarity aggregation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/global-similarity-aggregation

Use when after computing pairwise cosine similarities between all spectra across two LC-MS/MS datasets when you need a single scalar summary of dataset-level resemblance rather than individual spectrum matches.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill global-similarity-aggregation

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.3 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Global Similarity Aggregation

Summary

Aggregate pairwise spectral similarity scores across two tandem mass spectrometry datasets into a single global metric that quantifies overall dataset resemblance. This skill enables rapid, reference-independent comparison of LC-MS/MS proteomes for phylogenetics, quality control, and species identification.

When to use

Apply this skill after computing pairwise cosine similarities between all spectra across two LC-MS/MS datasets when you need a single scalar summary of dataset-level resemblance rather than individual spectrum matches. Use it when comparing proteomes from different organisms, tissues, or experimental conditions and you want to avoid database or spectral library dependencies.

When NOT to use

  • When you require individual spectrum-to-spectrum matches or identifications rather than a dataset-level summary.
  • When comparing a single spectrum to a library or database; use spectrum–library matching instead.
  • When input spectra are not yet normalized or when retention time and m/z calibration are unreliable across datasets; normalize and validate first.

Inputs

  • two tandem mass spectrometry datasets in mzML or mzXML format
  • precursor mass, retention time, and fragment ion peak data extracted and parsed from each spectrum
  • normalized fragment ion intensity vectors (normalized independently per spectrum)
  • pairwise cosine similarity matrix computed across all spectra between the two datasets

Outputs

  • global spectral similarity score (single scalar value)
  • pairwise similarity distribution statistics (e.g., mean, median, standard deviation)
  • count of high-scoring spectrum pairs (above a similarity threshold)
  • results file containing global score and supporting statistics

How to apply

After normalizing fragment ion intensities within each spectrum and computing pairwise cosine similarities using normalized m/z and intensity vectors across all spectra in two datasets, select an aggregation function—mean, median, or percentile-based score—to reduce the distribution of pairwise similarities to a single value. The choice of aggregation depends on robustness requirements: mean is simple but sensitive to outliers; median is more robust; percentile-based (e.g., 90th percentile) emphasizes high-confidence matches. Record supporting statistics alongside the global score, including the pairwise similarity distribution shape and count of high-scoring pairs (e.g., cosine > 0.7), to enable diagnostic interpretation and reproducibility.

Related tools

Evaluation signals

  • Global similarity score is a scalar in the valid range [0, 1] (or normalized equivalent) reflecting the proportion of similar spectra between datasets.
  • Pairwise similarity distribution statistics are computed and reported; median and mean should be interpretable and differ as expected given the spectrum population.
  • Count of high-scoring pairs (similarity above threshold) is positive when datasets share proteomes and near-zero when datasets are dissimilar; trend aligns with biological expectation.
  • Results file contains all supporting statistics alongside global score; reproducibility is enabled by recording preprocessing parameters (normalization method, cosine threshold used for counting).
  • When applied to replicate samples or identical datasets, global similarity approaches 1.0; distance (inverse) approaches 0.

Limitations

  • Aggregation choices (mean vs. median vs. percentile) can yield different global scores from the same pairwise distribution; method must be pre-specified and justified.
  • Global similarity is sensitive to differences in spectral coverage and abundance (protein quantity), not just amino acid sequence; datasets with identical proteomes but different protein expression will have lower similarity than expected.
  • No changelog or version tracking information is available in the compareMS2 repository, limiting reproducibility across software updates.
  • Similarity is symmetric by default (distance from A to B equals distance from B to A); this assumes equal dataset size and quality, which may not hold for unbalanced comparisons.
  • Threshold parameters for defining 'high-scoring pairs' (e.g., cosine > 0.7) are user-specified; results are sensitive to this choice and must be documented.

Evidence

  • [other] Aggregate pairwise similarities using a global similarity metric (e.g., mean, median, or percentile-based score) to produce a single global spectral similarity value.: "Aggregate pairwise similarities using a global similarity metric (e.g., mean, median, or percentile-based score) to produce a single global spectral similarity value."
  • [other] Write the global similarity score and supporting statistics (e.g., pairwise similarity distribution, number of high-scoring pairs) to a results file.: "Write the global similarity score and supporting statistics (e.g., pairwise similarity distribution, number of high-scoring pairs) to a results file."
  • [other] compareMS2 calculates the global similarity between tandem mass spectrometry datasets, taking two such datasets as input and producing a similarity score as output.: "compareMS2 calculates the global similarity between tandem mass spectrometry datasets, taking two such datasets as input and producing a similarity score as output."
  • [readme] Data with identical spectral content thus have similarity 1 and distance 0. The similarity of datasets with no similar spectra tend to 0.: "Data with identical spectral content thus have similarity 1 and distance 0. The similarity of datasets with no similar spectra tend to 0."
  • [readme] not only the amino acid sequences of the peptides affect the distance metric in compareMS2, but also the abundance (or coverage) of the proteins.: "not only the amino acid sequences of the peptides affect the distance metric in compareMS2, but also the abundance (or coverage) of the proteins."

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.