Chromatographic peak detection gradient descent
Use when you have LC-HRMS profile-mode data (retention time × m/z matrix format) and need to automatically identify chromatographic peak locations and boundaries prior to feature extraction, reference matching, or training a peak-classification CNN model.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill chromatographic-peak-detection-gradient-descentAssembled 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.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
chromatographic-peak-detection-gradient-descent
License: noncommercial — confirm your use is a permitted (noncommercial) purpose before applying; commercial use requires a separate license (see
metadata.tool_license). <!-- asb-license-banner -->
Summary
Detects chromatographic peaks in LC-HRMS profile-mode data by applying smoothing followed by gradient-descent algorithms to identify local maxima, estimate peak borders and centers. This preprocesses data for reference matching or CNN model training in untargeted metabolomics workflows.
When to use
You have LC-HRMS profile-mode data (retention time × m/z matrix format) and need to automatically identify chromatographic peak locations and boundaries prior to feature extraction, reference matching, or training a peak-classification CNN model. This is appropriate when peaks are not pre-aligned and you require standardized peak center and bounding-box estimates.
When NOT to use
- Input data is already centroided (not profile-mode LC-HRMS); use centroid-based peak picking instead.
- Peaks have already been detected and aligned; skip to reference matching or feature extraction.
- Signal-to-noise ratio is extremely low (<2:1); preprocessing or data filtering may be necessary first.
Inputs
- LC-HRMS profile-mode data (retention time × m/z matrix)
- Chromatographic signal as 2D numpy array or HDF5 file
- Smoothing kernel parameters (e.g., window size, filter type)
Outputs
- Detected peak center coordinates (retention time, m/z)
- Peak bounding boxes (rt_min, rt_max, mz_min, mz_max)
- Peak border estimates and center positions
- List of local maxima with associated intensity values
How to apply
Load the LC-HRMS chromatogram as a retention time × m/z matrix in profile mode. Apply a smoothing filter to the chromatographic signal to reduce noise while preserving peak shape information. Execute a gradient-descent algorithm to locate local maxima in the smoothed signal and estimate each peak's center coordinates (rt, mz) and borders. For each detected maximum, extract or record the bounding box and center position. The gradient-based approach identifies inflection points where the signal transitions from increasing to decreasing intensity, making it robust to moderate noise. Estimated peaks are then available for downstream matching against reference lists or synthetic training-set generation.
Related tools
- PeakBot (Python package implementing smoothing, gradient-descent peak search, and subsequent CNN-based peak classification for LC-HRMS data) — https://github.com/christophuv/PeakBot
- TensorFlow (Neural network framework used to train the CNN model that classifies detected peaks as true chromatographic peaks or background signal) — https://www.tensorflow.org/
- OpenMS/TOPPView (Visualization tool for featureML export of detected chromatographic peaks) — https://pubmed.ncbi.nlm.nih.gov/19425593/
Examples
curl https://raw.githubusercontent.com/christophuv/PeakBot_Example/main/quickExample_GPU.py > quickExample_GPU.py && python quickExample_GPU.py
Evaluation signals
- Detected peaks should correspond visually to intensity maxima in the smoothed 2D chromatogram.
- Peak center coordinates (rt, mz) should fall within the estimated bounding boxes.
- Peak borders (rt_min, rt_max, mz_min, mz_max) should tightly enclose the signal above a defined threshold (e.g., half-max intensity).
- Comparison of detected peaks against reference ground-truth peaks (isolated single chromatographic peaks) should show agreement in retention time and m/z within instrument tolerance (e.g., ±5 ppm for m/z).
- Number and distribution of detected peaks should be consistent across replicate chromatograms from the same sample or reference material.
Limitations
- Performance depends on smoothing filter choice; over-smoothing may merge adjacent peaks or eliminate small peaks, while under-smoothing may detect noise as false peaks.
- Gradient-descent algorithm may struggle with overlapping or co-eluting peaks, particularly in complex background regions or high-noise regions (walls, edges).
- Peak borders estimated by gradient-descent may be inaccurate for highly asymmetric or multi-modal peaks.
- CUDA GPU support is required for fast processing of large training datasets; CPU-only operation is slower and may require parameter tuning (blockdim, griddim) per GPU model.
- User must manually define reference list and set retention time and m/z alignment criteria; mismatches in these parameters will degrade the quality of reference feature updates.
Evidence
- [intro] Apply smoothing to the chromatographic signal and identify local maxima using gradient-descent algorithm: "searching for chromatographic peaks using a smoothing and gradient-descend algorithm. The peaks' borders and centers are also estimated in this step"
- [intro] Standardized 2D area extraction for CNN input: "each of which is then exported as a standarized two-dimensional area (rt x mz), which is used as the input for a machine-learning CNN model"
- [intro] Peak matching with reference list using retention time and m/z alignment: "matched with a user-defined reference list (the ground-truth; isolated single chromatographic peaks) with the aim of using the same chromatographic peak but from different samples"
- [readme] Input format and preprocessing workflow: "Load training chromatogram data (retention time × m/z matrix format). 2. Apply smoothing filter to the chromatographic signal to reduce noise. 3. Execute gradient-descent algorithm to locate"
- [readme] GPU acceleration and parameter tuning guidance: "the blockdim and griddim need to be chosen accordingly. Please adapt these values to your GPU. To find good values for your particular GPU, the script quickFindCUDAParameters.py from the PeakBot"
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.