agentsclimarketplace

Peak boundary localization

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/peak-boundary-localization

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-boundary-localization

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 you have (1) extracted regions of interest (ROIs) around candidate peaks in LC-MS data and (2) run those ROIs through a trained CNN-Transformer peak detection model that outputs both binary peak classifications and bounding box coordinates.

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, as published. Nobody here has run it

peak-boundary-localization

Summary

Extract peak boundary coordinates (left and right edges) from a trained CNN-Transformer object detection network's predictions on LC-MS regions of interest, then numerically integrate the area under the curve within those boundaries to quantify peak intensity. This skill bridges detected peak locations and quantitative measurements in metabolomics workflows.

When to use

Apply this skill after you have (1) extracted regions of interest (ROIs) around candidate peaks in LC-MS data and (2) run those ROIs through a trained CNN-Transformer peak detection model that outputs both binary peak classifications and bounding box coordinates. Use it when you need to convert raw detection outputs into quantitative peak areas for downstream metabolite identification or comparative analysis.

When NOT to use

  • Input is already a processed feature table with pre-computed peak areas — skip directly to statistical analysis.
  • Detection model has not been trained or checkpoint is not available — train or obtain the model first using the reconstruction workflow.
  • ROI extraction has not been performed — run ROI extraction from raw mzML data prior to applying this skill.

Inputs

  • Detection network predictions containing peak confidence scores and boundary coordinates
  • ROI-extracted LC-MS chromatogram signal values (intensity array) for each region
  • Confidence threshold value (numeric, default 0.99)
  • Optional: feature metadata (compound name, m/z, retention time) for targeted quantification

Outputs

  • Quantified peak areas (numeric values)
  • Peak boundary coordinates (start and end m/z or retention time positions)
  • Associated metadata table (CSV format) with compound identifiers, m/z, retention time, and integrated area

How to apply

Load the detection network output containing predicted peak locations and confidence scores from the CNN-Transformer model checkpoint. Filter predictions by confidence threshold (default 0.99 in QuanFormer) to retain only high-confidence peaks. For each prediction that passes filtering, extract the peak start and end position coordinates from the boundary localization head outputs. Apply numerical integration (e.g., Simpson's rule or trapezoidal rule) to compute the area under the chromatogram curve between the left and right boundaries. Compile the quantified peak areas and associated metadata (m/z, retention time, compound name if targeted mode) into a structured output table (CSV or similar). The integration should respect the original signal intensity values within the localized window.

Related tools

  • QuanFormer (Implements the CNN-Transformer detection network and provides the trained checkpoint (checkpoint0029.pth) for generating boundary predictions; also provides the numerical integration and output compilation routine.) — https://github.com/LinShuhaiLAB/QuanFormer
  • PyTorch (Underlying deep learning framework for loading the trained detection model and executing forward passes to generate boundary predictions.)

Examples

python main.py --ppm 10 --source resources/example/profile --feature resources/example/profile_feature.csv --images_path resources/example/profile_output --output resources/example/profile_output/area.csv --model resources/checkpoint0029.pth --threshold 0.99

Evaluation signals

  • Confidence score check: all retained predictions meet or exceed the threshold (e.g., ≥0.99); filtered predictions are consistently excluded.
  • Boundary coordinate validity: left boundary < right boundary for every peak; coordinates fall within the expected ROI window range.
  • Area integration sanity: integrated areas are positive and fall within expected intensity ranges for the data; extreme outliers (very small or very large) warrant visual inspection of the ROI.
  • Schema conformance: output table contains all required columns (compound name, m/z, RT, peak area) with correct data types; no missing or NaN values in core fields.
  • Reproducibility check: re-running with the same model checkpoint and threshold produces identical results; stochasticity should be absent for deterministic operations (unless smoothing is applied).

Limitations

  • Peak boundary predictions depend on the quality of the trained detection model; model performance is limited to the mass range and peak types seen during training (method was developed for high-resolution LC-MS metabolomics data but generalization to other peak targets is possible).
  • Numerical integration accuracy depends on signal smoothing and sampling resolution; noisy or under-sampled ROIs may produce unreliable area estimates.
  • Confidence threshold (e.g., 0.99) is a hard cutoff; borderline predictions (e.g., confidence 0.98) are discarded without recourse, potentially missing true low-intensity peaks.
  • Method assumes that boundary coordinates output by the detection head align properly with the underlying chromatogram intensity axis; misalignment or coordinate system mismatch will produce incorrect areas.
  • Currently supports only .mzML input format; other raw data formats (e.g., .raw, .d) must be converted upstream.

Evidence

  • [other] Extract peak boundary coordinates (left and right edges) from the detection network predictions.: "Extract peak boundary coordinates (left and right edges) from the detection network predictions."
  • [other] For each identified peak, integrate the area under the curve within the localized boundaries using numerical integration.: "For each identified peak, integrate the area under the curve within the localized boundaries using numerical integration."
  • [other] Compile quantified peak areas and associated metadata into a structured output table.: "Compile quantified peak areas and associated metadata into a structured output table."
  • [readme] Keep only predictions with 0.99 confidence.: "Keep only predictions with 0.99 confidence."
  • [readme] train object detection network combining CNN and Transformer to identify the peaks in ROI (to judge whether it is a true peak or a false peak) and locate the peak boundaries: "train object detection network combining CNN and Transformer to identify the peaks in ROI (to judge whether it is a true peak or a false peak) and locate the peak boundaries"

Keep looking

Skills are one crate of 328,083. 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.