Use when you have a large collection of mass spectrometry spectra (m/z
Scanned 9/12/2026
Install to Claude Code
npx -y skills add HolobiomicsLab/asb-skill-collections --skill rapid-spectrum-retrieval-optimization --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Rapid Spectrum Retrieval Optimization?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/holobiomicslab-rapid-spectrum-retrieval-optimization)More formats (shields.io, HTML) on the badges page.
---
name: rapid-spectrum-retrieval-optimization
description: Use when you have a large collection of mass spectrometry spectra (m/z
and intensity pairs) and need to rapidly retrieve similar or candidate spectra from
the archive in response to queries.
license: CC-BY-4.0
metadata:
edam_operation: http://edamontology.org/operation_3945
edam_topics:
- http://edamontology.org/topic_0121
- http://edamontology.org/topic_3520
tools:
- mzBucket
- pyproteolizard-algorithm
- pyproteolizard-data
techniques:
- mass-spectrometry
license_tier: open
provenance_tier: literature
derived_from:
- doi: 10.1186/s12859-022-04833-5
title: mzBucket
evidence_spans: []
claims: []
provenance:
collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
assembled_by: scripts/collect_metabolomics_collection.py
sources:
- build: coll_mzbucket_cq
doi: 10.1186/s12859-022-04833-5
title: mzBucket
dedup_kept_from: coll_mzbucket_cq
schema_version: 0.2.0
attribution:
generator: AgenticScienceBuilder
original_doi: 10.1186/s12859-022-04833-5
all_source_dois:
- 10.1186/s12859-022-04833-5
zenodo_doi: 10.5281/zenodo.20794027
curators: []
promoter: Louis-Félix Nothias
sponsor: CNRS & Université Côte d'Azur
---
# rapid-spectrum-retrieval-optimization
## Summary
Apply locality-sensitive hashing (LSH) to mass spectrometry spectral data to organize m/z and intensity pairs into indexed buckets, enabling sub-linear query time for spectrum retrieval. This skill trades indexing overhead for dramatic speedup in matching or searching large spectral archives.
## When to use
You have a large collection of mass spectrometry spectra (m/z and intensity pairs) and need to rapidly retrieve similar or candidate spectra from the archive in response to queries. LSH is the right choice when linear scan is too slow, exact matching is not required, and approximate nearest-neighbor retrieval is acceptable. Use this when spectral data volume or query throughput makes pre-computed distance matrices infeasible.
## When NOT to use
- Spectra are already pre-filtered or subset to a small set where linear scan is acceptable (< 10⁴ spectra).
- Exact nearest-neighbor results are mandatory and approximate retrieval is not tolerable.
- Spectrum vectorization or normalization is not feasible or domain-appropriate.
## Inputs
- mass spectrometry spectral data (m/z and intensity pairs)
- vectorized spectrum representation (binary or real-valued feature vector)
- LSH parameter specification (number of hash tables, hash functions per table, bucket width)
## Outputs
- LSH index (serialized hash function parameters, bucket assignments, and spectrum-to-bucket mappings)
- query result set: candidate spectra retrieved from LSH buckets
- model file containing indexed LSH structure
## How to apply
Load mass spectrometry spectral data as m/z and intensity pairs and normalize or vectorize each spectrum into a feature representation (e.g., binary or real-valued vector). Initialize LSH hash functions with tuned parameters: number of hash tables (controls recall vs. space trade-off), hash functions per table (affects bucket granularity), and bucket width (controls collision probability). Compute hash values for each spectrum across all hash tables and assign each to corresponding buckets in the LSH index. Serialize the LSH index (hash function parameters, bucket assignments, and spectrum-to-bucket mappings) to a model file. At query time, hash the query spectrum using the same functions and retrieve all candidate spectra from the corresponding buckets, avoiding full-distance computation against the entire archive.
## Related tools
- **mzBucket** (LSH implementation for mass spectrometry spectral indexing and retrieval) — https://github.com/hildebrandtlab/mzBucket
- **pyproteolizard-algorithm** (Provides LSH algorithm component for spectrum hashing and bucketing) — https://github.com/theGreatHerrLebert/proteolizard-algorithm
- **pyproteolizard-data** (Data access and spectrum loading for LSH indexing pipeline) — https://github.com/theGreatHerrLebert/proteolizard-data
## Evaluation signals
- LSH index is successfully serialized and loads without error; hash function parameters and bucket assignments are consistent with input specification.
- Query retrieval time (including hashing) is sub-linear in archive size; typical speedup of 10–100× relative to brute-force distance search.
- Recall (fraction of true nearest neighbors found in LSH candidates) meets or exceeds target threshold (typically 0.8–0.95), determined by parameter tuning against a ground-truth set.
- Bucket occupancy is approximately uniform across hash tables; severe skew (e.g., > 5:1 ratio) indicates poor parameter choice or inadequate data normalization.
- Spectrum-to-bucket mappings are deterministic: identical spectra always hash to identical buckets; re-indexing the same data produces identical index structure.
## Limitations
- LSH quality depends critically on vectorization choice and parameter tuning; poor vector representation or suboptimal hash table/function counts degrade recall and retrieval speed.
- High-dimensional spectra may suffer from the curse of dimensionality; bucket width and collision rates must be empirically validated on representative data.
- Serialized index is specific to the hash function family and parameters; regeneration is required if parameters change or new spectra are added to the archive.
- No built-in mechanism for incremental index updates; batch reindexing is necessary when the spectral archive grows significantly.
## Evidence
- [intro] Locality-sensitive hashing as a mechanism for organizing mass spectrometry data.: "mzBucket implements locality-sensitive hashing as a mechanism for organizing mass spectrometry data."
- [methods] Core LSH workflow for spectra: normalization, hash function setup, bucket assignment, and serialization.: "1. Load mass spectrometry spectral data (m/z and intensity pairs). 2. Normalize or vectorize each spectrum into a representation suitable for LSH (e.g., binary or real-valued feature vector). 3."
- [readme] LSH is applied to mass spectrometry data for efficient retrieval.: "Locality-sensitive hashing for mass spectrometry data."
- [readme] Implementation migration to proteolizard framework for LSH components.: "The implementation has been updated and shifted to the proteolizard framework, more precisely the components pyproteolizard-data for data-access and pyproteolizard-algorithm for the LSH."
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!