Peak intensity normalization
Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/peak-intensity-normalization
Use when you have raw MS/MS spectral peak lists with absolute intensity values and need to compare spectra using entropy similarity, dot product, or other distance metrics.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill peak-intensity-normalizationAssembled 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.1 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
peak-intensity-normalization
Summary
Normalize MS/MS spectral peak intensities to a common scale (typically 0–1 or 0–100%) to enable fair comparison between spectra with different total intensities. This preprocessing step is essential before computing spectral similarity metrics, as it removes the confounding effect of absolute intensity differences and ensures that entropy similarity and other distance metrics depend only on peak distribution patterns.
When to use
Apply this skill when you have raw MS/MS spectral peak lists with absolute intensity values and need to compare spectra using entropy similarity, dot product, or other distance metrics. Normalization is required before benchmarking spectral similarity methods, as unnormalized intensities introduce bias toward spectra with higher total signal. Use it as a standard preprocessing step in any compound identification workflow using the SpectralEntropy or MSEntropy packages.
When NOT to use
- Input spectra are already normalized (peak intensities already in [0, 1] or [0, 100] range)
- Your analysis requires preservation of absolute intensity information for quantification or external calibration
- You are comparing spectra from different ionization modes or instruments where intensity scales must be preserved for instrument-specific corrections
Inputs
- raw MS/MS spectral peak lists (m/z and intensity pairs, one or multiple spectra)
- absolute intensity values (e.g., from .mgf, .msp, .mzML, or .lbm2 files)
Outputs
- normalized MS/MS spectral peak lists (m/z and normalized intensity pairs, range [0, 1] or [0, 100])
- per-spectrum maximum intensity metadata (for audit and verification)
How to apply
Load raw MS/MS spectral data containing m/z and intensity pairs. Identify the maximum intensity value within each spectrum. Divide all peak intensities in that spectrum by the maximum intensity value, scaling them to the range [0, 1]. Optionally multiply by 100 to express as a percentage scale [0, 100]. Apply this normalization independently to each spectrum in your dataset—do not normalize across spectra or against a reference library spectrum, as each spectrum is normalized relative to its own maximum. After normalization, verify that the highest intensity peak in each spectrum equals 1.0 (or 100 if percentage-scaled). This normalization is a prerequisite for subsequent noise filtering (e.g., removing peaks <1% of maximum intensity) and for accurate entropy similarity computation.
Related tools
- MSEntropy (Python package that incorporates peak intensity normalization as part of spectral preprocessing before entropy similarity computation) — https://github.com/YuanyueLi/MSEntropy
- SpectralEntropy (Original repository containing spectral_similarity and ms_distance modules that operate on normalized spectral peak intensities) — https://github.com/YuanyueLi/SpectralEntropy
- spectral_similarity module (Computes entropy similarity and dot product metrics on normalized peak intensity data) — https://github.com/YuanyueLi/SpectralEntropy
Evaluation signals
- Maximum intensity in each normalized spectrum equals exactly 1.0 (or 100.0 if percentage-scaled); no spectrum has intensity > 1.0
- All peak intensities fall within the expected range [0, 1] or [0, 100]; no negative values or out-of-range outliers
- Entropy similarity scores computed on normalized spectra fall within the expected range [0, 1] and match reference outputs for known spectrum pairs
- Spectral entropy values computed on normalized spectra are reproducible and consistent with published benchmarks
- Peak ranking and relative intensity relationships are preserved—the peak with the highest original intensity remains the highest after normalization
Limitations
- Normalization does not address potential artifacts in very low-intensity regions; additional noise filtering (e.g., removing peaks <1% of maximum intensity) is recommended after normalization
- For spectra with very weak signals or high noise floors, normalization may amplify baseline noise; consider quality filtering before normalization
- Normalization is independent per spectrum and does not account for batch effects, instrumental drift, or systematic intensity biases across a spectral library; additional calibration may be needed for cross-instrument comparisons
Evidence
- [other] Before calculating spectral similarity, it's highly recommended to remove spectral noise. For example, peaks have intensity less than 1% maximum intensity can be removed: "Before calculating spectral similarity, it's highly recommended to remove spectral noise. For example, peaks have intensity less than 1% maximum intensity can be removed to improve identificaiton"
- [other] Prepare input MS/MS spectral data by removing spectral noise using the recommended filter of peaks with intensity less than 1% of maximum intensity.: "Prepare input MS/MS spectral data by removing spectral noise using the recommended filter of peaks with intensity less than 1% of maximum intensity."
- [other] The entropy similarity function from the spectral_similarity module computes the similarity score between two preprocessed MS/MS spectra (with noise removed: peaks <1% of maximum intensity filtered).: "Load two preprocessed MS/MS spectra (with noise removed: peaks <1% of maximum intensity filtered) from input files."
- [readme] Spectral entropy is an useful property to measure the complexity of a spectrum. Entropy similarity, which measured spectral similarity based on spectral entropy, has been shown to outperform dot product similarity in compound identification.: "
Entropy similarity, which measured spectral similarity based on spectral entropy, has been shown to outperform dot product similarity in compound identification."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.