agentsclimarketplace

Cnn architecture design for chromatography

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/cnn-architecture-design-for-chromatography

Use when you have LC-HRMS profile-mode chromatograms with ground-truth peak annotations (reference features) and need to detect peaks in new samples with high sensitivity and specificity, especially when peaks exhibit variable morphology (left/right isomers), overlapping background signals.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill cnn-architecture-design-for-chromatography

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

11.7 KB, ~2.1k tokens by cl100k_base, as published. Nobody here has run it

CNN Architecture Design for Chromatography

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

Design and train a convolutional neural network to classify local maxima in LC-HRMS profile-mode data as chromatographic peaks or background signal, with auxiliary regression heads to predict bounding-box coordinates and peak centers. This skill enables automated, generalizable peak-picking across diverse LC-HRMS datasets by learning from iteratively augmented training instances.

When to use

Apply this skill when you have LC-HRMS profile-mode chromatograms with ground-truth peak annotations (reference features) and need to detect peaks in new samples with high sensitivity and specificity, especially when peaks exhibit variable morphology (left/right isomers), overlapping background signals ('walls'), or noise that makes rule-based detection unreliable.

When NOT to use

  • Input is already a processed feature table (e.g., aligned peak list); use this skill on raw or preprocessed profile-mode LC-HRMS data, not on feature matrices.
  • Ground-truth reference features or labeled training chromatograms are unavailable; supervised CNN training requires labeled data for both peak examples and background distraction signals.
  • System lacks CUDA-enabled NVIDIA GPU or adequate memory (< 2–4 GB for training); CPU-only inference is possible but training on large datasets is impractical without GPU acceleration.

Inputs

  • LC-HRMS profile-mode raw data (e.g., NetCDF, mzML) containing rt×mz chromatographic regions
  • Standardized two-dimensional rt×mz area images extracted around local maxima
  • Ground-truth reference features (isolated single chromatographic peaks) from training chromatograms
  • Labeled training instances generated by combining references with distraction peaks and background signals

Outputs

  • Trained CNN model (TensorFlow format) with three output heads
  • Peak-type classification (chromatographic peak with isomers vs. background) for each local maximum
  • Bounding-box coordinates (left, right, top, bottom in rt×mz space) for detected peaks
  • Peak-center location predictions (rt and mz coordinates)
  • Detection examples exported as images for user verification
  • Detected chromatographic peaks exported as featureML and tab-separated-values files

How to apply

Begin by extracting reference features from training chromatograms using a smoothing and gradient-descent algorithm to estimate peak borders and centers; match these peaks against a user-defined ground-truth reference list and update reference properties to fit observed chromatographic peaks. Generate a large, GPU-accelerated training dataset by iteratively combining matched references with various distraction peaks and background types (e.g., walls) to simulate real chromatographic complexity and improve generalization. Construct a CNN with convolutional and pooling layers outputting three heads: (1) binary classification (peak vs. background), (2) bounding-box regression (four coordinates), and (3) peak-center location regression. Train the model using TensorFlow on the augmented dataset, validate on a held-out test set, and evaluate using classification accuracy and bounding-box/peak-center coordinate prediction error. Optimize GPU parameters (blockdim, griddim) and batch sizes (e.g., exportBatchSize) to match your hardware; reduce batch size if GPU memory is limited (e.g., from 2048 to 1024 or 512).

Related tools

Examples

from peakbot.Chromatogram import Chromatogram
chromatogram = Chromatogram('sample.mzML')
trainedModel = peakbot.train_cnn(referenceFeatures, trainingInstances, epochs=50, batchSize=32)
detections = trainedModel.predict(chromatogram.rt_mz_arrays)

Evaluation signals

  • Classification accuracy on held-out test set: percentage of local maxima correctly classified as peak or background, with target ≥ 95% or higher depending on application stringency.
  • Bounding-box prediction error: mean absolute error or intersection-over-union (IoU) between predicted and ground-truth bounding boxes in rt×mz space, with acceptable error thresholds specified a priori.
  • Peak-center coordinate prediction error: root-mean-square error (RMSE) in rt and mz dimensions for predicted vs. ground-truth peak centers, should be within 1–2 grid steps.
  • Generalization across sample types: apply trained model to independent validation chromatograms and compare detected peaks to reference list; detection sensitivity (true positives / total peaks) and false-discovery rate should remain consistent.
  • Visual inspection of exported detection images and featureML annotations; manual review for correct peak boundaries, accurate separation of overlapping peaks, and absence of spurious background detections.

Limitations

  • GPU memory and performance depend on hardware: blockdim and griddim parameters must be tuned per GPU model; if exportBatchSize 2048 exceeds available memory (~4 GB), reduce to 1024 or 512.
  • Training data quality is critical: reference features must be accurately matched to ground-truth peaks and augmentation must represent real chromatographic variability (isomers, walls, noise); incomplete or biased training sets reduce model generalization.
  • The model is trained on a specific LC-HRMS instrument, ionization mode, and chromatographic method; transfer learning or retraining may be needed for substantially different experimental conditions.
  • No official changelog is available, limiting reproducibility across software versions; users should pin dependency versions in their conda environments.
  • Peak detection is limited to local maxima; very broad or multimodal peaks, or peaks overlapping at the exact same rt×mz location, may not be resolved.

Evidence

  • [readme] 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] reports whether the local-maxima is a chromatographic peak with left/right isomeric compounds or a signal of the background. Moreover, for chromatographic peaks it suggests a bounding-box and a peak-center: "reports whether the local-maxima is a chromatographic peak with left/right isomeric compounds or a signal of the background. Moreover, for chromatographic peaks it suggests a bounding-box and a"
  • [readme] searching for chromatographic peaks using a smoothing and gradient-descend algorithm. The peaks' borders and centers are also estimated in this step: "searching for chromatographic peaks using a smoothing and gradient-descend algorithm. The peaks' borders and centers are also estimated in this step"
  • [readme] 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. In this step the properties of the reference features are also updated to best fit the chromatographic peaks: "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. In this step the"
  • [readme] generate a large number of training instances by iteratively combining them. 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): "generate a large number of training instances by iteratively combining them. Each such training instance can consist of a chromatographic peak or background signal and several other distraction peaks"
  • [readme] GPU (CUDA) based approach is implemented that decreases the time required for their generation. The CNN model is implemented in the TensorFlow package. It consists of several convolutional and pooling-layers and outputs a peak-type, -center, and -bounding-box: "GPU (CUDA) based approach is implemented that decreases the time required for their generation. The CNN model is implemented in the TensorFlow package. It consists of several convolutional and"
  • [readme] 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 examples repository can be used: "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"
  • [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."
  • [intro] also allows to easily extend the reference list with isotopologs of the same compound: "also allows to easily extend the reference list with isotopologs of the same compound"
  • [readme] also different background types are supported by PeakBot so that it differentiates between true chromatographic peaks and irrelevant background information (e.g., walls, which are signals present throughout the entire or large parts of the chromatograms): "also different background types are supported by PeakBot so that it differentiates between true chromatographic peaks and irrelevant background information (e.g., walls, which are signals present"

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 326,852. 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.