Skip to content

Add comprehensive documentation for Targeted Quantitation algorithms - #8588

Merged
timosachsenberg merged 12 commits into
developfrom
feature/targeted-quantitation-documentation
Jan 5, 2026
Merged

timosachsenberg merged 12 commits into
developfrom
feature/targeted-quantitation-documentation

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds Doxygen documentation for the MRM/SRM and SWATH/DIA quantitation workflow algorithms developed by Douglas McCloskey, Pasquale Domenico Colaianni, and Svetlana Kutuzova. These algorithms form the computational foundation used by tools like SmartPeaks.

Changes:

  • Add new TargetedQuantitation module group in Modules.doxygen with workflow diagram and class organization
  • Add @ingroup tags and enhanced documentation to all related headers:
    • MRMFeatureFilter, MRMFeatureQC, MRMFeatureSelector
    • MRMBatchFeatureSelector, PeakIntegrator, EmgGradientDescent
    • AbsoluteQuantitation, AbsoluteQuantitationMethod
    • TargetedSpectraExtractor
  • Create new tutorial page (TargetedQuantitation.doxygen) with:
    • Complete workflow diagram (using Graphviz @dot)
    • Code examples for each workflow stage
    • Parameter documentation tables
  • Link tutorial from main documentation page

Files Changed (12 files, +732/-53 lines):

  • doc/doxygen/public/Main.doxygen - Added link to new tutorial
  • doc/doxygen/public/Modules.doxygen - Added TargetedQuantitation module group
  • doc/doxygen/public/TargetedQuantitation.doxygen - New comprehensive tutorial (370 lines)
  • 9 header files with enhanced documentation and @ingroup tags

Test plan

  • Build documentation with make doc and verify:
    • New "Targeted Quantitation (MRM/SRM)" module appears in Modules list
    • All classes show up under the module
    • Tutorial page renders correctly with workflow diagrams
    • Code examples are properly formatted
    • Cross-references (@see, @ref) work correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added an "Algorithm Tutorials" section and comprehensive TargetedQuantitation docs covering workflows, tools, parameters, examples and cross‑references; updated coding/formatting guidance.
  • New Features
    • Expanded Python bindings and public APIs for targeted quantitation and spectra extraction; added RT‑difference and peak‑resolution computations to QC/filtering.
  • Tests
    • Added extensive unit tests and an example workflow exercising targeted quantitation (MRM/SRM and SWATH/DIA).
  • Style
    • Standardized GUI action creation to assign shortcuts after creation.

✏️ Tip: You can customize this high-level summary in your review settings.

This commit adds Doxygen documentation for the MRM/SRM and SWATH/DIA
quantitation workflow algorithms developed by McCloskey, Colaianni, and
Kutuzova (SmartPeaks foundation).

Changes:
- Add new 'TargetedQuantitation' module group in Modules.doxygen with
  workflow diagram and class organization
- Add @InGroup tags and enhanced documentation to all related headers:
  - MRMFeatureFilter, MRMFeatureQC, MRMFeatureSelector
  - MRMBatchFeatureSelector, PeakIntegrator, EmgGradientDescent
  - AbsoluteQuantitation, AbsoluteQuantitationMethod
  - TargetedSpectraExtractor
- Create new tutorial page (TargetedQuantitation.doxygen) with:
  - Complete workflow diagram
  - Code examples for each stage
  - Parameter documentation
- Link tutorial from main documentation page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds comprehensive TargetedQuantitation documentation and extensive pyOpenMS binding surface changes, expands many OpenMS header docblocks, exposes new/updated Python APIs, implements two MRMFeatureFilter helper methods (RT difference and resolution) with C++ unit tests, and adds a pyOpenMS unit test suite.

Changes

Cohort / File(s) Summary
Doxygen docs
doc/doxygen/public/Main.doxygen, doc/doxygen/public/Modules.doxygen, doc/doxygen/public/TargetedQuantitation.doxygen
New Algorithm Tutorials entry and a full TargetedQuantitation module: workflow, examples, configs, tools, and references. Documentation-only.
OPENSWATH header docs
src/openms/include/OpenMS/ANALYSIS/OPENSWATH/...
src/openms/include/OpenMS/ANALYSIS/OPENSWATH/MRMBatchFeatureSelector.h, .../MRMFeatureFilter.h, .../MRMFeatureQC.h, .../MRMFeatureSelector.h, .../PeakIntegrator.h, .../TargetedSpectraExtractor.h
Expanded and reorganized Doxygen blocks (workflows, QC criteria, integration/EMG notes, extractor params, examples, @ingroup tags). Docs-only; no API signature changes.
Quantitation header docs
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/...
src/openms/include/OpenMS/ANALYSIS/QUANTITATION/AbsoluteQuantitation.h, .../AbsoluteQuantitationMethod.h
Reworked documentation: terms, workflows, calibration/LLOQ/ULOQ/LLOD/ULOD, examples and parameter tables. Docs-only.
Math header docs
src/openms/include/OpenMS/MATH/MISC/EmgGradientDescent.h
Expanded EMG model and iRprop+-based fitting documentation with use-cases and references. Docs-only.
MRMFeatureFilter implementation
src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
Added methods: calculateRTDifference(Feature&, Feature&) const and calculateResolution(Feature&, Feature&) const; implements meta-value width_at_50 handling, fallback to feature width, and zero-width guards.
C++ unit tests
src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
New tests validating RT difference and resolution computations, including zero-width edge case.
pyOpenMS Cython bindings
src/pyOpenMS/pxds/AbsoluteQuantitation.pxd, src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd, src/pyOpenMS/pxds/MRMFeatureFilter.pxd, src/pyOpenMS/pxds/MRMFeatureSelector.pxd, src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
Large additions and signature updates in .pxd/.pxds files: many new/changed methods, new wrapped types (SelectorParameters, MRMFeatureSelector variants, TSE types), except + nogil annotations, and extensive wrap-docs. These change the Python-exposed API surface and require careful binding/ownership review.
pyOpenMS tests
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
New comprehensive Python unit tests for MRM QC/filtering, selectors, AbsoluteQuantitation, PeakIntegrator, EmgGradientDescent, TargetedSpectraExtractor, and an example workflow. Test-only.
Repository guidance
AGENTS.md
Updated formatting/indentation guidance: 2 spaces for C++/headers, 4 spaces for Python/Cython (PEP8); examples updated. Docs-only.
GUI action shortcuts refactor
src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp, .../TOPPASBase.cpp, .../TOPPViewMenu.cpp
Reworked QAction creation to set shortcuts via setShortcut() after creation; internal UI refactor, no public API changes.

