Skip to content

Support for TMT-32plex (fixed) - #7969

Closed
FreezB11 wants to merge 67 commits into
OpenMS:developfrom
FreezB11:develop
Closed

FreezB11 wants to merge 67 commits into
OpenMS:developfrom
FreezB11:develop

Conversation

@FreezB11

@FreezB11 FreezB11 commented Apr 4, 2025 •

Copy link
Copy Markdown

Summary

This pull request adds the initial implementation of TMT32Flex support to OpenMS. The update includes both the header file and corresponding source file.

Changes

  • Added TMTThirtyTwoPlexQuantitationMethod.h to src/openms/include/OpenMS/ANALYSIS/QUANTITATION/
  • Added TMTThirtyTwoPlexQuantitationMethod.h to src/openms/source/ANALYSIS/QUANTITATION/

Purpose

This addition lays the foundation for supporting TMT 32-plex labeling in the quantitation module of OpenMS, expanding the current capabilities for isobaric labeling workflows.

the correction matrix is taken from the thermo website
https://assets.thermofisher.com/TFS-Assets/LSG/certificate/Certificate-of-Analysis/A40000817_ZL403757.PDF
just the values of channels are not accurate and also off but has to be changes after verification.
~yash
closes #7629

Summary by CodeRabbit

We are excited to introduce enhanced quantitation capabilities for TMT 32‑plex and TMT 35‑plex experiments.

  • New Features

    • Support for TMT 32‑plex and TMT 35‑plex quantitation across tools and CLI.
    • Detailed per‑channel definitions with configurable descriptions, selectable reference channel, and built‑in isotope correction matrices.
    • Python bindings exposing the new quantitation methods.
  • Documentation

    • New methods included in parameter documentation generation.
  • Tests

    • Comprehensive unit tests and mzML test data validating 32‑ and 35‑plex behavior.
  • Chores

    • Added isotope mass‑difference constants for N and H.

@coderabbitai

coderabbitai Bot commented Apr 4, 2025 •

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

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds two new isobaric quantitation methods (TMT 32‑plex and TMT 35‑plex): headers, implementations, parameters and isotope‑correction matrices, unit tests and test data, Python Cython declarations, TOPP integration, documentation hooks, and two isotope mass‑difference constants.

Changes

Cohort / File(s) Summary
New quantitation headers
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h, src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.h
Added class declarations for TMT 32‑plex and 35‑plex inheriting IsobaricQuantitationMethod (ctors, dtor, copy/assign, getters, param hooks, channel lists, reference channel).
New quantitation implementations
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp, src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyFivePlexQuantitationMethod.cpp
Implementations build channel lists (names, masses, interference vectors), provide setDefaultParams_ with per‑channel descriptions and correction_matrix strings, updateMembers_, accessors, and conversion to numeric isotope correction matrices.
TOPP integration
src/topp/IsobaricAnalyzer.cpp
Included new headers and registered both quantitation methods via addMethod_ to expose them in IsobaricAnalyzer.
Build/source lists
src/openms/source/ANALYSIS/QUANTITATION/sources.cmake, src/openms/include/OpenMS/ANALYSIS/QUANTITATION/sources.cmake
Added the new .cpp and .h entries to the quantitation sources lists.
Documentation generator
doc/doxygen/parameters/DefaultParamHandlerDocumenter.cpp
Added includes and DOCME(...) calls so parameters of the new methods are documented.
Tests & test data
src/tests/class_tests/openms/source/TMTThirtyTwoPlexQuantitationMethod_test.cpp, src/tests/class_tests/openms/source/TMTThirtyFivePlexQuantitationMethod_test.cpp, src/tests/class_tests/openms/executables.cmake, src/tests/class_tests/openms/data/IsobaricChannelExtractor_9.mzML, src/tests/class_tests/openms/source/IsobaricChannelExtractor_test.cpp
Added comprehensive unit tests for both methods (construction, getters, channel integrity, isotope‑correction matrices, copy/assign, reference param), registered test executables, added mzML test data and extended extractor test for TMT32.
Python bindings (Cython .pxd)
src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd, src/pyOpenMS/pxds/TMTThirtyFivePlexQuantitationMethod.pxd
Added Cython declarations exposing constructors for both classes to pyOpenMS.
Constants
src/openms/include/OpenMS/CONCEPT/Constants.h
Added two inline chemical mass‑difference constants: N15N14_MASSDIFF_U and H2H1_MASSDIFF_U.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant TMT32 as TMTThirtyTwoPlexQuantitationMethod
    participant TMT35 as TMTThirtyFivePlexQuantitationMethod

    Client->>TMT32: constructor()
    Note right of TMT32: build channel list\n(assign names, masses,\ninteraction vectors)\nset default params & reference
    TMT32->>TMT32: setDefaultParams_() / updateMembers_()

    Client->>TMT32: getChannelInformation()
    TMT32-->>Client: IsobaricChannelList
    Client->>TMT32: getIsotopeCorrectionMatrix()
    TMT32-->>Client: Matrix<double>
    Client->>TMT32: getReferenceChannel()
    TMT32-->>Client: index

    Client->>TMT35: constructor()
    Note right of TMT35: analogous initialization for 35‑plex
    TMT35->>TMT35: setDefaultParams_() / updateMembers_()
