Skip to content

fix(TMT32/35): use identity matrix until calibrated correction values available - #9003

Merged
timosachsenberg merged 7 commits into
developfrom
fix/tmt32-35-identity-matrix
Mar 27, 2026
Merged

timosachsenberg merged 7 commits into
developfrom
fix/tmt32-35-identity-matrix

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace unverified isotope correction matrix values with identity defaults (all-NA rows) for TMT 32-plex and 35-plex
  • Add runtime OPENMS_LOG_WARN when these methods are instantiated, informing users that no calibrated correction is applied
  • Remove commented-out interaction calculation code that was not functional
  • Update tests to verify identity matrix (diagonal = 1.0, off-diagonal = 0.0)

This disables isotope purity correction by default but keeps the feature usable. Users can supply their own correction_matrix values from Thermo lot-specific certificates.

Test plan

  • TMTThirtyTwoPlexQuantitationMethod_test passes (all sections)
  • TMTThirtyFivePlexQuantitationMethod_test passes (all sections)
  • CI full test suite

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Summary by CodeRabbit

  • New Features

    • Added support for TMT 32‑plex and TMT 35‑plex isobaric quantitation methods in the analysis toolkit.
    • Both methods expose channel metadata and default to an identity isotope‑correction matrix.
  • Documentation

    • Tool usage and docs updated to list the new TMT 32‑plex and 35‑plex modes and their default behavior.
  • Tests

    • New unit and integration tests added to validate channel extraction, quantification, and parameter handling for both methods.

Add support for TMT 32-plex and 35-plex isobaric labeling with:
- New quantitation method classes with channel definitions
- Identity correction matrix defaults (no isotope correction until
  calibrated values are available from Thermo certificates)
- Runtime warning when instantiated without calibrated corrections
- IsobaricChannelExtractor and IsobaricAnalyzer integration
- Unit tests and pyOpenMS pxd bindings

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@timosachsenberg
timosachsenberg force-pushed the fix/tmt32-35-identity-matrix branch from 50c9801 to ab4ceeb Compare March 26, 2026 07:27
@coderabbitai

coderabbitai Bot commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Two new TMT isobaric quantitation methods (TMT 32-plex and TMT 35-plex) were added: C++ headers and implementations, Cython declarations, CMake build registration, unit and integration tests, TOPP tool registration, and Doxygen documentation updates.

Changes

Cohort / File(s) Summary
TMT 32-plex Quantitation Method
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h, src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
Adds concrete TMT 32-plex quantitation class: channel list, reporter masses, interaction/topology data, default params, reference-channel handling, and identity isotope-correction behavior.
TMT 35-plex Quantitation Method
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h, src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
Adds concrete TMT 35-plex quantitation class with channel metadata, reporter masses, interaction/topology data, default params, reference-channel handling, and identity isotope-correction behavior.
Build Configuration
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/sources.cmake, src/openms/source/ANALYSIS/QUANTITATION/sources.cmake
Registers the new header and source files in the ANAYLSIS/QUANTITATION CMake source lists for compilation and installation.
Python Bindings
src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd, src/pyOpenMS/pxds/TMTThirtyFivePlexQuantitationMethod.pxd
Adds Cython extern declarations to expose the new quantitation classes to pyOpenMS.
Unit Tests
src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp, src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp
New tests validating construction, method name, channel metadata, identity isotope-correction matrix, reference-channel parameter mapping, and copy semantics.
Integration & Quantifier Tests
src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp, src/tests/class_tests/openms/source/IsobaricQuantifier_test.cpp
Adds TMT 32-plex extraction and quantifier tests ensuring channel extraction and that the identity correction matrix is enforced by these method classes.
Test Registration
src/tests/class_tests/openms/executables.cmake
Registers new test executables for the TMT 32/35-plex tests in the test suite.
Tool Integration & Docs
src/topp/IsobaricAnalyzer.cpp, doc/doxygen/parameters/DefaultParamHandlerDocumenter.cpp
Registers TMT 32/35-plex methods in TOPP IsobaricAnalyzer and includes them in Doxygen parameter documentation; documents default identity correction-matrix behavior.

Possibly related issues

  • Add support for TMT-32 and 35-plex? #7629: Implements requested support for TMT 32-plex (and adds TMT 35-plex), matching the issue's objective to add these quantitation methods, their tests, and tool integration.

Suggested reviewers

  • cbielow

Poem

🐰
Hopped into channels, thirty-two and thirty-five,
I count reporter ions and make quant mats thrive,
With tiny feet I register each name,
Parameters set, identity stays the same,
A carrot for tests — and code kept alive! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing identity matrices for TMT 32/35-plex quantitation methods until calibrated correction values are available.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tmt32-35-identity-matrix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

- Use static bool guard for OPENMS_LOG_WARN to avoid spam when
  IsobaricAnalyzer eagerly constructs all methods
- Make o_mass32/o_mass35 arrays static const
- Fix header comment typos (// // → //) and $Maintainer tag format
- Add trailing newlines to all new files
- Remove unrelated changes: unused Constants.h additions
  (N15N14_MASSDIFF_U, H2H1_MASSDIFF_U), include removals in
  IsobaricChannelExtractor and IsobaricAnalyzer, unrelated test
  removals in executables.cmake
- Keep only TMT32/35 test additions in executables.cmake

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Known issue: missing reporter_mass_shift tolerance guard for TMT 32/35-plex

The minimum channel spacing for 32/35-plex is ~0.0029 Th (e.g., 128N at 128.128116 vs 128ND at 128.131038). The default reporter_mass_shift parameter is 0.002 Th.

IsobaricChannelExtractor::updateMembers_() has an existing guard for TMT 10/11-plex that throws when reporter_mass_shift_ > 0.003, but there is no equivalent guard for 32/35-plex. With the default shift of 0.002, a user could pick up signal from a neighboring channel only 0.0029 Th away.

Recommendation: Add a similar guard in IsobaricChannelExtractor::updateMembers_() for 32/35-plex, enforcing reporter_mass_shift_ <= ~0.001 to prevent cross-channel contamination. This should be addressed in a follow-up PR since it touches shared IsobaricChannelExtractor logic rather than the new TMT method classes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (3)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h (1)

21-58: Add full Doxygen to the new header API.

The class-level @brief is in place, but the exported ctor/copy/assignment/getter declarations still lack proper @param / @return docs, so the generated API page will be incomplete for a new public type.

As per coding guidelines, src/openms/include/**/*.h: Document all method parameters with @param[in], @param[out], or @param[in,out] tags; use @brief as required first line; document return values with @return.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h`
around lines 21 - 58, Add full Doxygen comments for all public and protected API
declarations in TMTThirtyFivePlexQuantitationMethod: add a one-line `@brief` for
the class and for each method, and for each ctor/assignment and method document
parameters and return values using `@param`[in]/@param[out]/@param[in,out] and
`@return` as appropriate; specifically add docs above
TMTThirtyFivePlexQuantitationMethod(), ~TMTThirtyFivePlexQuantitationMethod(),
the copy ctor TMTThirtyFivePlexQuantitationMethod(const
TMTThirtyFivePlexQuantitationMethod& other), operator=(const
TMTThirtyFivePlexQuantitationMethod& rhs), and for getMethodName(),
getChannelInformation(), getNumberOfChannels(), getIsotopeCorrectionMatrix(),
getReferenceChannel(), setDefaultParams_(), and updateMembers_() explaining
purpose, parameter ownership/constness and returned values. Ensure the brief
appears first, parameters use the correct [in]/[out] tags, and return values use
`@return` so the generated API is complete.
src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp (1)

738-741: Make the activation-filter assumption explicit in this test.

The comment says activation filtering is disabled, but this block only changes reporter_mass_shift. Setting select_activation to any here would keep the fixture from depending on the extractor default.

♻️ Minimal tweak
   Param p = ice.getParameters();
+  p.setValue("select_activation", "any");
   p.setValue("reporter_mass_shift", 0.003);
   ice.setParameters(p);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp` around
lines 738 - 741, The test relies on the extractor default for activation
filtering but the comment claims it is disabled; explicitly set the activation
filter in the IsobaricChannelExtractor test by updating the parameters retrieved
from ice (Param p = ice.getParameters()) to include select_activation set to
"any" (e.g., p.setValue("select_activation", "any")) before calling
ice.setParameters(p), so the fixture doesn't depend on
IsobaricChannelExtractor's default behavior.
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (1)

22-38: Add full Doxygen tags for the new public methods.

This exported header currently relies on terse inline comments only. Please add @brief, @param, and @return docs for the copy/assignment API and public overrides so the generated API docs stay complete.

As per coding guidelines, add Doxygen comments for new public methods and classes, and document all method parameters with @param[...] tags and return values with @return.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h`
around lines 22 - 38, Public API methods in TMTThirtyTwoPlexQuantitationMethod
lack full Doxygen tags; add `@brief` descriptions and `@param/`@return tags for the
copy constructor TMTThirtyTwoPlexQuantitationMethod(const
TMTThirtyTwoPlexQuantitationMethod& other), the assignment operator
TMTThirtyTwoPlexQuantitationMethod& operator=(const
TMTThirtyTwoPlexQuantitationMethod& rhs), and all public overrides
(getMethodName, getChannelInformation, getNumberOfChannels,
getIsotopeCorrectionMatrix, getReferenceChannel), documenting parameter names
(other, rhs) and precise return semantics (e.g. reference to String, const
IsobaricChannelList&, Size, Matrix<double>), and include `@brief` on the default
constructor/destructor as appropriate so generated API docs are complete.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Around line 81-86: Remove the OPENMS_LOG_WARN call from the
TMTThirtyFivePlexQuantitationMethod constructor
(TMTThirtyFivePlexQuantitationMethod::TMTThirtyFivePlexQuantitationMethod) and
instead emit the warning at the first real use of the 35-plex correction
matrix—for example inside the method that loads/applies the correction (e.g.,
the function that returns or sets the correction matrix such as
getCorrectionMatrix, setCorrectionMatrix, or the isotope-correction routine like
applyIsotopeCorrection/computeRatios) so the message only appears when the
TMTThirtyFivePlexQuantitationMethod is actually selected or its matrix is used;
leave the constructor silent and ensure the new warning text and placement
provide the same guidance about using a calibrated correction matrix.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`:
- Around line 145-149: The example correction_matrix row in the
TMTThirtyTwoPlexQuantitationMethod description contains an empty token and
yields 15 values; update the sample row to contain exactly 14 slash-separated
values (use "NA" or numeric values for every field) so it matches the per-row
validation in stringListToIsotopeCorrectionMatrix_(). Locate the human-readable
example string in ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
and replace the invalid "'NA/NA/NA/NA /0.82/NA/NA/ /0.30/8.71/0.33
/0.00/0.00/0.26/0.00'" with a valid 14-entry example (e.g., all tokens present
and separated by '/' with no empty token).
- Around line 77-82: The constructor
TMTThirtyTwoPlexQuantitationMethod::TMTThirtyTwoPlexQuantitationMethod currently
emits a warning about using the identity correction_matrix; remove that warning
from the constructor and instead emit it at the point where the
correction_matrix is actually consumed (e.g. right before the
isotope-correction/quantitation routine that applies the matrix). Implement a
runtime check where the matrix is used: if correction_matrix equals the
identity/default and no user-supplied matrix was set, log the warning then;
otherwise remain silent. Ensure you reference the class's correction_matrix
state when making the decision so callers who set correction_matrix after
construction won’t get a premature warning.

