agentsclimarketplace

Overlapped peak deconvolution validation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/overlapped-peak-deconvolution-validation

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 overlapped-peak-deconvolution-validation

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 solving for the concentration distribution matrix C using least squares optimization (minimize ||overlapped_peaks - S·C||²), validate that the solution is physically meaningful and numerically accurate by checking whether S·C faithfully reconstructs the input overlapped peak.

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

overlapped-peak-deconvolution-validation

Summary

Validates the deconvolution of overlapped GC-MS peaks by reconstructing the original overlapped intensity data from the predicted mass spectral matrix S and solved concentration distribution matrix C, then comparing the reconstruction against measured overlapped peak data. This post-hoc validation confirms that the least squares solution correctly decomposes the mixture.

When to use

After solving for the concentration distribution matrix C using least squares optimization (minimize ||overlapped_peaks - S·C||²), validate that the solution is physically meaningful and numerically accurate by checking whether S·C faithfully reconstructs the input overlapped peak intensities. Use this skill when you need confidence that the deconvolution workflow has correctly separated component spectra and their relative abundances.

When NOT to use

  • The concentration matrix C has not yet been computed; perform least squares solve first.
  • The input overlapped peaks are known to contain systematic noise or artifacts unrelated to the mixture model; residuals will be inflated and validation will be inconclusive.
  • The mass spectral matrix S was not generated by the same GCMSFormer model or OPR method; mismatched peak dictionaries will cause validation to fail spuriously.

Inputs

  • resolved mass spectral matrix S (m × n matrix, m mass-to-charge ratios × n components)
  • solved concentration distribution matrix C (n components × p time/scan points)
  • input overlapped peak intensity data (m × p matrix, same shape as S·C)

Outputs

  • reconstructed overlapped peak intensity matrix (m × p, = S·C)
  • residual error matrix (m × p, element-wise difference)
  • scalar reconstruction error metric (e.g., mean squared error, L2 norm, or relative error)

How to apply

Reconstruct the overlapped peak intensity data by computing the matrix product S·C, where S is the resolved mass spectral matrix (output from GCMSFormer) and C is the solved concentration distribution. Compare the reconstructed overlapped peaks element-wise against the input overlapped peak intensity data. Compute residual error (e.g., mean squared error or L2 norm of the difference) to quantify reconstruction fidelity. If residual error is negligible relative to the input peak intensities, the deconvolution is validated; large residuals indicate poor fit or numerical instability in the least squares solve step. Document the residual magnitude and any systematic deviations (e.g., negative concentrations, which are unphysical).

Related tools

  • PyTorch (matrix multiplication and tensor operations for computing S·C and residuals) — https://pytorch.org/
  • NumPy (least squares solver (numpy.linalg.lstsq) and numerical error computation)
  • GCMSFormer (predicts the mass spectral matrix S via Transformer model and orthogonal projection resolution) — https://github.com/zxguocsu/GCMSFormer

Examples

import numpy as np; S_pred = model.predict(overlapped_input); C_solved = np.linalg.lstsq(S_pred, overlapped_peaks, rcond=None)[0]; reconstructed = S_pred @ C_solved; residual = np.linalg.norm(overlapped_peaks - reconstructed) / np.linalg.norm(overlapped_peaks); print(f'Relative reconstruction error: {residual:.4f}')

Evaluation signals

  • Reconstruction error (||overlapped_peaks - S·C||²) is small relative to the L2 norm of input overlapped_peaks (e.g., relative error < 5%).
  • No negative or physically implausible values appear in the reconstructed peak intensity matrix.
  • Residual matrix is approximately uniformly distributed around zero with no systematic bias toward over- or under-prediction.
  • Reconstruction error is comparable to or smaller than the measurement noise floor of the GC-MS instrument.
  • Visual overlay of reconstructed vs. input overlapped peaks shows close agreement across all mass-to-charge ratios and time points.

Limitations

  • Validation only confirms that the least squares solution reproduces the input overlapped peaks; it does not verify that the predicted pure mass spectra S are correct without reference to authentic standards.
  • Residual error depends critically on the quality of the GCMSFormer predictions; if S contains systematic errors (e.g., missing peaks, incorrect isotope patterns), even a perfect least squares solve will fail validation.
  • Overlapped peak data containing outliers, instrumental artifacts, or baseline drift will inflate residuals and may lead to false rejection of valid solutions.
  • The method assumes the linear mixture model S·C is appropriate; deviations due to non-linear detector response or ion suppression effects will not be detected by this validation.

Evidence

  • [other] Validate the solution by reconstructing the overlapped peaks as S·C and comparing with the input overlapped data.: "Validate the solution by reconstructing the overlapped peaks as S·C and comparing with the input overlapped data."
  • [readme] GCMSFormer can predict the pure mass spectra of all components in overlapped peaks (mass spectral matrix S), and then use the least squares method to find the concentration distribution matrix C.: "GCMSFormer can predict the pure mass spectra of all components in overlapped peaks (mass spectral matrix S), and then use the least squares method to find the concentration distribution matrix C."
  • [other] minimize ||overlapped_peaks - S·C||² where C is the unknown concentration distribution.: "minimize ||overlapped_peaks - S·C||² where C is the unknown concentration distribution."
  • [readme] With the aid of the orthogonal projection resolution method (OPR), GCMSFormer can predict the pure mass spectra of all components in overlapped peaks: "With the aid of the orthogonal projection resolution method (OPR), GCMSFormer can predict the pure mass spectra of all components in overlapped peaks"

What ships with it

Read from the repository

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

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.