Loading

Poem

I hop through headers, cpp and test,
I plant new channels, tidy and blessed.
Thirty‑two and thirty‑five now play,
Corrections set and params in array.
A rabbit cheers — the build runs today! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "Support for TMT-32plex (fixed)" directly and clearly describes the main change: adding TMT-32plex quantitation support to OpenMS.
Linked Issues check ✅ Passed The PR implements the core objective from issue #7629: a new TMTThirtyTwoPlexQuantitationMethod class with 32 channels and isotope correction matrix from Thermo Fisher, along with comprehensive integration.
Out of Scope Changes check ✅ Passed All changes directly support TMT-32plex implementation: new classes, integration points, tests, Python bindings, and two new constants for mass differences are all within scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@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: 0

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

45-89: Check correctness of the default parameter settings.

  • Lines 67-85: The correction matrix values are marked “TODO: verify.” Ensure these are accurate or confirm if placeholders are acceptable at this stage.
  • The approach to storing them as std::vector<std::string> is workable but verify that “NA” is handled properly downstream.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94a9194 and 745a2a4.

📒 Files selected for processing (2)
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (1 hunks)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (3)
  • TMTThirtyTwoPlexQuantitationMethod (16-43)
  • TMTThirtyTwoPlexQuantitationMethod (116-121)
  • rhs (123-123)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (11)
  • TMTThirtyTwoPlexQuantitationMethod (16-55)
  • TMTThirtyTwoPlexQuantitationMethod (22-22)
  • TMTThirtyTwoPlexQuantitationMethod (24-24)
  • setDefaultParams_ (52-52)
  • updateMembers_ (54-54)
  • rhs (27-27)
  • getMethodName (31-31)
  • getChannelInformation (32-32)
  • getNumberOfChannels (33-33)
  • getIsotopeCorrectionMatrix (34-34)
  • getReferenceChannel (35-35)
🔇 Additional comments (12)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (5)

1-5: No issues with the license block.
These lines contain standard licensing and attribution statements, which appear correct.


6-10: Header guards and includes look good.
The use of #pragma once and required OpenMS headers is conventional and clear.


11-16: Class documentation is concise.
The high-level Doxygen description sufficiently explains the TMT 32plex quantitation method. No further issues here.


17-37: Confirm the channel count vs. "32plex" naming.
Although the class name references "TMTThirtyTwoPlex," only 16 channels are declared. Please verify that this fully aligns with the intended TMT 32 multiplexing approach or whether more channels will be added later.


38-55: Class members and function declarations appear consistent.
The private members (channels_, name_, reference_channel_, channel_names_) and protected methods (setDefaultParams_, updateMembers_) align with the overarching design, and the overrides match the base class. Ensure thorough testing of the copy constructor and assignment operator in real usage to confirm no parameter desynchronization.

src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (7)

1-5: License header is consistent.
No issues identified with licensing and commentary blocks.


6-15: Includes and static members are appropriate.
Including <OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h> plus the data structures required is correct. The static definitions for name_ and channel_names_ match the class declaration.


16-43: Constructor implementation is clear but verify the “32plex” vs. 16 channels.

  • The constructor sets up 16 channel entries. Double-check that this matches the “TMTThirtyTwoPlex” concept or if additional channels need adding.
  • The // todo VERIFY the comment on line 21 is incomplete.

91-115: Parameter updates align with the stored channels.
Using param_ to set description fields and the reference channel index is coherent. Validating the lookup with std::find is correct, but ensure parent class parameters are kept in sync if further logic modifies references.


116-121: Copy constructor copies critical fields.
Channels and reference channel are transferred correctly. Verify if any future parameters or additional members also need copying.