In `@src/tests/class_tests/openms/executables.cmake`:
- Around line 289-293: The Parquet test list dropped registration of
ArrowSchemaRegistry_test; update the WITH_PARQUET block that appends to
format_executables_list to include ArrowSchemaRegistry_test alongside the other
tests (e.g., Arrow_test, MSExperimentArrowExport_test,
MSChromatogramParquetConsumer_test) so the existing
src/tests/class_tests/openms/source/ArrowSchemaRegistry_test.cpp is exercised
again by CI.

In `@src/topp/IsobaricAnalyzer.cpp`:
- Around line 160-161: Update the TOPP tool documentation to include the new TMT
modes added in IsobaricAnalyzer (references: addMethod_ calls that construct
TMTThirtyTwoPlexQuantitationMethod and TMTThirtyFivePlexQuantitationMethod):
modify the tool `@page` block to state support now includes 32-plex and 35-plex
and explicitly note that these modes default to an identity correction matrix
until lot-specific correction values are provided, and add or update the
corresponding entry in doc/doxygen/public/TOPP.doxygen so the new modes appear
in the generated TOPP tool list.
- Around line 160-161: The new TMTThirtyTwoPlexQuantitationMethod and
TMTThirtyFivePlexQuantitationMethod expose reporter channels that are ~0.002922
Th apart, so IsobaricChannelExtractor's existing cap on reporter_mass_shift
(which currently assumes 10/11-plex spacing) can allow overlapping windows;
update the extractor to derive the allowed reporter_mass_shift from the minimum
spacing in the active quantitation method's reporter table (or, for a quick fix,
set a smaller default shift when addMethod_ registers
TMTThirtyTwoPlexQuantitationMethod or TMTThirtyFivePlexQuantitationMethod) so
that reporter_mass_shift < (min_channel_spacing / 2) (or another safe fraction),
and ensure the code paths around IsobaricChannelExtractor that read
reporter_mass_shift enforce this computed maximum and log/validate if a
requested shift is too large.

---

Nitpick comments:
In
`@src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h`:
- Around line 21-58: Add full Doxygen comments for all public and protected API
declarations in TMTThirtyFivePlexQuantitationMethod: add a one-line `@brief` for
the class and for each method, and for each ctor/assignment and method document
parameters and return values using `@param`[in]/@param[out]/@param[in,out] and
`@return` as appropriate; specifically add docs above
TMTThirtyFivePlexQuantitationMethod(), ~TMTThirtyFivePlexQuantitationMethod(),
the copy ctor TMTThirtyFivePlexQuantitationMethod(const
TMTThirtyFivePlexQuantitationMethod& other), operator=(const
TMTThirtyFivePlexQuantitationMethod& rhs), and for getMethodName(),
getChannelInformation(), getNumberOfChannels(), getIsotopeCorrectionMatrix(),
getReferenceChannel(), setDefaultParams_(), and updateMembers_() explaining
purpose, parameter ownership/constness and returned values. Ensure the brief
appears first, parameters use the correct [in]/[out] tags, and return values use
`@return` so the generated API is complete.

In
`@src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h`:
- Around line 22-38: Public API methods in TMTThirtyTwoPlexQuantitationMethod
lack full Doxygen tags; add `@brief` descriptions and `@param/`@return tags for the
copy constructor TMTThirtyTwoPlexQuantitationMethod(const
TMTThirtyTwoPlexQuantitationMethod& other), the assignment operator
TMTThirtyTwoPlexQuantitationMethod& operator=(const
TMTThirtyTwoPlexQuantitationMethod& rhs), and all public overrides
(getMethodName, getChannelInformation, getNumberOfChannels,
getIsotopeCorrectionMatrix, getReferenceChannel), documenting parameter names
(other, rhs) and precise return semantics (e.g. reference to String, const
IsobaricChannelList&, Size, Matrix<double>), and include `@brief` on the default
constructor/destructor as appropriate so generated API docs are complete.

In `@src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp`:
- Around line 738-741: The test relies on the extractor default for activation
filtering but the comment claims it is disabled; explicitly set the activation
filter in the IsobaricChannelExtractor test by updating the parameters retrieved
from ice (Param p = ice.getParameters()) to include select_activation set to
"any" (e.g., p.setValue("select_activation", "any")) before calling
ice.setParameters(p), so the fixture doesn't depend on
IsobaricChannelExtractor's default behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 910ac568-9de8-4765-8d05-0ca40146bfda

📥 Commits

Reviewing files that changed from the base of the PR and between aa7ecda and ab4ceeb.

📒 Files selected for processing (17)
  • doc/doxygen/parameters/DefaultParamHandlerDocumenter.cpp
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/sources.cmake
  • src/openms/include/OpenMS/CONCEPT/Constants.h
  • src/openms/source/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake
  • src/pyOpenMS/pxds/TMTThirtyFivePlexQuantitationMethod.pxd
  • src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd
  • src/tests/class_tests/openms/data/IsobaricChannelExtractor_9.mzML
  • src/tests/class_tests/openms/executables.cmake
  • src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp
  • src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp
  • src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp
  • src/topp/IsobaricAnalyzer.cpp
💤 Files with no reviewable changes (1)
  • src/openms/source/ANALYSIS/QUANTITATION/IsobaricChannelExtractor.cpp

Comment on lines +160 to +161
addMethod_(make_unique<TMTThirtyTwoPlexQuantitationMethod>(), "TMT 32-plex");
addMethod_(make_unique<TMTThirtyFivePlexQuantitationMethod>(), "TMT 35-plex");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update the tool page for the new TMT modes.

The @page block still says support stops at 18-plex and does not mention that 32/35-plex default to an identity correction matrix until lot-specific values are supplied.

