agentsclimarketplace

Signal residual deconvolution

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/signal-residual-deconvolution

Use when analyzing 1D signal arrays (e.g., extracted ion chromatograms, arrival time distributions, or MS1 spectra intensity profiles) where multiple peaks may overlap or where peak shape information (amplitude, position, width) is required beyond simple local-maximum detection.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill signal-residual-deconvolution

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

Implement the Gaussian-fit 1D peak detection function

Summary

Iteratively fit Gaussian curves to 1D mass spectrometry signal data, subtracting each fitted peak from the residuals to detect and quantify overlapping peaks by successive least-squares optimization. This approach is distinguished from local-maximum peak detection and is particularly suited to noisy or densely-packed spectral features.

When to use

Apply this skill when analyzing 1D signal arrays (e.g., extracted ion chromatograms, arrival time distributions, or MS1 spectra intensity profiles) where multiple peaks may overlap or where peak shape information (amplitude, position, width) is required beyond simple local-maximum detection. Use when the input signal is dense enough that simple thresholding would miss smaller peaks hidden in the residuals of larger ones, or when Gaussian peak shape models are appropriate for the instrumentation (e.g., LC-MS, ion-mobility MS).

When NOT to use

  • Signal contains non-Gaussian peak shapes (e.g., sharp rectangular or Lorentzian profiles) where Gaussian model assumption is violated.
  • Input is already a deconvolved or processed peak table; re-deconvolving may introduce spurious peaks or distort existing peak parameters.
  • Signal-to-noise ratio is extremely low (sparse or heavily baseline-dominated data) where threshold-based stopping criteria become unreliable.

Inputs

  • 1D signal array (numpy array or list of intensity values)
  • Intensity threshold parameter (absolute or relative)
  • Maximum number of peaks to detect (integer)
  • Gaussian fitting configuration (scipy least-squares parameters)

Outputs

  • List of detected peaks with fitted parameters (position, height, width)
  • Peak amplitude values (Gaussian fit coefficient)
  • Peak mean/position (Gaussian fit center)
  • Peak standard deviation/width (Gaussian fit sigma)
  • Residual array after all peak subtractions

How to apply

Initiate iterative least-squares Gaussian fitting on the input 1D signal array by setting an absolute or relative intensity threshold for peak-height stopping criterion, a maximum peak count, and Gaussian fitting configuration parameters. In each iteration, fit a Gaussian curve to the current data (or residuals on first iteration), extract peak parameters (amplitude, mean, standard deviation), and verify that peak height exceeds the stopping threshold. Subtract the fitted Gaussian from the residuals and repeat fitting on the updated residuals. Terminate when reaching the maximum peak count or when residual peak heights fall below threshold. Collect all detected peaks and validate that detected peak heights show monotonic decrease across iterations and that residual sum-of-squares improves with each new fit.

Related tools

Examples

from mzapy.peaks import find_peaks_1d_gauss; peaks = find_peaks_1d_gauss(signal_array, intensity_threshold=100, max_peaks=10, method='gaussian')

Evaluation signals

  • Detected peak heights form a monotonically decreasing sequence across iterations (amplitude_iter_i ≥ amplitude_iter_(i+1)).
  • Residual sum-of-squares (RSS) monotonically decreases with each iteration: RSS_i ≥ RSS_(i+1) before stopping criterion is met.
  • All returned peaks have heights strictly exceeding the specified stopping threshold; no peak below threshold is reported.
  • Peak count does not exceed the configured maximum; iteration terminates as soon as max count is reached or threshold is breached.
  • Gaussian fit parameters (amplitude, mean, sigma) are physically plausible for the signal domain (e.g., sigma > 0, amplitude > 0, mean within signal array bounds).

Limitations

  • Gaussian model assumes peak shapes follow normal distribution; real MS peaks may have tails or asymmetry not captured by this model.
  • Iterative subtraction can accumulate fitting errors; early iterations with poor fits propagate into residuals for later peaks, potentially degrading later peak quality.
  • Performance depends critically on initialization of fitting parameters and convergence criteria; poor choices may result in local minima or missed peaks.
  • Method does not account for baseline drift, noise coloration, or instrumental artifacts that may violate Gaussian assumption.
  • Computational cost scales with signal length and maximum peak count; very long signals or high peak counts may be slow.

Evidence

  • [other] Gaussian fitting and residual subtraction workflow: "Perform iterative least-squares Gaussian fitting on the signal: fit a Gaussian curve to the current data, extract peak parameters (amplitude, mean, standard deviation), and check if peak height"
  • [other] Peak detection method distinction: "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] Validation of iterative fits: "Validation: verify that detected peaks have decreasing height across iterations and that residual sum-of-squares improves with each fit."
  • [other] Output parameters from Gaussian fit: "Collect and return all detected peaks with their fitted parameters (position, height, width)."
  • [readme] MZA data access for 1D arrays: "extract extracted ion chromatograms ... Extracted Ion Chromatograms ... collect arrival time distributions ... Arrival Time Distributions"

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.