Repository navigation
Add table-driven chromatogram extraction and R-pinned peak metrics - #13
Merged
Merged
Conversation
From the Chromatograms paper (Louail, Gatto, Gibb & Rainer, Anal Chem 2026, 10.1021/acs.analchem.6c03926): - chrom_extract.extract_chromatograms(): a peak table (m/z + RT window per row, any annotation columns) -> one chromatogram per row and run, one pass per run, every row column carried through; chromatogram_rows() flattens for a DataFrame. Active rows are summed with one searchsorted over a cumulative intensity sum. - xic.peak_boundary / peak_metrics / PeakMetrics / beta_values: boundaries, in-boundary area, FWHM, asymmetry, S/N, prominence and Kumler beta shape, ported from the Chromatograms, MsQuality and MetaboCoreUtils R sources. The port matches those functions run verbatim in R 4.5.2 to 1e-15 on 7 traces, pinned in tests/data/r_peak_reference.json. - Opt-in deviations, all measured on real glycopeptide MS1 (NGlycoMM TMT runs): nearest_valley (R's left boundary walks through a flat floor to the trace start: 132 of 400 zero-filled traces vs 19), contains_rt (the peak containing the MS2 time; the MS2 can fire on a tail a minute past the apex), apex_window. - XIC.area docstring corrected: it integrates the whole trace. On two real caches the table extraction reproduces extract_xics exactly when both compute in float64 (400 rows). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python counterpart of chromExtract() from the Bioconductor package Chromatograms (Louail et al., Anal Chem 2026, 10.1021/acs.analchem.6c03926), plus peak boundaries and quality metrics ported from the Chromatograms, MsQuality and MetaboCoreUtils R sources and pinned against them (tests/data/r_peak_reference.json). Deviations from R are opt-in and documented: nearest_valley, contains_rt, apex_window. Offline suite: 227 passed.
🤖 Generated with Claude Code