123-124: Assignment operator defaults are fine.
Relying on = default; is acceptable for straightforward field copying, consistent with the copy constructor's logic.


126-150: Getter methods are cleanly implemented.

  • getMethodName() returning name_ is concise.
  • The getIsotopeCorrectionMatrix() usage of stringListToIsotopeCorrectionMatrix_() is logical; ensure that unexpected “NA” strings translate into appropriate numeric handling.
  • No performance, concurrency, or security concerns.

@jpfeuffer

Copy link
Copy Markdown
Contributor

I think you need to add the regular TMT16plex channels as well, otherwise you just would have 16 channels.

@jpfeuffer

Copy link
Copy Markdown
Contributor

And I think this new class needs to be registered somewhere, potentially in IsobaricQuantifier.

@FreezB11

FreezB11 commented Apr 4, 2025 •

Copy link
Copy Markdown
Author

And I think this new class needs to be registered somewhere, potentially in IsobaricQuantifier.

i did try to search where to register it but i dont seem to find it like where i should be doing that

@FreezB11

FreezB11 commented Apr 4, 2025

Copy link
Copy Markdown
Author

I think you need to add the regular TMT16plex channels as well, otherwise you just would have 16 channels.

well i am not very sure about that sir
if i have to add that to then i will do it too

@FreezB11

FreezB11 commented Apr 4, 2025

Copy link
Copy Markdown
Author

@jpfeuffer sir shall i close this pr ?? and maybe i can take the conformation for the addition of the 16channels form the TMT16plex

@jpfeuffer

Copy link
Copy Markdown
Contributor

No, just continue pushing to this branch.

@jpfeuffer

Copy link
Copy Markdown
Contributor

It will automatically update the PR

@FreezB11

FreezB11 commented Apr 4, 2025

Copy link
Copy Markdown
Author

No, just continue pushing to this branch.

ok sir so for the channels part should it be somthing like this
{"126","127N","127C","128N","128C","129N","129C","130N","130C","131N","131C","132N","132C","133N","133C","134N"};
+
{"127D", "128ND", "128CD", "129ND", "129CD", "130ND", "130CD", "131ND", "131CD", "132ND", "132CD", "133ND", "133CD", "134ND", "134CD", "135ND"}
like the 127D goes after the 127C and so on

@jpfeuffer

Copy link
Copy Markdown
Contributor

No, it needs to be combined but sorted by mass I think.

@FreezB11

FreezB11 commented Apr 4, 2025

Copy link
Copy Markdown
Author

For the time being can I just add it later on we can sort or we can make a sort function for it

@jpfeuffer

Copy link
Copy Markdown
Contributor

No, I think really should be sorted in the file because then it is easier to fill out matrices etc manually.

@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 (2)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

118-152: Complete the TODO regarding isotope correction values.

The comment at line 118 indicates these correction matrix values need to be verified. Unverified or incorrect matrix entries cause inaccurate quantitation results.

Would you like help creating a script to verify these values against a known source or to generate a placeholder test that alerts users to update them?


206-207: Check alignment between the copy constructor and the default assignment operator.

The copy constructor explicitly reinitializes the channels and reference_channel_, while operator= is set to = default;. Usually, the default assignment operator is sufficient, but confirm that no additional steps (e.g., reinitializing parameters) are intended in assignment scenarios.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 745a2a4 and cc58e52.