Sequence Diagram(s)

(omitted — changes are primarily documentation, binding surface updates, and small helper methods; no new multi-component control flow requiring visualization)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, Review effort [1-5]: 3

Suggested reviewers

  • jcharkow
  • cbielow
  • jpfeuffer

Poem

🐇 I hopped through headers, docs, and binds,
I nudged two methods, and left tests behind.
Python wrappers sprout where workflows meet,
Docs now flourish, clear and neat.
Hop on—targeted quant’s ready to greet!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 summarizes the main change: adding comprehensive Doxygen documentation for the Targeted Quantitation workflow algorithms, which is the core objective of this PR.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7edf58 and cfac3dd.

📒 Files selected for processing (4)
  • doc/doxygen/public/Main.doxygen
  • src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp
  • src/openms_gui/source/VISUAL/TOPPViewMenu.cpp
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{h,hpp,cpp}: Never use std::cout or std::cerr directly; use OpenMS logging macros instead
Never use std::endl; use \n for performance
Use PascalCase for class names, type names, and namespace names
Use lowerCamelCase for method and function names
Use snake_case for variable names
Use trailing underscore for private and protected member variables
Use UPPER_SNAKE_CASE for enum values and preprocessor macros
Use Size and SignedSize types from OpenMS for STL .size() values instead of platform-dependent types
Prefer references over pointers in C++ code
Always use braces for control flow blocks, even single-line statements (trivial one-liners may be kept single-line)
Place opening and closing braces on their own lines, aligned vertically
Add a space after control flow keywords (if, for, while, switch)
Add spacing around binary operators
Use OpenMS::String for numeric formatting and parsing instead of standard library alternatives
Use OpenMS primitive types from OpenMS/CONCEPT/Types.h
Follow Rule-of-0 or Rule-of-6 for class design (ensure proper move/copy semantics or default them)
Derive exception classes from Exception::Base; throw with file, line, and OPENMS_PRETTY_FUNCTION information
Catch exceptions by const reference
Use ./.clang-format configuration file from repository root for code formatting
Provide comments covering at least ~5% of code; use // style and describe the next few lines in plain English
Use C++20 language standard; avoid features not supported across all target platforms (Linux, macOS, Windows)

Files:

  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp
  • src/openms_gui/source/VISUAL/TOPPViewMenu.cpp
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp
  • src/openms_gui/source/VISUAL/TOPPViewMenu.cpp
