agentsclimarketplace

Peak validation synthetic data

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/ms-generic/skills/peak-validation-synthetic-data

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill peak-validation-synthetic-data

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

  • 14 stars14 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 author says it does

Copied from the file, not written here

Use when after running a 1D peak detection function (e.g., mzapy.peaks.find_peaks_1d_localmax or mzapy.peaks.find_peaks_1d_gauss) on synthetic mass spectra with known peak locations and heights.

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

Validate peak detection against synthetic ground truth

Summary

Assess the accuracy of 1D peak detection algorithms by comparing detected peaks (count, m/z positions, intensities) against known synthetic peaks generated from a controlled mass spectrum. This validation step ensures peak-finding parameters (threshold, prominence) are appropriately tuned before application to real MS data.

When to use

After running a 1D peak detection function (e.g., mzapy.peaks.find_peaks_1d_localmax or mzapy.peaks.find_peaks_1d_gauss) on synthetic mass spectra with known peak locations and heights. Use this skill when developing or tuning peak detection workflows, or when validating that parameter choices (e.g., scipy.signal.find_peaks threshold and prominence settings) correctly recover expected peaks from controlled inputs.

When NOT to use

  • Input is real MS data without annotated or independently verified ground truth; use orthogonal methods (e.g., known standards, isotope patterns) to establish truth instead.
  • Peak detection has already been validated against independent reference data; re-validation on synthetic data adds no new information.
  • The goal is exploratory peak discovery on real data where ground truth is unknown; use unsupervised metrics (e.g., signal-to-noise ratio, peak width consistency) instead.

Inputs

  • Synthetic 1D mass spectrum (m/z array with intensity values)
  • Known ground-truth peak locations (m/z values and expected heights)
  • Peak detection function output (detected peak indices, heights, prominence values)

Outputs

  • Validation report with detected vs. ground-truth peak counts
  • Peak-by-peak comparison table (detected m/z, intensity, expected m/z, intensity, error)
  • Sensitivity and specificity metrics
  • Tuned peak detection parameters (threshold, prominence) documented for reuse

How to apply

Generate or load a synthetic 1D mass spectrum with a known set of peaks (m/z positions and intensities). Run the peak detection function on the intensity array to extract detected peak indices, heights, and prominence values. Extract the m/z coordinates corresponding to detected peak indices. Compare the detected peaks against ground truth: count the number of peaks detected and check if each falls within an acceptable tolerance (e.g., ±0.1 m/z units, or ±5% intensity error). Compute metrics such as sensitivity (fraction of true peaks detected) and specificity (fraction of detected peaks that match ground truth). Adjust threshold and prominence parameters iteratively if the detection rate falls below acceptable levels. Document the final parameter set for use on real spectra.

Related tools

Examples

import numpy as np; from mzapy.peaks import find_peaks_1d_localmax; synthetic_mz = np.array([100.0, 100.5, 101.0, 101.5, 102.0]); synthetic_intensity = np.array([10, 150, 200, 150, 10]); detected_peaks_mz, heights = find_peaks_1d_localmax(synthetic_intensity, threshold=50, prominence=30); print(f"Detected: {len(detected_peaks_mz)} peaks; expected: 1 peak at m/z ~101.0")

Evaluation signals

  • Detected peak count matches ground truth count exactly or within ±1 peak (accounting for noise floor sensitivity)
  • Each detected peak m/z position is within ±0.1 m/z or ±5% of expected m/z, whichever is more stringent for the instrument resolution
  • Detected peak intensity is within ±10–20% of expected synthetic height (accounting for quantization and scipy interpolation)
  • Sensitivity ≥ 95% (95% of true peaks detected) and specificity ≥ 90% (≥90% of detected peaks correspond to real peaks, not noise artifacts)
  • Parameter set (threshold, prominence) is documented and reproducible; re-running on identical synthetic data yields identical results

Limitations

  • Synthetic peaks may not capture the full complexity of real MS noise, peak shapes (asymmetry, tailing), or isotope patterns; validation on real annotated spectra is recommended before deployment.
  • scipy.signal.find_peaks performance depends strongly on threshold and prominence parameters, which must be tuned per instrument type and mass range; no universal parameter set is provided by the article.
  • The article does not specify tolerance thresholds (e.g., acceptable m/z error, intensity error) for declaring a detected peak valid; practitioners must establish these based on instrument specifications.
  • Validation on synthetic data alone does not account for coeluting peaks, low-abundance shoulders, or resolution limits that may affect real-world detection rates.

Evidence

  • [other] Two functions are provided for performing peak fitting on 1-dimensional data: mzapy.peaks.find_peaks_1d_localmax and mzapy.peaks.find_peaks_1d_gauss: "Two functions are provided for performing peak fitting on 1-dimensional data: mzapy.peaks.find_peaks_1d_localmax and mzapy.peaks.find_peaks_1d_gauss"
  • [other] Describes the workflow: generate/load synthetic 1D mass spectrum, call scipy.signal.find_peaks with threshold and prominence, extract peak indices and heights, return structured array, validate output against known synthetic peaks by comparing detected peak count and positions to ground truth: "1. Generate or load a synthetic 1D mass spectrum (m/z array with intensity values). 2. Call scipy.signal.find_peaks on the intensity array with appropriate threshold and prominence parameters to"
  • [other] Identifies mzapy.peaks.find_peaks_1d_localmax as one of two peak fitting functions for 1D data: "mzapy.peaks.find_peaks_1d_localmax is one of two functions provided for performing peak fitting on 1-dimensional data."
  • [other] Describes how scipy.signal.find_peaks is used to detect peaks via local maxima with threshold and prominence parameters: "How does mzapy.peaks.find_peaks_1d_localmax detect peaks in a 1D signal using scipy.signal.find_peaks?"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,132. 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.