📒 Files selected for processing (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (11)
  • TMTThirtyTwoPlexQuantitationMethod (16-55)
  • TMTThirtyTwoPlexQuantitationMethod (22-22)
  • TMTThirtyTwoPlexQuantitationMethod (24-24)
  • setDefaultParams_ (52-52)
  • updateMembers_ (54-54)
  • rhs (27-27)
  • getMethodName (31-31)
  • getChannelInformation (32-32)
  • getNumberOfChannels (33-33)
  • getIsotopeCorrectionMatrix (34-34)
  • getReferenceChannel (35-35)
🔇 Additional comments (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)

74-75: Confirm the default reference channel value.

At line 74-75, the code sets reference_channel_ = 0 (i.e., channel "126"), but at line 115 the parameters default to "127D". This inconsistency can lead to confusion since the parameter system’s default conflicts with the constructor’s hard-coded value.

Please verify which channel should be the true default reference channel and ensure both constructor initialization and default parameters match.

Also applies to: 115-115

@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/TMTThirtyTwoPlexQuantitationMethod.cpp (4)

21-30: Resolve apparent documentation mismatch for 32 channels.

These lines define 32 channel names, but the class documentation (in the parameter description) references 16 entries. Please update the doc comment to reflect that this method handles all 32 channels.


32-32: Remove or clarify unused commented-out definition.

The commented-out line “// const std::vectorstd::string …” appears to be a leftover from an older commit. Consider removing it to keep the file clean and avoid confusion.


118-153: Revise the correction matrix documentation.

The parameter description refers to providing “16 entries” of values, but 32 lines follow in the matrix, matching the 32 channels. Update the description to reflect the TMT 32-plex format.


158-197: Consider unit tests for parameter handling.

Although channels are updated from param_ correctly, there is no direct unit test to validate TMT 32-plex parameters and isotope correction matrix usage. A dedicated test would ensure these defaults and updates work as expected.

Do you want me to create sample unit tests for verifying channel descriptions and reference channel selection?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc58e52 and 5bcc734.

📒 Files selected for processing (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (11)
  • TMTThirtyTwoPlexQuantitationMethod (16-55)
  • TMTThirtyTwoPlexQuantitationMethod (22-22)
  • TMTThirtyTwoPlexQuantitationMethod (24-24)
  • setDefaultParams_ (52-52)
  • updateMembers_ (54-54)
  • rhs (27-27)
  • getMethodName (31-31)
  • getChannelInformation (32-32)
  • getNumberOfChannels (33-33)
  • getIsotopeCorrectionMatrix (34-34)
  • getReferenceChannel (35-35)
🔇 Additional comments (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)

121-121: Check double slash token in correction matrix.

The string "NA/9.41//NA" appears to have an extra slash, potentially yielding an empty token that may break parsing. Confirm whether this is intentional or if it should be "NA/9.41/NA".

@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: 3

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

70-73: Consider future-proofing for 34-plex or 35-plex expansions.

The commented-out “135CD” channel suggests a possible extension toward TMT 34-plex or 35-plex in the future. To avoid repeated code modifications, consider designing a flexible mechanism or a parameter-based approach that can handle additional channels more gracefully if new plexes are introduced.


153-154: Update the documentation to match the 32-plex correction matrix size.

The comment incorrectly references “16 entries”, but there are 32 channels defined. Adjusting the documentation will clarify the expected number of correction-matrix rows.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bcc734 and 33ce23e.

📒 Files selected for processing (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (11)
  • TMTThirtyTwoPlexQuantitationMethod (16-55)
  • TMTThirtyTwoPlexQuantitationMethod (22-22)
  • TMTThirtyTwoPlexQuantitationMethod (24-24)
  • setDefaultParams_ (52-52)
  • updateMembers_ (54-54)
  • rhs (27-27)
  • getMethodName (31-31)
  • getChannelInformation (32-32)
  • getNumberOfChannels (33-33)
  • getIsotopeCorrectionMatrix (34-34)
  • getReferenceChannel (35-35)

Comment on lines +192 to +197
std::vector<std::string>::const_iterator t_it = std::find(TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin(),
TMTThirtyTwoPlexQuantitationMethod::channel_names_.end(),
param_.getValue("reference_channel"));

reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
}

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

Validate the reference channel to prevent out-of-bounds access.

If the parameter’s value for "reference_channel" is not found in channel_names_, t_it will be end(), which becomes an invalid index. Consider explicitly verifying t_it != end() before subtracting.

Example fix:

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,
+     "Unknown reference channel: " + param_.getValue("reference_channel"));
+ }

reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
std::vector<std::string>::const_iterator t_it = std::find(TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin(),
TMTThirtyTwoPlexQuantitationMethod::channel_names_.end(),
param_.getValue("reference_channel"));
reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
}
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,
"Unknown reference channel: " + param_.getValue("reference_channel"));
}
reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
}

@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: 0

♻️ Duplicate comments (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)

192-197: 🛠️ Refactor suggestion

Validate the reference channel to prevent out-of-bounds.
If “reference_channel” is not found in channel_names_, subtracting begin() from end() will yield an invalid index. Add a check before setting reference_channel_.

Apply this diff to safeguard the assignment:

 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,
+     "Unknown reference channel: " + param_.getValue("reference_channel"));
+ }

 reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
🧹 Nitpick comments (2)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

72-72: Consider enabling or removing the commented-out 135CD channel.
Keeping the 135ND channel without 135CD may cause confusion, especially if future TMT expansions rely on consistent channel sets. If 135CD is not intended for the 32-plex, remove the commented code to avoid confusion; otherwise, properly enable and document it.