**/{include,source}/**/*.{h,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

Pair each C++ header file (.h) with a corresponding implementation file (.cpp) for non-template code

Files:

  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp
  • src/openms_gui/source/VISUAL/TOPPViewMenu.cpp
🧠 Learnings (4)
📓 Common learnings
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
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
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/tests/**/*.py : Write pyOpenMS tests for new Python bindings
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/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to doc/doxygen/public/TOPP.doxygen : Document TOPP tools in docs and add to `doc/doxygen/public/TOPP.doxygen` where applicable

Applied to files:

  • doc/doxygen/public/Main.doxygen
  • src/openms_gui/source/VISUAL/TOPPViewMenu.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms_gui/source/*_test.cpp : Use `SET_UP` and `TEAR_DOWN` methods in GUI tests for Qt setup/cleanup

Applied to files:

  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/topp/*.cpp : TOPP tool source files must be registered in `src/topp/executables.cmake` and `ToolHandler.cpp`

Applied to files:

  • src/openms_gui/source/VISUAL/TOPPViewMenu.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-win
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: cppcheck-test
🔇 Additional comments (8)
doc/doxygen/public/Main.doxygen (1)

70-70: LGTM! Documentation link added correctly.

The new TargetedQuantitation tutorial link is properly formatted and appropriately placed in the Documentation section. The use of @ref (instead of @subpage) keeps the navigation hierarchy clean, as noted in the commit message.

src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp (2)

169-170: Approve Help menu action shortcut assignment.

The TOPPAS tutorial action now uses the same two-step pattern (action creation followed by setShortcut()), maintaining consistency with other menu changes in this file.


132-141: Approve consistent shortcut assignment pattern across File menu for Qt 6.2 compatibility.

The migration to post-creation setShortcut() calls is applied consistently across multiple File menu actions. Qt 6.2 deprecates the QMenu::addAction() overloads that accept a QKeySequence parameter; the recommended approach is to call addAction() and then set the shortcut separately via setShortcut(), which this code correctly implements.

Lines 149-152 still use SLOT() macros while other actions use type-safe function pointers. This mixed approach is acceptable for incremental migration, but consider updating these in future changes for consistency.

src/openms_gui/source/VISUAL/TOPPViewMenu.cpp (4)

51-57: Approve action creation and shortcut assignment pattern.

The refactor consistently applies the two-step pattern: create action, then call setShortcut(). The comment on lines 51-52 provides valuable context about a Qt bug that necessitates the lambda approach for actions with default parameters.


87-123: Approve consistent pattern across Tools menu actions.

The migration to separate setShortcut() calls is applied uniformly across all Tools menu actions, including those requiring capability checks via addAction_(). This maintains the existing functionality while updating to the Qt 6.2-compatible pattern.


134-146: Approve Layer menu shortcut assignments.

The shortcut assignment pattern is consistently applied to Layer menu actions (Save, Show/hide options), maintaining functional equivalence with the previous implementation.


176-176: Approve Help menu tutorial action shortcut.

The tutorial action now uses setShortcut() after creation, completing the consistent application of the new pattern across all menus in this file.

src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp (1)

47-49: Clarify shortcut assignment pattern rationale.

The two-step pattern using setShortcut() after action creation is good for forward compatibility with future Qt versions, but Qt 6.2 still supports the legacy addAction() overloads that accept shortcuts directly. This pattern is not required for Qt 6.2 compatibility—it became recommended only in later Qt 6 versions when those convenience overloads were deprecated. The code change is fine and aligns with modern Qt practices.

Note: Line 50 still uses the SLOT() macro for "Save &As" and does not assign a shortcut. Consider updating remaining SLOT usages in future changes for consistency with lines 47 and 49.

Likely an incorrect or invalid review comment.


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.

This commit adds comprehensive Python bindings for the MRM/SRM and
SWATH/DIA quantitation algorithms.

New wrapper files:
- MRMFeatureSelector.pxd: LP-based feature selection with enums
  (VariableType, LambdaScore), SelectorParameters struct, and
  derived classes (MRMFeatureSelectorQMIP, MRMFeatureSelectorScore)
- MRMBatchFeatureSelector.pxd: Batch processing with static methods

Extended wrappers with additional methods:
- MRMFeatureFilter.pxd: Added FilterFeatureMapPercRSD,
  FilterFeatureMapBackgroundInterference, EstimateDefaultMRMFeatureQCValues,
  EstimatePercRSD, EstimateBackgroundInterferences, calculateIonRatio,
  calculateRTDifference, calculateResolution
- AbsoluteQuantitation.pxd: Added optimizeCalibrationCurves,
  optimizeSingleCalibrationCurve, fitCalibration, calculateBiasAndR,
  optimizeCalibrationCurveIterative, applyCalibration
- TargetedSpectraExtractor.pxd: Added Comparator base class,
  BinnedSpectrumComparator, matchSpectrum, targetedMatching,
  untargetedMatching

New test file:
- test_TargetedQuantitation.py: Comprehensive test suite and usage
  examples demonstrating the complete quantitation workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[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.

Actionable comments posted: 2

🧹 Nitpick comments (4)
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (3)

18-18: Remove unused import.

The os module is imported but never used in this file.

🔎 Proposed fix
 import unittest
-import os
 
 import pyopenms as oms

194-194: Move import math to module level.

The math module is imported inside three test methods. Moving it to the top of the file follows Python conventions and avoids repeated import overhead.

🔎 Proposed fix at file top
 import unittest
-import os
+import math
 
 import pyopenms as oms

Then remove the local imports at lines 194, 219, and 306.

Also applies to: 219-219, 306-306


406-412: Test execution order may cause issues.

When running as __main__, example_targeted_quantitation_workflow() executes first and prints output, then unittest.main() runs. This works but may cause confusion in CI output. Consider separating the example from the test run or using a command-line flag.

🔎 Alternative approach
 if __name__ == "__main__":
-    # Run the example
-    example_targeted_quantitation_workflow()
-
-    # Run unit tests
-    print("\n\n=== Running Unit Tests ===\n")
-    unittest.main(verbosity=2)
+    import sys
+    if "--example" in sys.argv:
+        sys.argv.remove("--example")
+        example_targeted_quantitation_workflow()
+    else:
+        unittest.main(verbosity=2)
src/pyOpenMS/pxds/MRMFeatureSelector.pxd (1)

7-7: Unused import: libcpp_pair.

The pair type is imported but not used in this file. Consider removing it to keep imports minimal.

🔎 Proposed fix
 from libcpp.map cimport map as libcpp_map
 from libcpp.vector cimport vector as libcpp_vector
-from libcpp.pair cimport pair as libcpp_pair
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23b3d7b and 5eb502e.

📒 Files selected for processing (6)
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧠 Learnings (16)
📓 Common learnings
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
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
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: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
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/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
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
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
📚 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/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
📚 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/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 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/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 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/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build-win
  • GitHub Check: build-macos-arm
  • GitHub Check: build-lnx
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: cppcheck-test
🔇 Additional comments (13)
src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (2)

1-59: Well-structured bindings with proper constructors and comprehensive documentation.

The class declaration correctly includes both default and copy constructors as required by pyOpenMS conventions. The wrap-doc example provides clear usage guidance for users.


61-192: LGTM: Method bindings are complete with thorough documentation.

All public methods include wrap-doc with parameter descriptions and return values. The API surface covers the full calibration and quantitation workflow.

src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (1)

23-326: Comprehensive test coverage for new bindings.

The test suite covers all major classes (MRMFeatureQC, MRMFeatureFilter, AbsoluteQuantitation, PeakIntegrator, EmgGradientDescent, MRMFeatureSelector, TargetedSpectraExtractor) with meaningful assertions on object creation, parameter access, and core computations. This aligns well with the coding guidelines requiring tests for new Python bindings.

src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd (2)

44-90: Static method bindings are correctly structured.

The separate namespace block with wrap-attach:MRMBatchFeatureSelector properly exposes static methods. Documentation clearly describes the iterative batch processing workflow.


8-42: No changes needed. The current binding correctly omits constructor declarations for this static-only utility class. MRMBatchFeatureSelector follows the established pyOpenMS pattern seen in comparable classes like File and SpectrumHelper, which also lack constructor declarations when all methods are static and the C++ class is not instantiable. The copy constructor rule applies to instantiable classes; static-only utility classes should not declare constructors.

src/pyOpenMS/pxds/MRMFeatureSelector.pxd (2)

26-52: SelectorParameters struct is well-defined with proper constructors.

The struct exposes all configuration fields with clear wrap-doc descriptions. Both default and copy constructors are declared as required by pyOpenMS guidelines.


95-129: Derived selector classes follow correct inheritance pattern.

Per the learnings, derived classes only need to declare constructors since methods are inherited from the base MRMFeatureSelector class. The wrap-inherits and wrap-doc comments provide useful context for users.

src/pyOpenMS/pxds/MRMFeatureFilter.pxd (2)

15-49: Comprehensive class documentation with practical example.

The wrap-doc includes a complete code example demonstrating the QC filtering workflow. This significantly improves usability for Python users.


61-134: New filtering and estimation methods properly exposed.

The batch filtering methods (FilterFeatureMapPercRSD, EstimateDefaultMRMFeatureQCValues, etc.) are well-documented and follow consistent parameter patterns using reference types for in/out parameters.

src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd (4)

53-54: Constructors correctly declared.

Both default and copy constructors are present as required by pyOpenMS conventions for proper autowrap support.


60-218: Method overloads provide flexible API surface.

Multiple overloads for annotateSpectra, scoreSpectra, selectSpectra, and extractSpectra allow users to choose between feature-enabled and simplified workflows. Each overload is clearly documented.


304-338: Abstract base class TSE_Comparator correctly omits constructors.

As an abstract class, TSE_Comparator should not have constructors declared. The methods are exposed for documentation and to establish the interface contract for derived classes.


340-361: TSE_BinnedSpectrumComparator properly inherits and declares constructors.

The derived class correctly uses wrap-inherits: TSE_Comparator, declares both constructors, and re-exposes the concrete implementations of generateScores and init. This follows the pyOpenMS pattern for derived classes with concrete implementations.

Comment thread src/pyOpenMS/pxds/MRMFeatureFilter.pxd Resolved
- Implement calculateRTDifference() and calculateResolution() in
  MRMFeatureFilter.cpp (methods were declared but never implemented)
- Add proper C++ tests for both methods (previous test was empty //TODO)
- Update pyOpenMS wrappers with improved documentation and examples
- Fix pyOpenMS wrapper issues (abstract class handling, enum class
  limitations, type conversion issues)
- Add comprehensive Python test suite for targeted quantitation classes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[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.

Actionable comments posted: 1

♻️ Duplicate comments (3)
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (1)

18-19: Remove unused os import

os isn’t used anywhere in this test module; it can be dropped to keep the tests clean and avoid linter warnings.

src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (2)

92-97: Fix parameter passing to use const Param & for consistency and performance.

The transformation_model_params parameter is passed by value (Param transformation_model_params) instead of by const reference. This creates an unnecessary copy of the Param object and is inconsistent with other methods in this file (lines 129, 163) and the C++ API pattern.

🔎 Proposed fix
 Param fitCalibration(
     libcpp_vector[AQS_featureConcentration] & component_concentrations,
     const String & feature_name,
     const String & transformation_model,
-    Param transformation_model_params
+    const Param & transformation_model_params
 ) except + nogil

Based on past review discussion, this matters in Cython for both performance (avoids copying) and API fidelity (matches C++ signature).


107-114: Add const qualifier to input parameter.

The transformation_model_params is documented as "Model parameters (updated in place)" but examining the C++ API pattern and comparing with optimizeCalibrationCurveIterative (line 129), this should be a const reference since it's an input parameter. The actual output parameters are biases and correlation_coefficient.

🔎 Proposed fix
 void calculateBiasAndR(
     libcpp_vector[AQS_featureConcentration] & component_concentrations,
     const String & feature_name,
     const String & transformation_model,
-    Param & transformation_model_params,
+    const Param & transformation_model_params,
     libcpp_vector[double] & biases,
     double & correlation_coefficient
 ) except + nogil

Also update the documentation to clarify that this parameter is an input, not modified in place:

-#   :param transformation_model_params: Model parameters (updated in place)
+#   :param transformation_model_params: Model parameters

Based on past review discussion, using const Param & ensures consistency with the C++ API and other methods in this file.

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

3154-3179: Resolution test is correct; consider slightly tighter expectation

The test correctly mirrors the implemented formula and covers the zero-width edge case. If you want to reduce dependence on the test macro tolerance, you could either:

  • use a more precise expected value (e.g. 1.7647059), or
  • additionally assert symmetry (calculateResolution(f2, f1)).

Not mandatory; the current test is already meaningful.

src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp (1)

954-997: RT-difference and resolution implementations look correct; constness is the only polish

The implementations match the intended formulas and handle missing/zero widths safely (returning 0 when width_sum <= 0). To align with calculateIonRatio and make the API more clearly read-only, consider changing the parameters to const Feature& in both the header and this definition (and updating the pyOpenMS .pxd accordingly). Not urgent, but would tighten const-correctness.

src/pyOpenMS/pxds/MRMFeatureFilter.pxd (1)

15-162: Bindings for new MRMFeatureFilter APIs look correct; minor doc-name tweak optional

The added methods (FilterFeatureMap* variants, Estimate* helpers, and the RT/ratio/resolution utilities) are exposed with appropriate reference types and wrapped docs, and they line up with how the pyOpenMS tests use them.

One small polish you might consider: in the wrap-doc example you use MRMFeatureQC.ComponentQCs(), while the tests use MRMFQC_ComponentQCs(). Aligning the example with the actual Python class name will make it easier for users to copy-paste working code.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb502e and 9ea1957.

📒 Files selected for processing (8)
  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
🧰 Additional context used
📓 Path-based instructions (14)
src/tests/class_tests/openms/**/*.cpp

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write unit tests for new functionality

Files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
**/*.{h,hpp,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{h,hpp,cpp}: Never use std::cout or std::cerr directly; use OpenMS logging macros instead
Never use std::endl; use \n for performance
Use PascalCase for class names, type names, and namespace names
Use lowerCamelCase for method and function names
Use snake_case for variable names
Use trailing underscore for private and protected member variables
Use UPPER_SNAKE_CASE for enum values and preprocessor macros
Use Size and SignedSize types from OpenMS for STL .size() values instead of platform-dependent types
Prefer references over pointers in C++ code
Always use braces for control flow blocks, even single-line statements (trivial one-liners may be kept single-line)
Place opening and closing braces on their own lines, aligned vertically
Add a space after control flow keywords (if, for, while, switch)
Add spacing around binary operators
Use OpenMS::String for numeric formatting and parsing instead of standard library alternatives
Use OpenMS primitive types from OpenMS/CONCEPT/Types.h
Follow Rule-of-0 or Rule-of-6 for class design (ensure proper move/copy semantics or default them)
Derive exception classes from Exception::Base; throw with file, line, and OPENMS_PRETTY_FUNCTION information
Catch exceptions by const reference
Use ./.clang-format configuration file from repository root for code formatting
Provide comments covering at least ~5% of code; use // style and describe the next few lines in plain English
Use C++20 language standard; avoid features not supported across all target platforms (Linux, macOS, Windows)

Files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
**/{include,source}/**/*.{h,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

Pair each C++ header file (.h) with a corresponding implementation file (.cpp) for non-template code

Files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
src/tests/**/*_test.cpp

📄 CodeRabbit inference engine (AGENTS.md)

src/tests/**/*_test.cpp: Test files must use NEW_TMP_FILE(filename) macro for each temporary output file
Wrap template methods with 2 or more arguments in parentheses within START_SECTION macros in tests
Use FuzzyDiff for numeric comparisons in tests; maintain a whitelist for unstable lines
Avoid side effects in test comparison macros; use idempotent test design

Files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
src/tests/class_tests/openms/source/*_test.cpp

📄 CodeRabbit inference engine (AGENTS.md)

Use USE_CASE_DESCRIPTION pattern for test names; add test source file to executables.cmake

Files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/openms/**/*.{cpp,h,hpp,cc,cxx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/openms/**/*.{cpp,h,hpp,cc,cxx}: Follow the existing C++ coding conventions in the codebase
Use the established naming patterns for classes, methods, and variables
Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Follow the established error handling patterns
Utilize OpenMS logging mechanisms
Be mindful of memory usage when processing large datasets
Consider algorithmic complexity for data processing operations
Use appropriate OpenMS containers and algorithms

Files:

  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
src/openms/**/*.{h,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

src/openms/**/*.{h,cpp}: For new C++ classes: create paired .h and .cpp files, add Doxygen documentation, create a class test, apply OPENMS_DLLAPI, and register in CMake lists
File name must match class name; one class per file (except templates with _impl.h suffix)
When modifying C++ APIs, update corresponding .pxd files and pyOpenMS addons

Files:

  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
src/openms/**

📄 CodeRabbit inference engine (AGENTS.md)

src/openms/**: Use lowercase file extensions (except ML/XML and mzData where case is significant)
When adding new file formats, update FileHandler::NamesOfTypes[], schema files, and tests

Files:

  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
🧠 Learnings (24)
📓 Common learnings
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
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
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : For new C++ classes: create paired `.h` and `.cpp` files, add Doxygen documentation, create a class test, apply `OPENMS_DLLAPI`, and register in CMake lists
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/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
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
📚 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/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 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/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-09-03T12:58:20.032Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/**/*_test.cpp : Use `FuzzyDiff` for numeric comparisons in tests; maintain a whitelist for unstable lines

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/**/*_test.cpp : Avoid side effects in test comparison macros; use idempotent test design

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms_gui/source/*_test.cpp : Use `SET_UP` and `TEAR_DOWN` methods in GUI tests for Qt setup/cleanup

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/**/*_test.cpp : Wrap template methods with 2 or more arguments in parentheses within `START_SECTION` macros in tests

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/executables.cmake : Register new C++ class test in `src/tests/class_tests/openms/executables.cmake`

Applied to files:

  • src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
📚 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/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
📚 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/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
  • src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
  • src/pyOpenMS/pxds/MRMFeatureFilter.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/tests/** : Run pyOpenMS tests from outside the source tree with `PYTHONPATH` set to avoid import shadowing

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧬 Code graph analysis (1)
src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp (1)
src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp (2)
  • calculateRTDifference (3137-3137)
  • calculateResolution (3154-3154)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: cppcheck-test
🔇 Additional comments (13)
src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd (3)

1-5: LGTM: Imports follow proper Cython conventions.

The imports correctly use cimport for Cython types and follow the established pattern for pyOpenMS .pxd files.


6-6: LGTM: extern from statement follows OpenMS conventions.

The extern from declaration correctly uses angle brackets inside the string literal, which is the established pattern for OpenMS .pxd files.

Based on learnings.


44-46: The current implementation is correct; no constructor declarations are needed.

MRMBatchFeatureSelector is a utility class with only static methods and a deleted constructor. This matches the established pattern in the codebase for such classes (e.g., File, MRMRTNormalizer, VersionInfo), where an empty class body with pass is appropriate. Constructor declarations are required for classes with instance methods, not for static-only utility classes.

src/tests/class_tests/openms/source/MRMFeatureFilter_test.cpp (1)

3137-3151: RT-difference test covers core behavior and symmetry well

The test setup and assertions align with the implementation (absolute RT difference and order-independence). No issues here.

src/pyOpenMS/pxds/MRMFeatureSelector.pxd (1)

14-139: MRMFeatureSelector bindings are consistent and minimal

The SelectorParameters, MRMFeatureSelectorQMIP, and MRMFeatureSelectorScore declarations follow the usual pyOpenMS pattern (ctors, references, no Python-only methods), and the exposed selectMRMFeature signatures line up with the documented usage. This looks ready to be consumed by the new tests.

src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (3)

9-10: LGTM!

The import aliases for libcpp_map and libcpp_vector are correctly added to support the vector and map types used in method signatures.


14-59: Excellent documentation with practical example!

The comprehensive wrap-doc for AbsoluteQuantitation includes a clear workflow overview and a complete Python usage example. This greatly improves the usability of the Python bindings.


125-184: Well-documented method signatures with helpful usage guidance.

The remaining methods use consistent parameter passing (const Param & for transformation_model_params) and include clear documentation for each parameter and return value.

src/pyOpenMS/pxds/TargetedSpectraExtractor.pxd (5)

6-12: LGTM!

The import statements correctly add MSSpectrum and standard container types (libcpp_vector, libcpp_pair, libcpp_map) needed for the updated method signatures.


19-51: Excellent workflow documentation with practical example!

The comprehensive wrap-doc clearly describes the four-stage pipeline (annotate → pick → score → select) and provides a complete Python usage example. This significantly improves the discoverability and usability of the class.


53-54: Constructors properly declared for autowrap support.

Both default and copy constructors are correctly declared following pyOpenMS conventions.

As per coding guidelines, Cython .pxd files must declare constructors for proper autowrap support.


60-217: Well-designed method overloads with comprehensive documentation.

The method overloads provide flexibility for different use cases (with/without features, different input types) while maintaining clear documentation for each variant. All signatures correctly use except + nogil and appropriate parameter passing (const references for inputs, non-const references for outputs).


250-266: Nested class properly exposed with helpful limitation notes.

The TSE_Match nested class is correctly declared with constructors and public members. The documentation notes about non-wrapped comparator types due to type conversion issues are helpful for understanding the API limitations and directing users to alternative methods.

timosachsenberg and others added 2 commits January 4, 2026 21:08
… unused import

- Remove unused `import os` from test_TargetedQuantitation.py
- Fix fitCalibration parameter to use `const Param &` to match C++ API
- Fix calculateBiasAndR parameter to use `const Param &` to match C++ API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (1)

92-143: Parameter passing issue resolved.

The previous review concern about const Param & for transformation_model_params has been properly addressed:

  • Line 96: fitCalibration now uses const Param & ✓
  • Line 111: calculateBiasAndR now uses const Param & ✓

All calibration method signatures now correctly match the C++ API.

🧹 Nitpick comments (1)
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (1)

18-20: Consider adding math import at module level.

The math module is imported inside several test methods (lines 231, 256, 352) instead of at the module level. Moving it to the top would be more conventional and avoid repeated imports.

🔎 Suggested import organization
 import unittest
+import math
 
 import pyopenms as oms
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ea1957 and cb0337b.

📒 Files selected for processing (2)
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧠 Learnings (16)
📓 Common learnings
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
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
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/tests/**/*.py : Write pyOpenMS tests for new Python bindings
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/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 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/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/tests/** : Run pyOpenMS tests from outside the source tree with `PYTHONPATH` set to avoid import shadowing

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧬 Code graph analysis (1)
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (1)
src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp (12)
  • MRMFeatureFilter (26-31)
  • MRMFeatureFilter (33-33)
  • setMetaValue (1034-1047)
  • setMetaValue (1034-1034)
  • calculateIonRatio (911-952)
  • calculateIonRatio (911-911)
  • calculateRTDifference (954-957)
  • calculateRTDifference (954-954)
  • calculateResolution (959-997)
  • calculateResolution (959-959)
  • getDefaultParameters (35-41)
  • getDefaultParameters (35-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-lnx-arm
  • GitHub Check: cppcheck-test
🔇 Additional comments (5)
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (2)

23-372: Excellent test coverage for new pyOpenMS bindings.

The test suite provides comprehensive coverage of the Targeted Quantitation algorithms:

  • Data structures (MRMFeatureQC, ComponentQCs, etc.)
  • Calculations (ion ratio, RT difference, resolution, bias)
  • Workflow components (AbsoluteQuantitation, PeakIntegrator, feature selectors)
  • Utility classes (SelectorParameters, EmgGradientDescent, TargetedSpectraExtractor)

Test logic is sound, including correct bias calculation validation (line 209) and resolution formula (lines 136-138).

Based on learnings: pyOpenMS tests written for new Python bindings.


375-450: Well-structured workflow example.

The example_targeted_quantitation_workflow function provides an excellent step-by-step demonstration of the complete quantitation workflow, with clear guidance for users on how to apply it to real data.

src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (3)

9-57: Excellent documentation with comprehensive Python example.

The added wrap-doc provides:

  • Clear class overview and workflow description
  • Complete Python code example demonstrating typical usage
  • Proper import aliases (libcpp_map, libcpp_vector) for container types

This significantly improves the usability of the AbsoluteQuantitation bindings.

Based on learnings: Doxygen comments added for new pyOpenMS bindings.


58-81: LGTM!

Constructor declarations and basic methods follow proper Cython patterns:

  • Default and copy constructors declared per coding guidelines
  • Appropriate use of reference parameters and const qualifiers
  • Clear wrap-doc documentation for each method

145-184: LGTM!

The remaining method bindings are well-designed:

  • Pragmatic exclusion of complex nested container method with clear documentation (lines 145-146)
  • Alternative simpler API provided (optimizeSingleCalibrationCurve)
  • quantifyComponents wrap-doc clearly documents output metavalues

All method signatures properly use const qualifiers and reference types.

timosachsenberg and others added 3 commits January 4, 2026 22:29
- Move `import math` to module level in test_TargetedQuantitation.py
- Remove unused `libcpp_pair` import in MRMFeatureSelector.pxd
- Fix misleading doc comment for calculateBiasAndR (remove "updated in place" since param is const)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The example incorrectly showed MRMFeatureSelector.SelectorParameters()
but SelectorParameters is exposed at module level, so it should be
just SelectorParameters().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- C++/headers: 2 spaces (OpenMS convention)
- Python/Cython: 4 spaces (PEP 8 standard)

This matches the actual codebase conventions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[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.

Actionable comments posted: 0

♻️ Duplicate comments (2)
src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (2)

92-106: Parameter signature correctly updated to match C++ API.

The fitCalibration method now correctly uses const Param & transformation_model_params (line 96), matching the C++ API. This avoids unnecessary copying of the Param object and maintains API consistency, as discussed in previous reviews.


107-124: Parameter signature correctly updated to match C++ API.

The calculateBiasAndR method now correctly uses const Param & transformation_model_params (line 111), matching the C++ API. This maintains consistency with other methods and avoids unnecessary object copies.

🧹 Nitpick comments (3)
src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd (1)

1-4: Consider removing unused imports if the skeleton remains unwrapped.

The imports reference types that would be needed for actual method bindings, but since the class currently only contains pass (lines 44-46), these imports are unused. If this remains a documentation-only skeleton long-term, consider removing them for clarity. However, if bindings are planned soon, keeping them is reasonable.

src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (1)

9-10: Unused import: libcpp_map

The libcpp_map import on line 9 is not used in any of the exposed method signatures. Line 145-146 explains that the map-based overload of optimizeCalibrationCurves is intentionally not wrapped. Consider removing the unused import to keep the file clean.

🔎 Proposed fix
-from libcpp.map cimport map as libcpp_map
 from libcpp.vector cimport vector as libcpp_vector
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (1)

85-142: Thorough testing of MRMFeatureFilter calculations.

The tests correctly verify the three calculation methods (ion ratio, RT difference, resolution) with appropriate test data. The inline comment explaining the resolution formula (lines 137-139) is helpful and matches the C++ implementation.

Optional: Consider adding edge case tests

For more comprehensive coverage, you could add tests for edge cases such as:

  • Ion ratio when one feature has zero intensity
  • RT difference when features have identical RTs
  • Resolution when peak widths are zero or missing

However, this is optional as the current tests adequately verify the basic functionality for integration testing purposes.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb0337b and d7edf58.

📒 Files selected for processing (5)
  • AGENTS.md
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
✅ Files skipped from review due to trivial changes (1)
  • AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pyOpenMS/pxds/MRMFeatureSelector.pxd
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧠 Learnings (19)
📓 Common learnings
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
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
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/tests/**/*.py : Write pyOpenMS tests for new Python bindings
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/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd
  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/pxds/AbsoluteQuantitation.pxd
📚 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/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 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/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/tests/** : Run pyOpenMS tests from outside the source tree with `PYTHONPATH` set to avoid import shadowing

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 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} : Follow the existing C++ coding conventions in the codebase

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
📚 Learning: 2026-01-04T21:35:37.785Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8588
File: src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py:1-456
Timestamp: 2026-01-04T21:35:37.785Z
Learning: For Python files in the repository, follow PEP 8: use 4-space indentation, avoid tabs, and ensure Unix LF line endings. The 2-space indentation and Unix line endings guideline applies to C/Cython in their respective languages; Python files should adhere to Python style (PEP 8) regardless of other language rules.

Applied to files:

  • src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py
🧬 Code graph analysis (1)
src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (2)
src/openms/include/OpenMS/ANALYSIS/OPENSWATH/MRMFeatureQC.h (5)
  • overall_quality_l (123-196)
  • overall_quality_u (125-130)
  • n_light_l (222-222)
  • ion_ratio_l (236-274)
  • ion_ratio_u (237-241)
src/openms/source/ANALYSIS/OPENSWATH/MRMFeatureFilter.cpp (10)
  • MRMFeatureFilter (26-31)
  • MRMFeatureFilter (33-33)
  • calculateIonRatio (911-952)
  • calculateIonRatio (911-911)
  • calculateRTDifference (954-957)
  • calculateRTDifference (954-954)
  • calculateResolution (959-997)
  • calculateResolution (959-959)
  • getDefaultParameters (35-41)
  • getDefaultParameters (35-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: cppcheck-test
🔇 Additional comments (12)
src/pyOpenMS/pxds/MRMBatchFeatureSelector.pxd (1)

8-46: Clear documentation for unwrapped class.

The wrap-doc clearly explains why this class is a skeleton (nested type limitations) and provides a practical Python workaround example. The past issue with SelectorParameters() instantiation (line 30) has been correctly addressed. The decision not to wrap the static methods is well-documented.

src/pyOpenMS/pxds/AbsoluteQuantitation.pxd (4)

14-59: Excellent documentation!

The class-level documentation is comprehensive and well-structured. It includes:

  • Clear description of the quantitation workflow
  • Step-by-step usage guide
  • Complete Python code example
  • Proper constructor declarations for pyOpenMS

This follows the learnings about adding Doxygen comments for pyOpenMS bindings.


61-91: Well-structured method bindings with comprehensive documentation.

All exposed methods follow pyOpenMS best practices:

  • Proper use of const references for parameters
  • Consistent except + nogil declarations for C++ exception handling
  • Clear wrap-doc comments explaining parameters and return values
  • Appropriate use of STL container types (libcpp_vector)

Also applies to: 125-174


145-146: Good design decision documented.

The note explaining why the map-based overload of optimizeCalibrationCurves isn't wrapped is helpful context. Complex nested container types (map<String, vector<...>>) can be challenging in Cython bindings, and providing optimizeSingleCalibrationCurve as an alternative is a reasonable approach.


175-184: Excellent documentation of output behavior.

The wrap-doc for quantifyComponents clearly explains:

  • What the method does
  • How results are stored (as metavalues)
  • Specific metavalue names users should look for ("calculated_concentration", "concentration_units")
  • That the FeatureMap is modified in place

This level of detail is very helpful for users of the Python API.

src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py (7)

18-21: LGTM! Clean imports with no unused dependencies.

All imports are actively used throughout the test suite. The previously flagged unused os import has been correctly removed.


24-83: Excellent test coverage of MRMFeatureQC structures.

The tests appropriately verify instantiation and attribute access for all three QC structures (ComponentQCs, ComponentGroupQCs, ComponentGroupPairQCs). The inline comments at lines 41, 61, and 79 about pyOpenMS vector assignment behavior are particularly helpful for users.


145-212: Well-structured tests for AbsoluteQuantitation workflow.

The tests appropriately cover:

  • Method configuration with comprehensive parameter setting (LLOQ, ULOQ, transformation model, IS name)
  • Quantitation method list management
  • Ratio and bias calculations with clear expected values

The inline comment explaining the bias formula (line 209) is helpful for understanding the test expectations.


214-276: Good coverage of PeakIntegrator functionality.

The tests verify:

  • Parameter exposure (integration_type, baseline_type)
  • Peak integration on synthetic Gaussian chromatograms
  • Peak shape metrics calculation

The test data generation using mathematical Gaussian functions (lines 236, 259) is appropriate for integration testing. The two-step workflow (integrate → calculate metrics) matches typical usage patterns.


278-369: Appropriate test coverage for remaining components.

The tests cover:

  • EmgGradientDescent: Parameter exposure verification
  • SelectorParameters: Both default values and parameter modification
  • MRMFeatureSelector: Instantiation of both Score and QMIP variants
  • TargetedSpectraExtractor: Parameter access and functional spectrum picking

The pickSpectrum test (lines 345-369) appropriately uses synthetic data to verify peak picking functionality. While some tests are minimal (instantiation only), this is reasonable for components that may require complex setup or are more thoroughly tested at the C++ level.


372-448: Valuable workflow demonstration for users.

This example function serves as excellent documentation, demonstrating:

  • QC criteria configuration with proper list assignment
  • Quantitation method setup with LLOQ/ULOQ bounds
  • AbsoluteQuantitation configuration
  • Feature selector parameters
  • PeakIntegrator parameter setting

The clear print statements and the explicit acknowledgment (lines 442-447) that this is setup-only (not a complete data-processing workflow) appropriately set user expectations. This is valuable onboarding material for users learning the Targeted Quantitation API.


450-456: LGTM! Standard and effective main guard.

Running the example workflow before the unit tests provides a nice demonstration followed by detailed test results. The verbosity=2 setting is helpful for debugging.

timosachsenberg and others added 4 commits January 5, 2026 11:55
- Migrate QMenu::addAction calls to Qt6.2-compatible API by using
  addAction(text, receiver, method)->setShortcut(shortcut) pattern
  instead of the deprecated addAction(text, shortcut, receiver, method)
- Maintain type-safe function pointers instead of SLOT macros
- Move Targeted Quantitation Tutorial link to Documentation section
  and change from @subpage to @ref to avoid navigation hierarchy clutter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

1 participant