---
name: lc-hrms-2d-area-standardization
description: Use when after detecting local-maxima in LC-HRMS profile mode datasets and before training or inference with a CNN model for peak classification.
license: CC-BY-4.0
metadata:
  edam_operation: http://edamontology.org/operation_3215
  edam_topics:
  - http://edamontology.org/topic_3520
  - http://edamontology.org/topic_0092
  tools:
  - Python
  - PeakBot
  - TensorFlow
  - OpenMS TOPPView
  techniques:
  - mass-spectrometry
derived_from:
- doi: 10.1093/bioinformatics/btac344
  title: PeakBot
evidence_spans:
- PeakBot is a python package
claims: []
provenance:
  collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
  assembled_by: scripts/collect_metabolomics_collection.py
  sources:
  - build: coll_peakbot_cq
    doi: 10.1093/bioinformatics/btac344
    title: PeakBot
  dedup_kept_from: coll_peakbot_cq
schema_version: 0.2.0
attribution:
  generator: AgenticScienceBuilder
  original_doi: 10.1093/bioinformatics/btac344
  all_source_dois:
  - 10.1093/bioinformatics/btac344
  zenodo_doi: 10.5281/zenodo.20794027
  curators: []
  promoter: Louis-Félix Nothias
  sponsor: CNRS & Université Côte d'Azur
---

# lc-hrms-2d-area-standardization

## Summary

Standardize local-maxima detected in LC-HRMS profile mode data into uniform two-dimensional areas (retention time × m/z) for input to machine-learning models. This preprocessing step ensures consistent representation of potential chromatographic peaks across diverse samples and instrument configurations.

## When to use

Apply this skill after detecting local-maxima in LC-HRMS profile mode datasets and before training or inference with a CNN model for peak classification. Use it when you need to convert variable-geometry peak regions into a fixed-size tensor format that the CNN expects, ensuring all peaks are represented with the same spatial and feature resolution regardless of their original size or position in the chromatogram.

## When NOT to use

- Input is already a curated feature table (mzML, featureML) — skip to model inference
- Analysis goal is statistical quantification without machine learning — use conventional peak integration instead
- LC-HRMS data is in centroided (not profile) mode — preprocessing differs significantly

## Inputs

- LC-HRMS profile mode dataset (standardized format: RT × m/z × intensity matrix)
- Detected local-maxima coordinates (retention time and m/z positions)
- Reference peak list or matched reference features with borders and centers

## Outputs

- Standardized two-dimensional areas (RT × m/z tensor)
- Labelled training instances with peak type, bounding box, and peak center metadata
- Exportable training dataset in CNN-compatible format

## How to apply

Extract each detected local-maximum from the LC-HRMS dataset and define a standardized two-dimensional region around it using retention time (x-axis) and m/z (y-axis) as the coordinate system. Export each region as a uniform-sized two-dimensional area containing pixel intensities, preserving the local signal intensity variation within the region. The standardization step involves resampling or padding to achieve a consistent input size required by the CNN architecture. This uniform representation allows the CNN to learn generalizable features (peak morphology, isomeric patterns, background noise) across all training instances regardless of their original location or scale in the raw chromatogram.

## Related tools

- **PeakBot** (Detects local-maxima in LC-HRMS data using smoothing and gradient-descent, matches peaks to reference list, and orchestrates standardization and training instance generation) — https://github.com/christophuv/PeakBot
- **TensorFlow** (Implements the CNN model that consumes standardized 2D areas and outputs peak classification, bounding box, and center predictions) — https://www.tensorflow.org/
- **OpenMS TOPPView** (Visualization tool for exported featureML files containing detected peaks and standardized feature coordinates) — https://pubmed.ncbi.nlm.nih.gov/19425593/

## Evaluation signals

- Each standardized area has uniform dimensions (consistent tensor shape) suitable for CNN input
- Peak center and bounding box coordinates are preserved and match the original detection in the raw chromatogram (spatial consistency check)
- Intensity values within each 2D area reflect the local signal topology (edges, isomers, noise) without clipping or normalization artifacts
- Export format (featureML or tab-separated values) is machine-readable and compatible with downstream CNN training pipelines
- When multiple instances are generated by combining matched references (data augmentation), each composite instance maintains spatial plausibility (no overlapping peaks, realistic background patterns)

## Limitations

- Standardization assumes local-maxima detection is accurate; false positives or missed peaks propagate downstream to model training
- Fixed 2D area size may not accommodate unusually large or small peaks; practitioners must choose appropriate dimensions or accept loss of very broad or narrow features
- GPU memory requirements scale with exportBatchSize; the README notes that exportBatchSize=2048 requires ~4 GB GPU memory, forcing reductions to 1024 or 512 on memory-constrained hardware
- CUDA parameter tuning (blockdim, griddim) is GPU-specific and must be optimized per hardware configuration; suboptimal choices degrade standardization throughput
- The approach requires a curated reference list (ground-truth isolated peaks) for matching; lack of representative reference peaks reduces training generalization

## Evidence

- [intro] uses local-maxima in the LC-HRMS dataset 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: "uses local-maxima in the LC-HRMS dataset 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"
- [readme] Each such training instance can consist of a chromatographic peak or background signal and several other distraction peaks to generalize (augmentation of the training dataset): "Each such training instance can consist of a chromatographic peak or background signal and several other distraction peaks to generalize (augmentation of the training dataset)"
- [other] Assign labels to each generated instance indicating peak type (chromatographic peak with isomeric variants or background signal), bounding box, and peak center.: "Assign labels to each generated instance indicating peak type (chromatographic peak with isomeric variants or background signal), bounding box, and peak center."
- [readme] a GPU (CUDA) based approach is implemented that decreases the time required for their generation: "a GPU (CUDA) based approach is implemented that decreases the time required for their generation"
- [readme] If an exportBatchSize of 2048 requires some 4GB of GPU-memory. If you have less, try reducing this value to 1024 of 512.: "If an exportBatchSize of 2048 requires some 4GB of GPU-memory. If you have less, try reducing this value to 1024 of 512."