80-115: Add unit tests to verify parameter defaults and channel descriptions.
The code sets a large number of channel parameters and a correction matrix. Ensuring coverage with unit tests helps prevent regressions and confirms that each channel’s configuration is applied correctly.

Would you like help writing a basic test case that checks each channel’s default description and the reference channel?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33ce23e and fe90696.

📒 Files selected for processing (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🔇 Additional comments (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)

124-124: ⚠️ Potential issue

Remove the extra slash to ensure correct parsing of the correction matrix.
There appears to be a trailing slash or spacing near "/NA/NA/" that could produce an unintended empty token, leading to 15 or more segments instead of the expected 14.

Apply this diff to remove the extra slash/spaces:

- "NA/NA/NA/NA            /0.82/NA/NA/       /0.30/8.71/0.33    /0.00/0.00/0.26/0.00",
+ "NA/NA/NA/NA            /0.82/NA/NA        /0.30/8.71/0.33    /0.00/0.00/0.26/0.00",

Likely an incorrect or invalid review comment.

@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: 1

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

14-20: Clarify or remove references to 34plex and 35plex.

The constructor comments cover TMT 32plex, 34plex, and 35plex reagent sets, which might confuse users who only need 32plex details. Consider either adding dedicated documentation for 34/35plex or removing these extra references if they are out of scope for this class.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe90696 and 4c6be61.

📒 Files selected for processing (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🔇 Additional comments (2)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

72-72: Confirm whether 135CD should be included.

Line 72 comments out the potential 135CD channel. Please verify whether 135CD is officially part of TMT 32plex. If so, add it to the channel map; otherwise, remove the comment.

Would you like a shell script to grep for references to 135CD elsewhere in the codebase to confirm usage?


192-197: Validate the reference channel to prevent out-of-bounds access.

A past review comment suggested throwing an exception if param_.getValue("reference_channel") is not found in channel_names_. If t_it equals end(), computing reference_channel_ = t_it - begin() yields an invalid index. Consider adding this 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,
+     "Unknown reference channel: " + param_.getValue("reference_channel"));
+ }

 reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();

@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: 0

♻️ Duplicate comments (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)

192-197: ⚠️ Potential issue

Validate the reference channel to avoid out-of-bounds access.
This reproduces an unresolved issue flagged in previous reviews. If std::find does not locate the reference channel, t_it will be channel_names_.end(), leading to an invalid index.

Apply this fix:

 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,
+     "Unknown reference channel: " + param_.getValue("reference_channel"));
+ }

 reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();
🧹 Nitpick comments (2)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

72-72: Clarify or remove the commented-out 135CD channel.
Leaving this channel commented may cause confusion for future maintainers. If 135CD should be excluded from TMT 32plex, consider removing the code; otherwise, uncomment and test its usage.


118-118: Verify the correctness of the provided isotope correction matrix.
The TODO indicates these values need validation. Please confirm or update them to ensure accurate quantitation.

Would you like me to help generate or integrate a script to compare these matrix entries against reference data?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c6be61 and abf6407.

📒 Files selected for processing (1)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (11)
  • TMTThirtyTwoPlexQuantitationMethod (16-55)
  • TMTThirtyTwoPlexQuantitationMethod (22-22)
  • TMTThirtyTwoPlexQuantitationMethod (24-24)
  • setDefaultParams_ (52-52)
  • updateMembers_ (54-54)
  • rhs (27-27)
  • getMethodName (31-31)
  • getChannelInformation (32-32)
  • getNumberOfChannels (33-33)
  • getIsotopeCorrectionMatrix (34-34)
  • getReferenceChannel (35-35)

@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: 1

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

17-19: Clarify or remove references to 34-plex and 35-plex in TMT 32-plex documentation.

These lines mention TMT 34-plex and 35-plex, which may confuse users since the class name and implementation focus on "tmt32plex." Consider clarifying whether this class can handle those additional plexes or remove the references to avoid confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between abf6407 and 4ed6dd9.