As per coding guidelines, src/topp/*.cpp: Document TOPP tools and add them to doc/doxygen/public/TOPP.doxygen where applicable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/topp/IsobaricAnalyzer.cpp` around lines 160 - 161, Update the TOPP tool
documentation to include the new TMT modes added in IsobaricAnalyzer
(references: addMethod_ calls that construct TMTThirtyTwoPlexQuantitationMethod
and TMTThirtyFivePlexQuantitationMethod): modify the tool `@page` block to state
support now includes 32-plex and 35-plex and explicitly note that these modes
default to an identity correction matrix until lot-specific correction values
are provided, and add or update the corresponding entry in
doc/doxygen/public/TOPP.doxygen so the new modes appear in the generated TOPP
tool list.

⚠️ Potential issue | 🟠 Major

32/35-plex need a tighter reporter-window guard before being exposed.

IsobaricChannelExtractor still only caps reporter_mass_shift for 10/11-plex, but these new reporter tables include neighbors only about 0.002922 Th apart. With the current 0.002 Th default, adjacent 32/35 channels can share the search window, so extraction can become ambiguous. Please derive the limit from the minimum channel spacing, or lower the default for these modes, before advertising them in the CLI.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/topp/IsobaricAnalyzer.cpp` around lines 160 - 161, The new
TMTThirtyTwoPlexQuantitationMethod and TMTThirtyFivePlexQuantitationMethod
expose reporter channels that are ~0.002922 Th apart, so
IsobaricChannelExtractor's existing cap on reporter_mass_shift (which currently
assumes 10/11-plex spacing) can allow overlapping windows; update the extractor
to derive the allowed reporter_mass_shift from the minimum spacing in the active
quantitation method's reporter table (or, for a quick fix, set a smaller default
shift when addMethod_ registers TMTThirtyTwoPlexQuantitationMethod or
TMTThirtyFivePlexQuantitationMethod) so that reporter_mass_shift <
(min_channel_spacing / 2) (or another safe fraction), and ensure the code paths
around IsobaricChannelExtractor that read reporter_mass_shift enforce this
computed maximum and log/validate if a requested shift is too large.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp (2)

71-79: Minor: Inconsistent spacing in mass array.

Line 78 is missing a space after the comma between 135.151601,135.154526. All other values have consistent spacing.

✏️ Suggested fix
-        135.151601,135.154526 ,135.160846
+        135.151601, 135.154526, 135.160846
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 71 - 79, In the static array o_mass35 in
TMTThirtyFivePlexQuantitationMethod, fix the inconsistent spacing between the
entries "135.151601,135.154526" by inserting a space after the comma so it
matches the other elements (i.e., change to "135.151601, 135.154526"); update
the array initializer in the o_mass35 definition accordingly to maintain
consistent formatting.

17-104: Same style considerations as TMT32.

This file has the same indentation (4-space vs. 2-space guideline) and brace placement style as the TMT32 implementation. Consider normalizing both files together.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 17 - 104, Indentation and brace placement in
TMTThirtyFivePlexQuantitationMethod.cpp do not match the project's
2-space/Allman style used elsewhere; update formatting to match TMT32's style by
converting 4-space indents to 2-space indents and moving opening braces to their
expected positions. Locate
TMTThirtyFivePlexQuantitationMethod::TMTThirtyFivePlexQuantitationMethod, the
top-level namespace block, channel_names_, interaction_vector and o_mass35
declarations and normalize their indentation and brace placement to the
project's convention (same style as the TMT32 implementation) so both files
share identical formatting.
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

158-197: Inconsistent whitespace in assignment statements.

Several lines have inconsistent spacing around = operators (e.g., lines 162, 165-166, 177-178 have extra spaces). Consider running clang-format to normalize.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
around lines 158 - 197, The assignments in
TMTThirtyTwoPlexQuantitationMethod::updateMembers_() have inconsistent
whitespace around the '=' operators in many channels_[N].description lines;
normalize spacing to match the project's formatting style (e.g., single space
around '=') by running clang-format or manually editing the lines for
channels_[3], channels_[6-7], channels_[10-11], channels_[14-15],
channels_[18-19], channels_[22-23], channels_[26-27], channels_[29-31] and
ensure the reference_channel_ assignment spacing is consistent as well so the
function's assignments are uniformly formatted.

17-102: Indentation and brace style do not match coding guidelines.

The coding guidelines specify 2-space indentation for C++ and braces on their own lines. This file uses 4-space indentation throughout (lines 18-67, 78-101) and places opening braces on the same line as function/namespace declarations.

As per coding guidelines: "Use 2-space indentation for C++ and headers" and "Use braces on their own lines, aligned".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
around lines 17 - 102, The file uses 4-space indentation and places opening
braces on the same line, violating the project's 2-space indentation and "braces
on their own lines" style; update TMTThirtyTwoPlexQuantitationMethod namespace,
the static arrays (interaction_vector, o_mass32), the constructor
TMTThirtyTwoPlexQuantitationMethod::TMTThirtyTwoPlexQuantitationMethod, the
lambda make_channel and related blocks to use 2-space indentation and move
opening braces to their own lines (e.g., change "namespace OpenMS{" to
"namespace OpenMS" followed by "{", ensure all function/class/array initializers
and control blocks follow the same pattern), and reformat the for loop and
if-block that logs the warning accordingly so the file conforms to the coding
guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Around line 152-159: The sample correction_matrix row string (identity_row)
contains extra spaces that create an empty token and break the 14-value-per-row
validation; update the example in the defaults_.setValue("correction_matrix",
...) call and the identity_row so the sample row is a valid 14-entry,
slash-delimited string with no stray spaces (i.e., ensure each of the 14 tokens
is present and separated only by '/'), and update the human-readable example
text accordingly to show a correct 14-value example referenced by the
TMTThirtyFivePlexQuantitationMethod defaults_.setValue call.

In
`@src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp`:
- Line 5: Replace the malformed maintainer tag string "$Maintainer: Chris Bielow
$, Julianus Pfeuffer $" with a single correctly-formed tag containing both
names, e.g. "$Maintainer: Chris Bielow, Julianus Pfeuffer $", so the tag opens
with a single '$Maintainer:' and closes with a single trailing '$' (locate the
comment line matching the original malformed tag).

---

Nitpick comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Around line 71-79: In the static array o_mass35 in
TMTThirtyFivePlexQuantitationMethod, fix the inconsistent spacing between the
entries "135.151601,135.154526" by inserting a space after the comma so it
matches the other elements (i.e., change to "135.151601, 135.154526"); update
the array initializer in the o_mass35 definition accordingly to maintain
consistent formatting.
- Around line 17-104: Indentation and brace placement in
TMTThirtyFivePlexQuantitationMethod.cpp do not match the project's
2-space/Allman style used elsewhere; update formatting to match TMT32's style by
converting 4-space indents to 2-space indents and moving opening braces to their
expected positions. Locate
TMTThirtyFivePlexQuantitationMethod::TMTThirtyFivePlexQuantitationMethod, the
top-level namespace block, channel_names_, interaction_vector and o_mass35
declarations and normalize their indentation and brace placement to the
project's convention (same style as the TMT32 implementation) so both files
share identical formatting.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`:
- Around line 158-197: The assignments in
TMTThirtyTwoPlexQuantitationMethod::updateMembers_() have inconsistent
whitespace around the '=' operators in many channels_[N].description lines;
normalize spacing to match the project's formatting style (e.g., single space
around '=') by running clang-format or manually editing the lines for
channels_[3], channels_[6-7], channels_[10-11], channels_[14-15],
channels_[18-19], channels_[22-23], channels_[26-27], channels_[29-31] and
ensure the reference_channel_ assignment spacing is consistent as well so the
function's assignments are uniformly formatted.
- Around line 17-102: The file uses 4-space indentation and places opening
braces on the same line, violating the project's 2-space indentation and "braces
on their own lines" style; update TMTThirtyTwoPlexQuantitationMethod namespace,
the static arrays (interaction_vector, o_mass32), the constructor
TMTThirtyTwoPlexQuantitationMethod::TMTThirtyTwoPlexQuantitationMethod, the
lambda make_channel and related blocks to use 2-space indentation and move
opening braces to their own lines (e.g., change "namespace OpenMS{" to
"namespace OpenMS" followed by "{", ensure all function/class/array initializers
and control blocks follow the same pattern), and reformat the for loop and
if-block that logs the warning accordingly so the file conforms to the coding
guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8b82dda0-ab58-4f36-839f-c96c32208897

📥 Commits

Reviewing files that changed from the base of the PR and between ab4ceeb and f7af2de.

📒 Files selected for processing (9)
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
  • src/pyOpenMS/pxds/TMTThirtyFivePlexQuantitationMethod.pxd
  • src/tests/class_tests/openms/executables.cmake
  • src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp
  • src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp
  • src/topp/IsobaricAnalyzer.cpp
✅ Files skipped from review due to trivial changes (1)
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/pyOpenMS/pxds/TMTThirtyFivePlexQuantitationMethod.pxd
  • src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp
  • src/tests/class_tests/openms/executables.cmake
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h

- Fix sample correction_matrix example: '/ /' created a 15th empty
  token; use spaces inside tokens instead (matching TMT16/18 convention)
- Fix $Maintainer tag in test files (extra $ between names)
- Update IsobaricAnalyzer @page docs to mention 32/35-plex support
  and note that they default to identity correction matrix

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (11)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp (6)

81-81: Inconsistent brace placement.

Per coding guidelines, braces should be on their own lines. The opening braces for TMTThirtyFivePlexQuantitationMethod() (line 81) and updateMembers_() (line 163) are on the same line as the function signature.

Also applies to: 163-163

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
at line 81, The opening braces for the constructor
TMTThirtyFivePlexQuantitationMethod::TMTThirtyFivePlexQuantitationMethod() and
the method updateMembers_() are on the same line as their signatures; change
each so the brace is on its own line (place the '{' on the following line) to
follow the project's brace-style guideline for function definitions while
keeping surrounding indentation consistent.

87-89: Prefer \n over std::endl for performance.

Per coding guidelines, avoid std::endl and prefer \n for better performance.

Suggested fix
-            OPENMS_LOG_WARN << "Warning: TMT 35-plex isotope correction is not yet calibrated. "
-                            << "Using identity matrix (no correction). Supply your own correction_matrix "
-                            << "values from your Thermo certificate for accurate quantitation." << std::endl;
+            OPENMS_LOG_WARN << "Warning: TMT 35-plex isotope correction is not yet calibrated. "
+                            << "Using identity matrix (no correction). Supply your own correction_matrix "
+                            << "values from your Thermo certificate for accurate quantitation.\n";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 87 - 89, The warning log in TMTThirtyFivePlexQuantitationMethod.cpp
uses std::endl which flushes the stream unnecessarily; replace the trailing
std::endl with '\n' in the OPENMS_LOG_WARN statement (the one in the
TMTThirtyFivePlexQuantitationMethod class/file) so the message ends with a
newline without forcing a flush for better performance.

17-18: Namespace brace placement violates coding guidelines.

Per coding guidelines, braces should be on their own lines. The opening brace for the namespace should be on a new line.

Suggested fix
-namespace OpenMS{
+namespace OpenMS
+{
     const String TMTThirtyFivePlexQuantitationMethod::name_ = "tmt35plex";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 17 - 18, The namespace opening brace is on the same line as
"namespace OpenMS" which violates the project's brace-style guideline; move the
brace to its own line so the block starts with "namespace OpenMS" on one line
and "{" on the next, leaving the existing declaration of
TMTThirtyFivePlexQuantitationMethod::name_ unchanged inside that namespace.

78-78: Minor formatting inconsistency in mass array.

There's inconsistent spacing: 135.151601,135.154526 ,135.160846 has a space before the last comma.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
at line 78, Fix the inconsistent spacing in the mass values list inside the
TMTThirtyFivePlexQuantitationMethod implementation: remove the stray space
before the comma and ensure consistent spacing after every comma in the array
literal (e.g., change "135.151601,135.154526 ,135.160846" to use "135.151601,
135.154526, 135.160846"). Update the mass values array declared in the
TMTThirtyFivePlexQuantitationMethod code so all entries use the same ", "
separator.

200-204: Missing bounds check for reference_channel lookup.

If param_.getValue("reference_channel") returns a value not in channel_names_, std::find returns end(), and reference_channel_ would be set to 35 (out of bounds). While setValidStrings on line 145 should prevent invalid values, defensive coding would add an explicit check.

Suggested defensive check
     std::vector<std::string>::const_iterator t_it = std::find(TMTThirtyFivePlexQuantitationMethod::channel_names_.begin(),
                                                             TMTThirtyFivePlexQuantitationMethod::channel_names_.end(),
                                                             param_.getValue("reference_channel"));

+    if (t_it == TMTThirtyFivePlexQuantitationMethod::channel_names_.end())
+    {
+      throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
+        "Invalid reference channel", param_.getValue("reference_channel").toString());
+    }
     reference_channel_ = t_it - TMTThirtyFivePlexQuantitationMethod::channel_names_.begin();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 200 - 204, The lookup of param_.getValue("reference_channel") using
std::find on TMTThirtyFivePlexQuantitationMethod::channel_names_ lacks a bounds
check; after obtaining t_it, explicitly test if t_it ==
TMTThirtyFivePlexQuantitationMethod::channel_names_.end() and handle the error
(e.g., throw an informative exception or log and use a safe default) instead of
unconditionally computing reference_channel_ = t_it - channel_names_.begin();
ensure the error message includes the invalid value from
param_.getValue("reference_channel") and mentions
TMTThirtyFivePlexQuantitationMethod so it’s easy to trace.

156-159: Example correction_matrix row has confusing spacing.

The example row 'NA/NA/NA/NA / 0.82/NA/NA / 0.30/8.71/0.33 / 0.00/0.00/0.26/0.00' has unusual spacing (e.g., NA / 0.82). While the description states whitespaces can be used "at your leisure," this specific pattern is potentially confusing. A cleaner example would improve documentation clarity.

The previous review flagged invalid tokenization. If whitespace trimming is handled by the parser, this may be fine functionally, but the spacing is still awkward for documentation purposes.

Suggested cleaner example
-                          "e.g. one row may look like this: 'NA/NA/NA/NA  /  0.82/NA/NA  /  0.30/8.71/0.33  /  0.00/0.00/0.26/0.00'. "
+                          "e.g. one row may look like this: 'NA/NA/NA/NA/0.82/NA/NA/0.30/8.71/0.33/0.00/0.00/0.26/0.00'. "
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 156 - 159, The example correction_matrix row in the
TMTThirtyFivePlexQuantitationMethod message is confusing due to irregular
spacing; update the example string (inside the
TMTThirtyFivePlexQuantitationMethod message literal) to use a clean,
consistently spaced or spaceless example such as
'NA/NA/NA/NA/0.82/NA/NA/0.30/8.71/0.33/0.00/0.00/0.26/0.00' so the tokenization
is unambiguous and matches the described 14-value format.
src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp (2)

66-74: Minor formatting inconsistency in test data.

Same spacing issue as in implementation: 135.151601,135.154526 ,135.160846. Consider fixing in both files for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp`
around lines 66 - 74, The array initializer for channel_centers in
TMTThirtyFivePlexQuantitationMethod_test.cpp has inconsistent spacing around the
last three values ("135.151601,135.154526 ,135.160846"); normalize the spacing
to match the rest of the list (e.g., "135.151601, 135.154526, 135.160846") and
apply the same formatting fix in the corresponding implementation file where the
same literals appear so both test and implementation use consistent whitespace
for the channel_centers array.

80-85: Consider using Size type for consistency.

The loop uses int but indexes into channel_list. While functionally correct, using Size would be more consistent with OpenMS conventions.

Suggested fix
-  for(int i = 0; i< 35; i++){
+  for(Size i = 0; i < 35; ++i)
+  {
     TEST_STRING_EQUAL(channel_list[i].description, "")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp`
around lines 80 - 85, The loop in the test uses an int index to iterate over
channel_list; replace the int with the OpenMS Size type to match project
conventions (e.g., use Size i = 0; i < channel_list.size(); ++i) and update any
comparisons that rely on the index (channel_list[i].id) to use the Size index;
modify the for loop declaration in TMTThirtyFivePlexQuantitationMethod_test.cpp
where channel_list, channel_names, channel_centers and channel_list[i].id are
referenced.
src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp (1)

81-85: Minor: Comment slightly inaccurate.

The comment says "affected by 14 other channels" but technically each channel has 14 entries in its interaction vector (some may be -1, indicating no interaction at that position). Consider: "has a 14-element interaction vector for isotope overlap corrections."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp`
around lines 81 - 85, Update the misleading comment above the loop over
channel_list: replace "Each TMT 32-plex channel is affected by 14 other channels
due to isotope overlap" with a clearer description such as "Each TMT 32-plex
channel has a 14-element interaction vector for isotope overlap corrections
(positions may be -1 when no interaction)". Keep the
TEST_EQUAL(channel.affected_channels.size(), 14) assertion unchanged and only
modify the comment near the loop and the channel.affected_channels reference.
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

158-190: Minor: Inconsistent whitespace around assignment operators.

Several lines have extra spaces between = and the value (e.g., lines 162, 165-166, 169-170, 173-174, etc.). This doesn't affect functionality but reduces code consistency.

🔧 Example cleanup for a few lines
-    channels_[3].description =  param_.getValue("channel_127D_description").toString();
+    channels_[3].description = param_.getValue("channel_127D_description").toString();
     channels_[4].description = param_.getValue("channel_128N_description").toString();
     channels_[5].description = param_.getValue("channel_128C_description").toString();
-    channels_[6].description =  param_.getValue("channel_128ND_description").toString();
-    channels_[7].description =  param_.getValue("channel_128CD_description").toString();
+    channels_[6].description = param_.getValue("channel_128ND_description").toString();
+    channels_[7].description = param_.getValue("channel_128CD_description").toString();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
around lines 158 - 190, In TMTThirtyTwoPlexQuantitationMethod::updateMembers_(),
normalize the whitespace around the assignment operator for all channels_
entries so each line uses a single space on both sides of '=' (e.g., change
"channels_[3].description =  param_.getValue(...)" and similar lines with extra
spaces to "channels_[3].description = param_.getValue(...)"); update all
occurrences (channels_[3], [6], [7], [10], [11], [14], [15], [18], [19], [22],
[23], [26], [27], [29], [30], [31]) to match the consistent spacing style used
elsewhere in the function.

192-196: Consider defensive check for invalid reference channel lookup.

If std::find returns end() (reference channel not found), reference_channel_ would be set to 32, which is out of bounds. Although setValidStrings should prevent invalid values at parameter time, a defensive guard would make the code more robust against future changes.

🛡️ Proposed defensive check
     std::vector<std::string>::const_iterator t_it = std::find(TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin(),
                                                             TMTThirtyTwoPlexQuantitationMethod::channel_names_.end(),
                                                             param_.getValue("reference_channel"));
 
+    if (t_it == TMTThirtyTwoPlexQuantitationMethod::channel_names_.end())
+    {
+      throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
+        "Invalid reference_channel: " + param_.getValue("reference_channel").toString());
+    }
     reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
around lines 192 - 196, The lookup of the reference channel using std::find can
return end() and thus compute an out-of-range index for reference_channel_; add
a defensive check after the find (using
TMTThirtyTwoPlexQuantitationMethod::channel_names_ and the value from
param_.getValue("reference_channel")): if t_it == channel_names_.end() then
handle the error deterministically (e.g., throw an exception or call throw
Exception::InvalidParameter with a clear message including the invalid
param_.getValue(...) value) instead of assigning an out-of-bounds index;
otherwise compute reference_channel_ = t_it - channel_names_.begin() as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Line 81: The opening braces for the constructor
TMTThirtyFivePlexQuantitationMethod::TMTThirtyFivePlexQuantitationMethod() and
the method updateMembers_() are on the same line as their signatures; change
each so the brace is on its own line (place the '{' on the following line) to
follow the project's brace-style guideline for function definitions while
keeping surrounding indentation consistent.
- Around line 87-89: The warning log in TMTThirtyFivePlexQuantitationMethod.cpp
uses std::endl which flushes the stream unnecessarily; replace the trailing
std::endl with '\n' in the OPENMS_LOG_WARN statement (the one in the
TMTThirtyFivePlexQuantitationMethod class/file) so the message ends with a
newline without forcing a flush for better performance.
- Around line 17-18: The namespace opening brace is on the same line as
"namespace OpenMS" which violates the project's brace-style guideline; move the
brace to its own line so the block starts with "namespace OpenMS" on one line
and "{" on the next, leaving the existing declaration of
TMTThirtyFivePlexQuantitationMethod::name_ unchanged inside that namespace.
- Line 78: Fix the inconsistent spacing in the mass values list inside the
TMTThirtyFivePlexQuantitationMethod implementation: remove the stray space
before the comma and ensure consistent spacing after every comma in the array
literal (e.g., change "135.151601,135.154526 ,135.160846" to use "135.151601,
135.154526, 135.160846"). Update the mass values array declared in the
TMTThirtyFivePlexQuantitationMethod code so all entries use the same ", "
separator.
- Around line 200-204: The lookup of param_.getValue("reference_channel") using
std::find on TMTThirtyFivePlexQuantitationMethod::channel_names_ lacks a bounds
check; after obtaining t_it, explicitly test if t_it ==
TMTThirtyFivePlexQuantitationMethod::channel_names_.end() and handle the error
(e.g., throw an informative exception or log and use a safe default) instead of
unconditionally computing reference_channel_ = t_it - channel_names_.begin();
ensure the error message includes the invalid value from
param_.getValue("reference_channel") and mentions
TMTThirtyFivePlexQuantitationMethod so it’s easy to trace.
- Around line 156-159: The example correction_matrix row in the
TMTThirtyFivePlexQuantitationMethod message is confusing due to irregular
spacing; update the example string (inside the
TMTThirtyFivePlexQuantitationMethod message literal) to use a clean,
consistently spaced or spaceless example such as
'NA/NA/NA/NA/0.82/NA/NA/0.30/8.71/0.33/0.00/0.00/0.26/0.00' so the tokenization
is unambiguous and matches the described 14-value format.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`:
- Around line 158-190: In TMTThirtyTwoPlexQuantitationMethod::updateMembers_(),
normalize the whitespace around the assignment operator for all channels_
entries so each line uses a single space on both sides of '=' (e.g., change
"channels_[3].description =  param_.getValue(...)" and similar lines with extra
spaces to "channels_[3].description = param_.getValue(...)"); update all
occurrences (channels_[3], [6], [7], [10], [11], [14], [15], [18], [19], [22],
[23], [26], [27], [29], [30], [31]) to match the consistent spacing style used
elsewhere in the function.
- Around line 192-196: The lookup of the reference channel using std::find can
return end() and thus compute an out-of-range index for reference_channel_; add
a defensive check after the find (using
TMTThirtyTwoPlexQuantitationMethod::channel_names_ and the value from
param_.getValue("reference_channel")): if t_it == channel_names_.end() then
handle the error deterministically (e.g., throw an exception or call throw
Exception::InvalidParameter with a clear message including the invalid
param_.getValue(...) value) instead of assigning an out-of-bounds index;
otherwise compute reference_channel_ = t_it - channel_names_.begin() as before.

In
`@src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp`:
- Around line 66-74: The array initializer for channel_centers in
TMTThirtyFivePlexQuantitationMethod_test.cpp has inconsistent spacing around the
last three values ("135.151601,135.154526 ,135.160846"); normalize the spacing
to match the rest of the list (e.g., "135.151601, 135.154526, 135.160846") and
apply the same formatting fix in the corresponding implementation file where the
same literals appear so both test and implementation use consistent whitespace
for the channel_centers array.
- Around line 80-85: The loop in the test uses an int index to iterate over
channel_list; replace the int with the OpenMS Size type to match project
conventions (e.g., use Size i = 0; i < channel_list.size(); ++i) and update any
comparisons that rely on the index (channel_list[i].id) to use the Size index;
modify the for loop declaration in TMTThirtyFivePlexQuantitationMethod_test.cpp
where channel_list, channel_names, channel_centers and channel_list[i].id are
referenced.

In
`@src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp`:
- Around line 81-85: Update the misleading comment above the loop over
channel_list: replace "Each TMT 32-plex channel is affected by 14 other channels
due to isotope overlap" with a clearer description such as "Each TMT 32-plex
channel has a 14-element interaction vector for isotope overlap corrections
(positions may be -1 when no interaction)". Keep the
TEST_EQUAL(channel.affected_channels.size(), 14) assertion unchanged and only
modify the comment near the loop and the channel.affected_channels reference.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa460e55-b768-4c18-bad7-6dd05f390d10

📥 Commits

Reviewing files that changed from the base of the PR and between f7af2de and 77d908a.

📒 Files selected for processing (5)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
  • src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp
  • src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp
  • src/topp/IsobaricAnalyzer.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/topp/IsobaricAnalyzer.cpp

@timosachsenberg
timosachsenberg requested a review from cbielow March 26, 2026 09:57

@cbielow cbielow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address comments, they are applicable to both 32 and 35plex.

- Remove OPENMS_LOG_WARN from TMT32/35 constructors (confusing since
  IsobaricAnalyzer eagerly constructs all methods)
- Add clarifying comments to interaction_vector: topology for routing
  correction values, not correction magnitudes; no effect with all-NA
  default correction_matrix
- Rewrite IsobaricChannelExtractor TMT32 test with synthetic spectrum:
  builds MS2 from scratch with known intensities, verifies identity
  matrix returns them unchanged
- Remove unused IsobaricChannelExtractor_9.mzML test data

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp (1)

734-734: Minor formatting: Opening brace should be on its own line.

For consistency with the rest of the file (see lines 551-552, 77-78), the opening brace should be on a separate line.

Suggested fix
-START_SECTION(([EXTRA] TMT 32plex support)){
+START_SECTION(([EXTRA] TMT 32plex support))
+{

As per coding guidelines: "Use braces on their own lines, aligned"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp` at
line 734, The opening brace for the START_SECTION test block is on the same line
as the macro (START_SECTION(([EXTRA] TMT 32plex support))){ — move the brace to
its own line so it matches the project's brace style; locate the
START_SECTION(([EXTRA] TMT 32plex support)) occurrence in
IsobaricChannelExtractor_test.cpp and change it to have the '{' on the next line
(aligned with other blocks like those at lines ~77-78 and ~551-552).
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp (2)

22-31: Fail fast if the 35-entry lookup tables ever drift apart.

The constructor indexes channel_names_, interaction_vector, and o_mass35 in lockstep but only bounds on o_mass35.size(). One later edit to any of those tables can silently miswire channels or read past a shorter table. A small invariant check here would make this much safer to maintain.

Also applies to: 39-76, 91-95

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 22 - 31, Add a runtime invariant check in
TMTThirtyFivePlexQuantitationMethod's constructor to ensure the lookup tables
remain the same length: verify channel_names_.size() ==
interaction_vector.size() == o_mass35.size() (and the other table groups noted
at lines 39-76 and 91-95) and fail fast (throw an exception or assert) if they
differ; locate the check near construction/initialization of these static
vectors in TMTThirtyFivePlexQuantitationMethod and include a clear error message
naming the mismatched vector(s) so any future edit that changes one table size
will immediately surface.

104-141: Generate the per-channel params from channel_names_ instead of spelling them out twice.

The same 35-channel mapping now has to stay in sync across channel_names_, setDefaultParams_(), and updateMembers_(). A small loop/helper would remove a lot of manual duplication and reduce the chance of binding a description or reference label to the wrong channel.

Also applies to: 159-200

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 104 - 141, Replace the hard-coded per-channel defaults by iterating
over TMTThirtyFivePlexQuantitationMethod::channel_names_ inside
setDefaultParams_() to call defaults_.setValue("<channel>_description", "", ...)
for each name and to build the comma-separated valid list for
"reference_channel" (used in defaults_.setValue and defaults_.setValidStrings),
and do the same loop-based mapping in updateMembers_() to read/save per-channel
values rather than repeating the 35 entries; locate usages in
setDefaultParams_(), updateMembers_(), and the static channel_names_ to
implement a single loop/helper that keeps names, defaults and member updates in
sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Around line 22-31: Add a runtime invariant check in
TMTThirtyFivePlexQuantitationMethod's constructor to ensure the lookup tables
remain the same length: verify channel_names_.size() ==
interaction_vector.size() == o_mass35.size() (and the other table groups noted
at lines 39-76 and 91-95) and fail fast (throw an exception or assert) if they
differ; locate the check near construction/initialization of these static
vectors in TMTThirtyFivePlexQuantitationMethod and include a clear error message
naming the mismatched vector(s) so any future edit that changes one table size
will immediately surface.
- Around line 104-141: Replace the hard-coded per-channel defaults by iterating
over TMTThirtyFivePlexQuantitationMethod::channel_names_ inside
setDefaultParams_() to call defaults_.setValue("<channel>_description", "", ...)
for each name and to build the comma-separated valid list for
"reference_channel" (used in defaults_.setValue and defaults_.setValidStrings),
and do the same loop-based mapping in updateMembers_() to read/save per-channel
values rather than repeating the 35 entries; locate usages in
setDefaultParams_(), updateMembers_(), and the static channel_names_ to
implement a single loop/helper that keeps names, defaults and member updates in
sync.

In `@src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp`:
- Line 734: The opening brace for the START_SECTION test block is on the same
line as the macro (START_SECTION(([EXTRA] TMT 32plex support))){ — move the
brace to its own line so it matches the project's brace style; locate the
START_SECTION(([EXTRA] TMT 32plex support)) occurrence in
IsobaricChannelExtractor_test.cpp and change it to have the '{' on the next line
(aligned with other blocks like those at lines ~77-78 and ~551-552).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 469e74cf-ed1d-4a84-8a7f-e0eeb7de4904

📥 Commits

Reviewing files that changed from the base of the PR and between 77d908a and dd7ab0b.

📒 Files selected for processing (3)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
  • src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp
✅ Files skipped from review due to trivial changes (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp

@cbielow cbielow left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost there...
Comments are valid for both 32 and 35 plex

Comment on lines +752 to +757
// Build synthetic MS2 spectrum with peaks at channel positions
MSSpectrum ms2;
ms2.setMSLevel(2);
ms2.setRT(100.0);
ms2.setNativeID("scan=1");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, nice. Now add a test to IsobaricQuantifier_test and extend the quantify() method in a similar way. Ensure that the identity matrix is actually used, no matter what the user inputs (since we are not sure the interaction matrix is working correctly at the moment)

TMT 32-plex and 35-plex isotope correction matrices are not yet
validated. Force getIsotopeCorrectionMatrix() to always return the
identity matrix regardless of user-supplied correction_matrix parameter.
Document this in the parameter description.

Add IsobaricQuantifier test that verifies:
1. getIsotopeCorrectionMatrix() returns identity even after setting
   non-identity values via parameters
2. quantify() preserves channel intensities with no correction applied

Addresses review feedback from @cbielow.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (7)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (3)

16-16: Namespace brace should be on its own line.

Per coding guidelines, braces should be on their own lines. The namespace opening brace is on the same line as the declaration.

Suggested fix
-namespace OpenMS{
+namespace OpenMS
+{
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
at line 16, The namespace opening brace for namespace OpenMS is on the same line
as the declaration; move the brace to its own line so the declaration follows
the project's brace style (i.e., change "namespace OpenMS{" to "namespace
OpenMS" on one line and "{" on the next) in the file containing
ANALYSIS::QUANTITATION::TMTThirtyTwoPlexQuantitationMethod (look for the
namespace OpenMS declaration).

151-183: Inconsistent whitespace in updateMembers_().

Several lines have inconsistent spacing around the assignment operator (extra spaces before =), which affects readability and consistency. Examples: lines 155, 158, 159, 162, 163, etc.

Example cleanup
-    channels_[3].description =  param_.getValue("channel_127D_description").toString();
+    channels_[3].description = param_.getValue("channel_127D_description").toString();
-    channels_[6].description =  param_.getValue("channel_128ND_description").toString();
+    channels_[6].description = param_.getValue("channel_128ND_description").toString();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
around lines 151 - 183, Tidy inconsistent whitespace in
TMTThirtyTwoPlexQuantitationMethod::updateMembers_(): normalize spacing around
the assignment operator for all channels_ assignments (e.g. channels_[3],
channels_[6], channels_[7], channels_[10], channels_[11], channels_[14],
channels_[15], channels_[18], channels_[19], channels_[22], channels_[23],
channels_[26], channels_[27], channels_[29], channels_[30], channels_[31]) so
each line uses a single space before and after '=' and consistent indentation,
keeping the param_.getValue(...) calls and toString() unchanged.

138-149: Consider extracting the identity row string to avoid duplication.

The identity row string "NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA" is defined both in setDefaultParams_() (line 143) and getIsotopeCorrectionMatrix() (line 217). Consider making it a static const member or a local constant at namespace scope to ensure consistency and simplify future changes.

Suggested refactor
+namespace
+{
+  const std::string IDENTITY_ROW = "NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA";
+} // anonymous namespace
+
 void TMTThirtyTwoPlexQuantitationMethod::setDefaultParams_()
 {
     // ... channel descriptions ...
     
-    const std::string identity_row = "NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA";
     defaults_.setValue("correction_matrix",
-                       std::vector<std::string>(32, identity_row),
+                       std::vector<std::string>(32, IDENTITY_ROW),
                        "Ignored for TMT 32-plex (identity matrix is always used). "
                        "Isotope correction is not yet supported for this method.");
     // ...
 }

 Matrix<double> TMTThirtyTwoPlexQuantitationMethod::getIsotopeCorrectionMatrix() const
 {
     // Always return identity matrix — isotope correction is not yet validated for TMT 32-plex.
     // User-supplied correction_matrix parameter is ignored.
-    const std::string identity_row = "NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA/NA";
-    StringList iso_correction(32, identity_row);
+    StringList iso_correction(32, IDENTITY_ROW);
     return stringListToIsotopeCorrectionMatrix_(iso_correction);
 }

Also applies to: 213-220

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`
around lines 138 - 149, Extract the repeated identity row string into a single
constant and use it in both setDefaultParams_() and
getIsotopeCorrectionMatrix(): create a static const std::string (e.g.
IDENTITY_ROW or s_identity_row) at class scope or anonymous namespace scope
inside TMTThirtyTwoPlexQuantitationMethod.cpp, replace the inline literal in
defaults_.setValue(...) and the literal in getIsotopeCorrectionMatrix() with
that constant, and ensure any tests or uses reference that symbol so the two
definitions are unified.
src/tests/class_tests/openms/source/IsobaricQuantifier_test.cpp (1)

174-180: Verify iteration order assumption.

The test iterates over cm_out[0] assuming the FeatureHandle elements appear in the same order they were inserted (by map index 0..31). While ConsensusFeature typically preserves order, if this assumption proves fragile, consider looking up handles by map index instead:

for (Size i = 0; i < n_channels; ++i)
{
  auto fh = std::find_if(cm_out[0].begin(), cm_out[0].end(),
    [i](const FeatureHandle& h){ return h.getMapIndex() == i; });
  TEST_REAL_SIMILAR(fh->getIntensity(), 1000.0 * (i + 1))
}

This is a minor robustness suggestion—the current code likely works fine given typical container behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tests/class_tests/openms/source/IsobaricQuantifier_test.cpp` around lines
174 - 180, The test assumes iteration order of cm_out[0] matches insertion
order; make it robust by looking up FeatureHandle by map index instead of
relying on sequence: inside the loop over n_channels use std::find_if on
cm_out[0] to locate the FeatureHandle whose getMapIndex() == i and then assert
its getIntensity() equals 1000.0*(i+1); this replaces the direct iterator-based
checks around cm_out and cf_it.
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp (3)

94-97: Use Size instead of size_t per coding guidelines.

OpenMS code should use primitive types from OpenMS/CONCEPT/Types.h. Also, the trailing semicolon after }; on line 97 is unnecessary.

✏️ Suggested fix
-        for(size_t i =0; i<o_mass35.size(); i++){
+        for (Size i = 0; i < o_mass35.size(); ++i)
+        {
             channels_.push_back(make_channel(channel_names_[i],i,o_mass35[i],i));
-        };                                                                        
+        }

As per coding guidelines: "Use Size/SignedSize for STL .size() values instead of size_t".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 94 - 97, Replace the use of the raw type size_t in the loop with
OpenMS' Size type and remove the stray trailing semicolon after the closing
brace; specifically, change the loop header to use Size (from
OpenMS/CONCEPT/Types.h) for the index iterating over o_mass35 in the code that
pushes into channels_ via make_channel(channel_names_[i], i, o_mass35[i], i),
and delete the unnecessary semicolon following the loop's closing brace.

156-198: Inconsistent whitespace in assignments.

Several lines have inconsistent spacing around the = operator (e.g., double spaces on lines 160, 163-164, 175-176, etc.). This is a minor formatting concern.

✏️ Example fixes for consistent spacing
-    channels_[3].description =  param_.getValue("channel_127D_description").toString();
+    channels_[3].description = param_.getValue("channel_127D_description").toString();

Similar fixes needed for lines 163-164, 167-168, 171-172, 175-176, 178-180, 182-184, 187-188, 190-191.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 156 - 198, The assignment statements in
TMTThirtyFivePlexQuantitationMethod::updateMembers_ have inconsistent whitespace
around the = operator (e.g., assignments to channels_[3], channels_[6],
channels_[10], etc.); normalize them by ensuring a single space before and after
= for all lines that set channels_[N].description using
param_.getValue(...).toString(), and keep the std::vector::const_iterator and
reference_channel_ computation formatted similarly; locate these changes in
updateMembers_ where channels_ and param_.getValue are used and apply consistent
spacing.

76-84: Minor formatting: missing space after comma.

Line 83 has inconsistent spacing in the mass array.

✏️ Suggested fix
-        135.151601,135.154526 ,135.160846
+        135.151601, 135.154526, 135.160846
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`
around lines 76 - 84, Fix the spacing in the static array o_mass35 in
TMTThirtyFivePlexQuantitationMethod: change "135.151601,135.154526 ,135.160846"
to "135.151601, 135.154526, 135.160846" so there is a single space after each
comma and no stray space before commas.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp`:
- Around line 94-97: Replace the use of the raw type size_t in the loop with
OpenMS' Size type and remove the stray trailing semicolon after the closing
brace; specifically, change the loop header to use Size (from
OpenMS/CONCEPT/Types.h) for the index iterating over o_mass35 in the code that
pushes into channels_ via make_channel(channel_names_[i], i, o_mass35[i], i),
and delete the unnecessary semicolon following the loop's closing brace.
- Around line 156-198: The assignment statements in
TMTThirtyFivePlexQuantitationMethod::updateMembers_ have inconsistent whitespace
around the = operator (e.g., assignments to channels_[3], channels_[6],
channels_[10], etc.); normalize them by ensuring a single space before and after
= for all lines that set channels_[N].description using
param_.getValue(...).toString(), and keep the std::vector::const_iterator and
reference_channel_ computation formatted similarly; locate these changes in
updateMembers_ where channels_ and param_.getValue are used and apply consistent
spacing.
- Around line 76-84: Fix the spacing in the static array o_mass35 in
TMTThirtyFivePlexQuantitationMethod: change "135.151601,135.154526 ,135.160846"
to "135.151601, 135.154526, 135.160846" so there is a single space after each
comma and no stray space before commas.

In
`@src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp`:
- Line 16: The namespace opening brace for namespace OpenMS is on the same line
as the declaration; move the brace to its own line so the declaration follows
the project's brace style (i.e., change "namespace OpenMS{" to "namespace
OpenMS" on one line and "{" on the next) in the file containing
ANALYSIS::QUANTITATION::TMTThirtyTwoPlexQuantitationMethod (look for the
namespace OpenMS declaration).
- Around line 151-183: Tidy inconsistent whitespace in
TMTThirtyTwoPlexQuantitationMethod::updateMembers_(): normalize spacing around
the assignment operator for all channels_ assignments (e.g. channels_[3],
channels_[6], channels_[7], channels_[10], channels_[11], channels_[14],
channels_[15], channels_[18], channels_[19], channels_[22], channels_[23],
channels_[26], channels_[27], channels_[29], channels_[30], channels_[31]) so
each line uses a single space before and after '=' and consistent indentation,
keeping the param_.getValue(...) calls and toString() unchanged.
- Around line 138-149: Extract the repeated identity row string into a single
constant and use it in both setDefaultParams_() and
getIsotopeCorrectionMatrix(): create a static const std::string (e.g.
IDENTITY_ROW or s_identity_row) at class scope or anonymous namespace scope
inside TMTThirtyTwoPlexQuantitationMethod.cpp, replace the inline literal in
defaults_.setValue(...) and the literal in getIsotopeCorrectionMatrix() with
that constant, and ensure any tests or uses reference that symbol so the two
definitions are unified.

In `@src/tests/class_tests/openms/source/IsobaricQuantifier_test.cpp`:
- Around line 174-180: The test assumes iteration order of cm_out[0] matches
insertion order; make it robust by looking up FeatureHandle by map index instead
of relying on sequence: inside the loop over n_channels use std::find_if on
cm_out[0] to locate the FeatureHandle whose getMapIndex() == i and then assert
its getIntensity() equals 1000.0*(i+1); this replaces the direct iterator-based
checks around cm_out and cf_it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d85bed6-3e33-4475-b08b-24926fbae394

📥 Commits

Reviewing files that changed from the base of the PR and between dd7ab0b and a64a160.

📒 Files selected for processing (3)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp
  • src/tests/class_tests/openms/source/IsobaricQuantifier_test.cpp

timosachsenberg and others added 2 commits March 26, 2026 18:40
pyOpenMS uses nanobind, not Cython. These .pxd files are not used.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@timosachsenberg
timosachsenberg merged commit 0cd0635 into develop Mar 27, 2026
50 of 51 checks passed
@timosachsenberg
timosachsenberg deleted the fix/tmt32-35-identity-matrix branch March 27, 2026 09:16
@jpfeuffer

Copy link
Copy Markdown
Contributor

@jpfeuffer

Copy link
Copy Markdown
Contributor

Good point! The non-deuterated channels are already covered by the existing TMT 16-plex correction matrix in OpenMS. Let me look at that.Now I have everything needed. The TMT16plex uses an 8-column format (<-2C13>/<-N15-C13>/<-C13>/<-N15>/<+N15>/<+C13>/<+N15+C13>/<+2C13>), while TMT32plex uses a 14-column format. The 16plex channels are exactly the non-deuterated channels of the 32plex (126, 127N, 127C, 128N, 128C, 129N, 129C, 130N, 130C, 131N, 131C, 132N, 132C, 133N, 133C, 134N), but the 32plex format has 14 columns vs 8 columns.

The key insight: The 32plex 14-column format has additional columns for the deuterium-related offsets (-15N-2H, -13C-15N, -15N+2H pairs) that don't exist in the 8-column TMT16plex format. For pure non-deuterated channels, those extra columns are always NA. So the mapping from the 16plex 8-column format to the 32plex 14-column format is:

16plex col 32plex col Description
<-2C13> col 2 (-2x13C)
<-N15-C13> col 4 (-13C-15N)
<-C13> col 6 (-13C)
<-N15> col 7 (-15N)
<+N15> col 8 (+15N)
<+C13> col 9 (+13C)
<+N15+C13> col 11 (+15N+2H) → actually +15N+13C col 11
<+2C13> col 13 (+13C+2H) → actually +2x13C col 12

More precisely, the 32plex 14 columns are:
[0]-13C-2H / [1]-2x13C / [2]-15N-2H / [3]-13C-15N / [4]-2H / [5]-13C / [6]-15N / [7]+15N / [8]+13C / [9]+2H / [10]+15N+13C / [11]+15N+2H / [12]+2x13C / [13]+13C+2H

And the 16plex 8 columns map to: [1]-2x13C / [3]-13C-15N / [5]-13C / [6]-15N / [7]+15N / [8]+13C / [10]+15N+13C / [12]+2x13C

So the non-deuterated rows go from A/B/C/D/E/F/G/H (16plex) to NA/A/NA/B/NA/C/D/E/F/NA/G/NA/H/NA (32plex).

Here is the complete combined correction_matrix for the 32plex, interleaving the 16plex values for non-deuterated channels and the COA values from your PDF for the deuterated channels:

defaults_.setValue("correction_matrix", std::vector<std::string>{
  // 126     (from TMT16plex COA)
  "NA/NA/NA/NA/NA/NA/NA/0.31/9.09/0.02/0.02/NA/0.32/NA",
  // 127N    (from TMT16plex COA)
  "NA/NA/NA/NA/NA/NA/0.78/NA/9.41/NA/NA/NA/0.33/NA",
  // 127C    (from TMT16plex COA)
  "NA/NA/NA/NA/0.93/NA/NA/0.35/8.63/0.01/0.01/NA/0.27/NA",
  // 127D    (from TMTpro32plex deuterated COA)
  "NA/NA/NA/NA/0.82/NA/NA/0.30/8.71/0.33/0.00/0.00/0.26/0.00",
  // 128N    (from TMT16plex COA)
  "NA/0.00/NA/NA/0.82/0.65/NA/NA/8.13/NA/NA/NA/0.26/NA",
  // 128C    (from TMT16plex COA)
  "0.00/NA/NA/NA/1.47/NA/NA/0.34/6.91/0.00/0.00/NA/0.15/NA",
  // 128ND   (from TMTpro32plex deuterated COA)
  "NA/NA/0.00/NA/1.13/NA/0.59/NA/8.61/0.24/NA/NA/0.28/0.00",
  // 128CD   (from TMTpro32plex deuterated COA)
  "0.00/NA/NA/NA/1.47/0.70/NA/0.30/7.55/0.27/0.00/0.00/0.21/0.00",
  // 129N    (from TMT16plex COA)
  "0.00/0.00/NA/NA/1.46/1.28/NA/NA/6.86/NA/NA/NA/0.15/NA",
  // 129C    (from TMT16plex COA)
  "0.13/NA/NA/NA/2.59/NA/NA/0.32/6.07/0.10/0.10/NA/0.09/NA",
  // 129ND   (from TMTpro32plex deuterated COA)
  "0.00/NA/0.00/0.00/1.97/0.91/0.61/NA/7.58/0.35/NA/NA/0.19/0.00",
  // 129CD   (from TMTpro32plex deuterated COA)
  "0.00/0.00/NA/NA/1.39/1.37/NA/0.31/6.02/0.50/0.00/0.00/0.08/0.00",
  // 130N    (from TMT16plex COA)
  "0.13/0.00/NA/NA/2.41/0.27/NA/NA/5.58/NA/NA/NA/0.10/NA",
  // 130C    (from TMT16plex COA)
  "0.04/NA/NA/NA/3.10/NA/NA/0.42/4.82/0.02/0.02/NA/0.06/NA",
  // 130ND   (from TMTpro32plex deuterated COA)
  "0.00/0.08/0.00/0.00/1.77/1.50/0.59/NA/6.10/0.54/NA/NA/0.09/0.00",
  // 130CD   (from TMTpro32plex deuterated COA)
  "0.00/0.10/NA/NA/1.44/2.18/NA/0.33/5.49/0.40/0.00/0.00/0.06/0.00",
  // 131N    (from TMT16plex COA)
  "0.03/0.00/NA/NA/2.78/0.63/NA/NA/4.57/NA/NA/NA/0.12/NA",
  // 131C    (from TMT16plex COA)
  "0.08/NA/NA/NA/3.90/NA/NA/0.47/3.57/0.00/0.00/NA/0.04/NA",
  // 131ND   (from TMTpro32plex deuterated COA)
  "0.01/0.19/0.00/0.00/1.47/2.23/0.61/NA/5.48/0.41/NA/NA/0.05/0.00",
  // 131CD   (from TMTpro32plex deuterated COA)
  "0.02/0.02/NA/NA/2.52/2.61/NA/0.98/4.14/1.15/0.01/0.00/0.02/0.01",
  // 132N    (from TMT16plex COA)
  "0.15/0.01/NA/NA/3.58/0.72/NA/NA/1.80/NA/NA/NA/0.00/NA",
  // 132C    (from TMT16plex COA)
  "0.11/NA/NA/NA/4.55/NA/NA/0.43/1.86/0.00/0.00/NA/0.00/NA",
  // 132ND   (from TMTpro32plex deuterated COA)
  "0.02/0.02/0.00/0.00/3.52/1.70/0.60/NA/4.19/0.85/NA/NA/0.01/0.00",
  // 132CD   (from TMTpro32plex deuterated COA)
  "0.00/0.03/NA/NA/1.00/3.35/NA/1.00/3.07/0.94/0.00/0.00/0.00/0.00",
  // 133N    (from TMT16plex COA)
  "0.07/0.01/NA/NA/3.14/0.73/NA/NA/3.40/NA/NA/NA/0.03/NA",
  // 133C    (from TMT16plex COA)
  "0.22/NA/NA/NA/4.96/NA/NA/0.34/1.03/0.00/0.00/NA/NA/NA",
  // 133ND   (from TMTpro32plex deuterated COA)
  "0.00/0.01/0.00/0.00/0.89/2.48/0.63/NA/3.14/0.51/NA/NA/0.00/0.00",
  // 133CD   (from TMTpro32plex deuterated COA)
  "0.01/0.01/NA/NA/1.86/3.73/NA/0.31/1.63/0.79/0.00/0.00/0.00/0.00",
  // 134N    (from TMT16plex COA)
  "0.30/0.03/NA/NA/5.49/0.62/NA/NA/1.14/NA/NA/NA/NA/NA",
  // 134ND   (from TMTpro32plex deuterated COA)
  "0.02/0.10/0.00/0.00/1.66/3.76/0.22/NA/1.73/0.31/NA/NA/0.00/0.00",
  // 134CD   (from TMTpro32plex deuterated COA)
  "0.03/0.23/NA/NA/1.53/4.94/NA/0.31/0.95/0.31/0.00/0.00/NA/0.00",
  // 135ND   (from TMTpro32plex deuterated COA)
  "0.04/0.23/0.00/0.00/1.54/4.85/0.21/NA/1.03/0.32/NA/NA/NA/0.00",
},
"Correction matrix for isotope distributions in percent. "
"Non-deuterated channels (126, 127N/C, 128N/C, 129N/C, 130N/C, 131N/C, 132N/C, 133N/C, 134N) "
"from TMTpro 16plex COA. Deuterated channels (127D, 128ND/CD, 129ND/CD, 130ND/CD, 131ND/CD, "
"132ND/CD, 133ND/CD, 134ND/CD, 135ND) from TMTpro 32plex COA (lot A40004777/3326773_3). "
"Format per row (14 values): <-13C-2H>/<-2x13C>/<-15N-2H>/<-13C-15N>/<-2H>/<-13C>/<-15N>/"
"<+15N>/<+13C>/<+2H>/<+15N+13C>/<+15N+2H>/<+2x13C>/<+13C+2H>");

The mapping logic applied:

The 8-column TMT16plex format A/B/C/D/E/F/G/H maps to 14-column TMT32plex positions as:

  • Cols [0,2,4,9,11,13] → NA (deuterium-related offsets, not applicable to non-deuterated channels)
  • A(-2C13) → col [1], B(-N15-C13) → col [3], C(-C13) → col [5], D(-N15) → col [6], E(+N15) → col [7], F(+C13) → col [8], G(+N15+C13) → col [10], H(+2C13) → col [12]

@jpfeuffer

jpfeuffer commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

Don't know if that makes sense but looks reasonable at first glance.
I just gave it the image of the PDFs.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@cbielow ;)

@jpfeuffer

jpfeuffer commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

I mean I don't think there is crosstalk between deuterated and non deuterated. 3mDa distance. Ideally users upload their two sheets. Maybe that's why there is no combined sheet

github-actions Bot pushed a commit that referenced this pull request Mar 28, 2026
Add missing changelog entries for commits after the 2026-03-26 sync:
- #9019: OpenSwathWorkflow direct Bruker .d (TDF) file input
- #9018: IM_PEAK format checks in Resampler, FeatureFinderCentroided, FeatureFinderMultiplex, PeakPickerHiRes
- #9003: TMT 32-plex and 35-plex quantitation support
- #9007: IMPeakType enum added, IMFormat::CENTROIDED deprecated
- #9011: BREAKING IMFormat::MIXED removed; determineIMFormat requires ms_level

Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Mar 28, 2026
Add missing changelog entries for commits after the 2026-03-26 sync:
- #9019: OpenSwathWorkflow direct Bruker .d (TDF) file input
- #9018: IM_PEAK format checks in Resampler, FeatureFinderCentroided, FeatureFinderMultiplex, PeakPickerHiRes
- #9003: TMT 32-plex and 35-plex quantitation support
- #9007: IMPeakType enum added, IMFormat::CENTROIDED deprecated
- #9011: BREAKING IMFormat::MIXED removed; determineIMFormat requires ms_level

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit to timosachsenberg/OpenMS that referenced this pull request Oct 15, 2026
Replace the placeholder identity correction matrices (added in OpenMS#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 OpenMS#7969.

Co-authored-by: FreezB11 <[email protected]>

https://claude.ai/code/session_01CwxxuL4okxsZTH6aCaUoCS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants