Repository navigation
[FIX] TMT32/35: isotope correction with Thermo CoA default matrices - #9446
Conversation
Replace the placeholder identity correction matrices (added in #9003 as a stopgap while values were unverified) with the measured isotope correction matrices for TMT 32-plex and 35-plex. - TMTThirtyTwoPlex/ThirtyFivePlexQuantitationMethod: set the default correction_matrix to the Thermo-sourced values and read it back in getIsotopeCorrectionMatrix() (same pattern as TMT 16-/18-plex) instead of forcing an identity matrix. - Values come from the Thermo TMTpro deuterated reagent set Certificate of Analysis (product A40000817). The non-deuterated channels are byte-identical to OpenMS' existing TMT 16-/18-plex datasheet matrices (verified); the deuterated channels are lot-specific and should be replaced with the values from the user's reagent-lot CoA. - Update IsobaricAnalyzer documentation and the TMT32/35 + IsobaricQuantifier unit tests to assert the real (non-identity) correction matrix. Original matrix values contributed by @FreezB11 in #7969. Co-authored-by: FreezB11 <[email protected]> https://claude.ai/code/session_01CwxxuL4okxsZTH6aCaUoCS
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-04 10:13:42.431290621 +0000
+++ AUTHORS.new 2026-06-04 10:13:48.103666981 +0000
@@ -22,8 +22,9 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
+ - Claude
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Pre-merge checks:
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
36-38:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAlign the topology comment with current defaults.
The comment still claims default all-
NA/identity behavior, but this class now ships CoA-derived non-identity defaults.Suggested fix
- // With the default all-NA correction_matrix, no correction is applied regardless - // of these values. Users supplying calibrated correction percentages need this - // topology to route corrections to the correct target channels. + // This topology routes isotope leakages to neighboring channels. + // The shipped default correction_matrix contains CoA-derived values. + // If users provide an all-NA correction_matrix, parsing falls back to identity.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp` around lines 36 - 38, Update the misleading comment in TMTThirtyTwoPlexQuantitationMethod.cpp that describes "default all-NA/identity behavior" so it reflects the current behavior: the class now ships with CoA-derived non-identity default correction/topology values; modify the comment near the topology explanation in the TMTThirtyTwoPlexQuantitationMethod class (where the current two-line topology comment appears) to state that defaults are derived from CoA and not an all-NA/identity matrix, and optionally note that users supplying calibrated correction percentages should still route corrections to the correct target channels.src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp (1)
36-38:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate stale comment about the default correction behavior.
This comment says the default
correction_matrixis all-NA(no correction), but defaults were changed to CoA-derived non-identity values. Keeping this text will mislead future maintenance.Suggested fix
- // With the default all-NA correction_matrix, no correction is applied regardless - // of these values. Users supplying calibrated correction percentages need this - // topology to route corrections to the correct target channels. + // This topology routes isotope leakages to neighboring channels. + // The shipped default correction_matrix contains CoA-derived values. + // If users provide an all-NA correction_matrix, parsing falls back to identity.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp` around lines 36 - 38, Update the stale comment that claims the default correction_matrix is all-NA by clarifying the current default behavior: reference the correction_matrix and TMTThirtyFivePlexQuantitationMethod and state that defaults are now CoA-derived non-identity values (so corrections are applied unless overridden), and adjust wording to describe why the topology/routing is still needed for user-supplied calibrated percentages; locate the comment near the TMTThirtyFivePlexQuantitationMethod implementation and replace the old "all-NA" explanation with the updated default behavior and its implications.
🧹 Nitpick comments (1)
src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp (1)
102-135: ⚡ Quick winAdd a 35-plex all-
NAoverride assertion in this class test.You already verify non-identity defaults; adding the all-
NAidentity fallback here would lock the 35-plex contract directly (instead of only indirectly elsewhere).Based on learnings: “Applies to src/tests/class_tests/**/*_test.cpp : Write unit tests for new functionality and ensure existing tests pass before suggesting changes”.Suggested extension
START_SECTION((virtual Matrix<double> getIsotopeCorrectionMatrix() const)){ TMTThirtyFivePlexQuantitationMethod quant_meth; @@ TEST_EQUAL(off_diagonal_nonzero > 0, true) + + Param p = quant_meth.getParameters(); + std::vector<std::string> na_correction(35, "NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA"); + p.setValue("correction_matrix", na_correction); + quant_meth.setParameters(p); + Matrix<double> id = quant_meth.getIsotopeCorrectionMatrix(); + for (Size r = 0; r < id.rows(); ++r) + { + for (Size c = 0; c < id.cols(); ++c) + { + TEST_REAL_SIMILAR(id(r, c), (r == c) ? 1.0 : 0.0); + } + } } END_SECTION🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp` around lines 102 - 135, Add a test case that asserts the explicit "all-NA" override for the 35-plex falls back to the identity correction matrix: construct a TMTThirtyFivePlexQuantitationMethod configured to use the all-NA override, call getIsotopeCorrectionMatrix(), verify it is 35x35, verify all diagonal entries == 1.0 and all off-diagonal entries == 0.0 (i.e., an identity matrix). Use the existing variable names (TMTThirtyFivePlexQuantitationMethod, getIsotopeCorrectionMatrix, m) so the new assertions sit alongside the current default-matrix checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Around line 36-38: Update the stale comment that claims the default
correction_matrix is all-NA by clarifying the current default behavior:
reference the correction_matrix and TMTThirtyFivePlexQuantitationMethod and
state that defaults are now CoA-derived non-identity values (so corrections are
applied unless overridden), and adjust wording to describe why the
topology/routing is still needed for user-supplied calibrated percentages;
locate the comment near the TMTThirtyFivePlexQuantitationMethod implementation
and replace the old "all-NA" explanation with the updated default behavior and
its implications.
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`:
- Around line 36-38: Update the misleading comment in
TMTThirtyTwoPlexQuantitationMethod.cpp that describes "default all-NA/identity
behavior" so it reflects the current behavior: the class now ships with
CoA-derived non-identity default correction/topology values; modify the comment
near the topology explanation in the TMTThirtyTwoPlexQuantitationMethod class
(where the current two-line topology comment appears) to state that defaults are
derived from CoA and not an all-NA/identity matrix, and optionally note that
users supplying calibrated correction percentages should still route corrections
to the correct target channels.
---
Nitpick comments:
In
`@src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp`:
- Around line 102-135: Add a test case that asserts the explicit "all-NA"
override for the 35-plex falls back to the identity correction matrix: construct
a TMTThirtyFivePlexQuantitationMethod configured to use the all-NA override,
call getIsotopeCorrectionMatrix(), verify it is 35x35, verify all diagonal
entries == 1.0 and all off-diagonal entries == 0.0 (i.e., an identity matrix).
Use the existing variable names (TMTThirtyFivePlexQuantitationMethod,
getIsotopeCorrectionMatrix, m) so the new assertions sit alongside the current
default-matrix checks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2624f1af-7fdf-4061-a90d-eeb434ab0858
📒 Files selected for processing (6)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cppsrc/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cppsrc/tests/class_tests/openms/source/IsobaricQuantifier_test.cppsrc/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cppsrc/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cppsrc/topp/IsobaricAnalyzer.cpp
- TMT32/35: the channel-topology comment still described the old all-NA identity default; update it to reflect the CoA-derived defaults. - TMT32/35 unit tests: assert that a user-supplied all-NA correction_matrix is honored and falls back to the identity matrix. https://claude.ai/code/session_01CwxxuL4okxsZTH6aCaUoCS
|
the new matrix is way too large to be of practical use: the user can easily mix up entries. |
|
Thanks @cbielow — agreed the flat 32×14 / 35×14 matrix is error-prone. Here is the concrete restructuring I propose before touching the code; please confirm or correct (especially the TMT35 point at the end). Channel split (mirrors the Thermo CoA sheets) TMT32 (32 channels):
TMT35 (35 channels):
Proposed parameters
Internal merge in
One thing to confirm: you wrote "add the extra 3 channels as another parameter" for TMT35. My plan instead folds If this looks right I'll implement it and update the tests. Generated by Claude Code |
…ed + deuterated parameters The TMTpro 32-/35-plex correction matrices were entered as one flat 32x14 / 35x14 table, which is hard to maintain and easy to misalign. The reagents actually ship on two separate Thermo Certificate-of-Analysis sheets, so split the parameter to mirror them: - correction_matrix: non-deuterated channels, 8 columns (identical layout to the TMT 16-/18-plex matrix), pasteable straight from the TMTpro 16-/18-plex CoA. - correction_matrix_deuterated: deuterated channels, 14 columns (adds the six 2H offsets), from the deuterated reagent CoA. getIsotopeCorrectionMatrix() merges them via a new shared base-class helper, IsobaricQuantitationMethod::stringListToIsotopeCorrectionMatrixSplit_(), which expands each 8-column non-deuterated row into the 14-column layout (NA in the six 2H positions) and interleaves both inputs in channel order before building the matrix. The resulting TMT32 matrix is bit-for-bit identical to before. For TMT35, align the 134C non-deuterated row to the TMT 18-plex values (0.14/5.81/0.31); it was the only one of the 18 non-deuterated rows that did not match the TMTpro datasheet, contradicting the documented intent that the non-deuterated channels are identical to TMT 16-/18-plex. These are example lot values (Thermo ships per-lot factors on the CoA), so users should replace them regardless. Tests: switch the all-NA identity fallback to the two-parameter form and add assertions exercising a deuterated channel's 14-column row. https://claude.ai/code/session_01CwxxuL4okxsZTH6aCaUoCS
|
Implemented the split and pushed ( What changed
Verification (no value drift except one intended cell): I extracted the pre-refactor 32×14 / 35×14 matrices from
The one deliberate value change: TMT35's Generated by Claude Code |
… params The TMT32 all-NA identity check still set the pre-refactor single 32x14 correction_matrix, which the new split parser rejects (it expects 16 non-deuterated 8-column rows in correction_matrix plus 16 deuterated 14-column rows in correction_matrix_deuterated). Switch it to the two-parameter form, matching the TMT32/35 unit tests. The identity expectation is unchanged; only the input parameter shape is corrected. Fixes the IsobaricQuantifier_test failure across all CI platforms. https://claude.ai/code/session_01CwxxuL4okxsZTH6aCaUoCS
|
@copilot Here's a fully self-contained implementation prompt. It assumes only a fresh checkout of the branch (which is at the merge commit, without these changes) and spells out every edit as exact find/replace text so a weak model can't improvise. ═══════════════════════ PROMPT START ═══════════════════════ You are implementing a small, well-defined change in the OpenMS/OpenMS C++ codebase. Work on the existing branch GoalTMT 32-plex and 35-plex isobaric methods interleave deuterated and non-deuterated reporter channels that are only ~0.0029 Th apart. The reporter-ion extractor ( Files to edit (exactly 4)
Edit 1 —
|
|
Adversarial review result: I did not find a blocking issue in the TMT 32/35-plex isotope-correction changes. The split non-deuterated/deuterated parameter handling feeds the existing correction-matrix builder in channel order, and the tests cover both the new non-identity defaults and the all-NA identity override path. No whitespace errors or source/test comments with tracker-style issue references stood out in this diff. I did not build or run the tests locally. |
develop removed OpenMS::String from these classes (#9450, #9468): stringListToIsotopeCorrectionMatrixSplit_() now takes std::string lists and uses StringUtils. It also accepts the single-parameter layout of OpenMS 3.6.0 (one 14-column row for every channel in correction_matrix), so INI files written by 3.6.0 keep working. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
- TOPP_IsobaricAnalyzer_TMTThirty{Two,Five}PlexMethod_1 ran with
isotope_correction false because the matrix was always the identity.
They now use the default (the shipped CoA matrices). In the references
only the corrected intensities and the isoquant statistics change.
- TMTThirtyTwoPlexQuantitationMethod_test: a correction_matrix in the
3.6.0 layout (32 rows of 14 values) is accepted.
- IsobaricAnalyzer docs name both correction parameters.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
TOPP_ProSE_12_pin_rescore_idXML_out diffed the idXML of two -rescore runs at 1% tolerance. Percolator cannot train properly on this data (1 decoy among 896 PSMs, so it skips rescaling the SVM scores; all scores lie in [-1, -0.945]), and on Windows the percolator_score of the two runs differs by about 1%, which failed the Windows CI of every PR. With -rescore, compare the FileInfo hit counts after PSM and protein FDR of the two runs instead (proteins, matched spectra, peptide hits, search engine). The test without -rescore keeps the full idXML diff, and the .pin comparison is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
|
On cd34f9e, everything except Windows The fix is #10588, which compares the hit counts after FDR instead. I've pushed the identical change here as 055f6a0; it becomes a no-op once #10588 is in develop. Generated by Claude Code |
…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
The bug
TMT 32-plex and 35-plex cannot use isotope correction on
developor in 3.6.0.getIsotopeCorrectionMatrix()ignored thecorrection_matrixparameter and always returned the identity matrix, andIsobaricIsotopeCorrectorrejects an identity matrix. With the defaultisotope_correction true,IsobaricAnalyzer -type tmt32plex/tmt35plextherefore fails, and user-supplied matrices have no effect. The TOPP tests ran with-quantification:isotope_correction falseto work around it.The change
getIsotopeCorrectionMatrix()reads the parameters, like the other TMT methods.The correction is given in two parameters laid out like the two Thermo Certificate-of-Analysis sheets, so values can be pasted directly:
correction_matrix: the non-deuterated channels, 8 columns as for TMT 16-/18-plex;correction_matrix_deuterated: the deuterated channels, 14 columns including the 2H offsets.stringListToIsotopeCorrectionMatrixSplit_()merges them into the full matrix in channel order.3.6.0 INI files: they store
correction_matrixwith one 14-column row per channel. That layout is still accepted as the complete matrix, andcorrection_matrix_deuteratedis then ignored. IsobaricWorkflow reads the matrix even with correction off, so otherwise such INIs would abort.Defaults:
As for every TMT method, these are lot-specific. The parameter descriptions and the IsobaricAnalyzer docs say to replace them with the values from your lot's CoA.
Tests
TOPP_IsobaricAnalyzer_TMTThirty{Two,Five}PlexMethod_1now run with the default isotope correction. In their references only the corrected intensities (52 elements, 6 centroids) and theisoquant:quantifyable_*statistics change.TOPP_IsobaricAnalyzer_*tests andTOPPWRITEINI/TOPPWRITECTD_IsobaricAnalyzerpass, and the TMT32/35 outputs match the new references (FuzzyDiff).Since the first version
develop. The split helper is ported fromOpenMS::Stringtostd::string(replace String with std::string #9450, Remove obsolete String/StringConversions/StringUtilsSimple shim headers #9468).Open points for review
correction_matrix, 135CD intocorrection_matrix_deuterated), as proposed on 4 June. That proposal was never confirmed.🤖 Generated with Claude Code
https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL