Repository navigation
[FIX] TheoreticalSpectrumGenerator: generate the last internal fragment - #9600
timosachsenberg merged 6 commits into
Conversation
…, FDR charge range, MRM RT %RSD) Addresses three validated findings from OpenMS#9597: * TheoreticalSpectrumGenerator::addInternalFragmentPeaks_: the internal-fragment loop bound `l < size - 1 - 2` dropped the C-terminal-adjacent interior dipeptide (off-by-one) and, being unsigned, wrapped to ~1.8e19 for peptides of length 1-2 (effectively infinite loop / OOM). Guard with `if (size < 4) return;` and use the underflow-safe bound `l + 2 < size`. * FalseDiscoveryRate::applyBasic(run_info, ids): the pooled split_charge_variants path computed the upper charge bound with getChargeRange().first instead of .second, collapsing e.g. 2..4 to only charge 2. * MRMFeatureFilter::calculateFilterValuesPercRSD: the component-group retention_time_u %RSD was computed from the retention_time_l fields (copy-paste); use the _u fields, mirroring the component-level block. Adds regression tests for all three (fail before the fix, pass after). The TSG fix emits the previously-missing internal fragments, so the nine OpenNuXL reference outputs are updated accordingly (fragment_annotation strings only; no identification/score/localization changes). The fourth finding (TransformationDescription::getStatistics percentile index) was validated as a non-bug: the index expression is floating-point and, for the default percentile set, never produces an out-of-range value. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-17 07:28:21.242367259 +0000
+++ AUTHORS.new 2026-06-17 07:28:26.195569197 +0000
@@ -23,8 +23,8 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
|
Adversarial review result:
Assuming the previous behavior was intentional until disproven, I checked the three targeted fixes against their tests: the pooled FDR charge upper bound, component-group retention-time |
Conflicts resolved to develop's side: OpenMS#9790 (066f27a) fixed the short- peptide underflow and the MRM %RSD on develop, and develop rewrote the OpenNuXL references since. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
TheoreticalSpectrumGenerator stopped the internal-fragment loop one start position early (l + 3 < size): the internal fragment that ends next to the C-terminal residue was never generated, and 4-mers got none. The bound is l + 2 < size now. - The short-peptide underflow and the MRM %RSD fix are on develop (OpenMS#9790); the pooled split-charge FDR fix is dropped: applyBasic(run_info, ids) has no caller outside pyOpenMS and that path has further problems. - OpenNuXL annotates with internal fragments. In its 9 references only fragment_annotation lines change: the new fragments are added (e.g. VL, QL, DK-H3N1+), and at m/z 242.1496 QL replaces SSL-CO-H2O1+ (same mass). The other lines are kept; the test outputs match them within FuzzyDiff's tolerance. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
…zation, #10587 MS1LabeledWorkflow, #10545 Bruker .d reader) Only CHANGELOG conflicted; both sides are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
TheoreticalSpectrumGenerator: the last internal fragment was never generated
With
add_internal_fragments, the loop over start positions stopped one position early (l + 3 < size). The internal fragment that ends next to the C-terminal residue was therefore never generated (e.g.IDof PEPTIDE), and peptides of 4 residues got none at all. The bound isl + 2 < sizenow: the fragment still starts after the N-terminal residue, ends before the C-terminal residue, and has at least 2 residues. A test checks GASP (AS), GASPK (AS, ASP, SP) and GAS (none).OpenNuXL references: OpenNuXL annotates spectra with internal fragments, so in its 9 references (
OpenNuXL_{1..6}_output.idXML,OpenNuXL_{3,4,6}_output2.tsv) onlyfragment_annotationlines change:VL,QL,NP,DK-H3N1+;QLnow annotates the peak thatSSL-CO-H2O1+annotated before (same mass).No identification, score or localization changes. The new references were made by taking only the changed lines from the test outputs. Lines whose numbers differ only in the last digits were kept as they were, and the test outputs match the references within FuzzyDiff's tolerance (checked locally, Linux, GCC 13).
Dropped from the original version
developsince [FIX] 14 boundary/serialization/state-consistency fixes from the #9767 audit #9790.FalseDiscoveryRate::applyBasic(run_info, ids): that overload has no caller outside pyOpenMS, and its per-charge path rescores all charges in every pass. Fixing only the range would not make it correct.developis merged in, and the tracker references are gone.🤖 Generated with Claude Code
https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
Summary by CodeRabbit