📒 Files selected for processing (2)
  • src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1 hunks)
  • src/topp/IsobaricAnalyzer.cpp (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (1)
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.h (11)
  • TMTThirtyTwoPlexQuantitationMethod (16-55)
  • TMTThirtyTwoPlexQuantitationMethod (22-22)
  • TMTThirtyTwoPlexQuantitationMethod (24-24)
  • setDefaultParams_ (52-52)
  • updateMembers_ (54-54)
  • rhs (27-27)
  • getMethodName (31-31)
  • getChannelInformation (32-32)
  • getNumberOfChannels (33-33)
  • getIsotopeCorrectionMatrix (34-34)
  • getReferenceChannel (35-35)
🔇 Additional comments (2)
src/openms/source/ANALYSIS/QUANTITATION/TMTThirtyTwoPlexQuantitationMethod.cpp (2)

75-75: Confirm whether channel 135CD should be part of the 32-plex.

This commented-out channel suggests uncertainty in whether 135CD belongs in the 32-plex set. If you need a 33rd channel, rename the class or clarify that it can optionally support 135CD. Otherwise, remove or document the reason for omitting it.


195-200: Validate the reference channel to avoid out-of-bounds errors.

If the parameter "reference_channel" is not found in channel_names_, t_it becomes end(). Subtracting begin() from end() yields an index of 32 (for 32 channels), causing out-of-bounds access in channels_. This was flagged in a previous review.

 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,
+     "Unknown reference channel: " + param_.getValue("reference_channel"));
+ }
 
 reference_channel_ = t_it - TMTThirtyTwoPlexQuantitationMethod::channel_names_.begin();

Comment thread src/topp/IsobaricAnalyzer.cpp Resolved

@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: 0

🧹 Nitpick comments (1)
src/openms/source/ANALYSIS/QUANTITATION/sources.cmake (1)

26-27: New TMT source files registered correctly.

The addition of TMTThirtyTwoPlexQuantitationMethod.cpp and TMTThirtyFivePlexQuantitationMethod.cpp follows the existing naming convention and is properly placed in the sources list for CMake compilation.

Optionally, consider sorting all TMT methods by plex number (6→10→11→16→18→32→35) for easier navigation:

 TMTEighteenPlexQuantitationMethod.cpp
 TMTSixteenPlexQuantitationMethod.cpp
 TMTElevenPlexQuantitationMethod.cpp
 TMTSixPlexQuantitationMethod.cpp
 TMTTenPlexQuantitationMethod.cpp
-TMTThirtyTwoPlexQuantitationMethod.cpp
-TMTThirtyFivePlexQuantitationMethod.cpp
+TMTSixPlexQuantitationMethod.cpp
+TMTTenPlexQuantitationMethod.cpp
+TMTElevenPlexQuantitationMethod.cpp
+TMTSixteenPlexQuantitationMethod.cpp
+TMTEighteenPlexQuantitationMethod.cpp
+TMTThirtyTwoPlexQuantitationMethod.cpp
+TMTThirtyFivePlexQuantitationMethod.cpp
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88fb4c8 and ded9261.

📒 Files selected for processing (2)
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/sources.cmake (1 hunks)
  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/openms/include/OpenMS/ANALYSIS/QUANTITATION/sources.cmake
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.

Applied to files:

  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality

Applied to files:

  • src/openms/source/ANALYSIS/QUANTITATION/sources.cmake

@cbielow

cbielow commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

please don't merge in the development branch unless you plan to continue working on this PR.
It triggers noise for the core maintainers -- even though it does not affect CI builds, since these need manual triggering here.
Thanks

Copy link
Copy Markdown
Contributor

Superseded by #9446 — closing.

The TMT 32-/35-plex classes from this PR were merged into develop in #9003 (cleaned up, but with the isotope correction matrix temporarily forced to the identity matrix because the values had not been verified). #9446 brings in the actual Thermo correction matrix values from this PR — extracted verbatim and validated (the non-deuterated channels match OpenMS' existing TMT 16-/18-plex datasheet exactly, and the deuterated channels come from the Thermo A40000817 CoA).

Thanks @FreezB11 for the original work — your matrix values and authorship are carried over and credited in #9446.


Generated by Claude Code

@FreezB11

FreezB11 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Superseded by #9446 — closing.

The TMT 32-/35-plex classes from this PR were merged into develop in #9003 (cleaned up, but with the isotope correction matrix temporarily forced to the identity matrix because the values had not been verified). #9446 brings in the actual Thermo correction matrix values from this PR — extracted verbatim and validated (the non-deuterated channels match OpenMS' existing TMT 16-/18-plex datasheet exactly, and the deuterated channels come from the Thermo A40000817 CoA).

Thanks @FreezB11 for the original work — your matrix values and authorship are carried over and credited in #9446.


Generated by Claude Code

Do I get to be in the authors list

@timosachsenberg

Copy link
Copy Markdown
Contributor

Sure please add yourself

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.

Add support for TMT-32 and 35-plex?

5 participants