Skip to content

feat(CometAdapter): add Bruker .d DDA-PASEF support - #9126

Merged
timosachsenberg merged 11 commits into
developfrom
feat/comet-bruker-d-support
Apr 10, 2026
Merged

timosachsenberg merged 11 commits into
developfrom
feat/comet-bruker-d-support

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add native Bruker .d (DDA-PASEF) input support to CometAdapter, converting .d to temporary indexed mzML via BrukerTimsFile for Comet processing
  • Suppress misleading centroid warning in SearchEngineBase for TimsTOF data (inherently centroided)
  • Register Bruker-specific parameters (bruker:export_mode, bruker:calibration_tolerance, bruker:calibrate) behind #ifdef WITH_OPENTIMS
  • Annotate ion mobility values from the .d data onto peptide identifications in post-processing, with a warning if annotation fails (native ID mismatch)
  • Add TOPP integration test with shared OPENTIMS DDA-PASEF test data, guarded by WITH_OPENTIMS, OPENTIMS_DDA_TEST_DATA, and Comet binary availability

Test plan

  • CI builds with WITH_OPENTIMS=ON pass
  • CI builds with WITH_OPENTIMS=OFF pass (compile guards)
  • TOPP_CometAdapter_DDA test passes with OPENTIMS test data enabled
  • Existing CometAdapter mzML tests remain unaffected
  • Verify IM values are annotated on peptide IDs from .d input

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

Summary by CodeRabbit

  • New Features

    • CometAdapter can ingest Bruker TimsTOF (.d) inputs and includes new Bruker-specific CLI options for calibration/export.
  • Bug Fixes

    • Bruker TDF file type now correctly skips centroiding validation checks.
    • Warns when ion-mobility values are missing for some peptide IDs from Bruker inputs.
  • Tests

    • Added DDA CometAdapter pipeline and FDR steps, made decoy DB generation unconditional, added an ion-mobility metadata verification test; test fixtures updated with new CometAdapter parameters.

timosachsenberg and others added 8 commits April 10, 2026 11:46
5 tasks: SearchEngineBase BRUKER_TDF case, input registration,
.d-to-mzML conversion, post-processing IM validation, build/test
verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
TimsTOF data is inherently centroided, so suppress the misleading
'make sure spectra are centroided' warning for .d input.
Add 'd' to valid input formats (guarded by WITH_OPENTIMS).
Register bruker:export_mode, bruker:calibration_tolerance, and
bruker:calibrate parameters matching the PeakPickerIM/FileConverter
pattern. Add getBrukerConfig_() helper.
When input is a Bruker .d directory, load via BrukerTimsFile, filter
to MS2 spectra, and write a temporary indexed mzML for Comet. The
MSExperiment is retained for IM annotation in post-processing.
Existing mzML path is unchanged.
… mismatch

Warn when Bruker .d input is used but not all peptide IDs could be
annotated with ion mobility values, indicating a possible native ID
mismatch between the .d data and Comet results.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add CometAdapter integration test using the shared OPENTIMS DDA test
data, guarded by WITH_OPENTIMS, OPENTIMS_DDA_TEST_DATA, and Comet
binary availability. Includes FDR filtering step.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@timosachsenberg timosachsenberg changed the title Feat/comet bruker d support feat(CometAdapter): add Bruker .d DDA-PASEF support Apr 10, 2026
@coderabbitai

coderabbitai Bot commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 580b9bd9-19b4-460b-984c-dffa0e8e857e

📥 Commits

Reviewing files that changed from the base of the PR and between e6ae2e0 and 058542d.

📒 Files selected for processing (6)
  • src/tests/topp/THIRDPARTY/Chy_test.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_1_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_2_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_3_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_4_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_6_out.idXML
✅ Files skipped from review due to trivial changes (5)
  • src/tests/topp/THIRDPARTY/CometAdapter_3_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_6_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_2_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_4_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_1_out.idXML
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tests/topp/THIRDPARTY/Chy_test.idXML

📝 Walkthrough

Walkthrough

Added Bruker TimsTOF .d native input handling in CometAdapter (loading, ms-level filtering, mzML serialization, new bruker CLI options, IM warnings). SearchEngineBase treats BRUKER_TDF like MGF for centroiding checks. Tests and idXML fixtures updated; DDA test flows extended with optional CometAdapter steps.

Changes

Cohort / File(s) Summary
SearchEngine centroiding
src/openms/source/APPLICATIONS/SearchEngineBase.cpp
Treat FileTypes::BRUKER_TDF as a case that skips centroiding warning/error checks (same handling as MGF).
CometAdapter (new Bruker .d support)
src/topp/CometAdapter.cpp
Conditional (WITH_OPENTIMS) inclusion of BrukerTimsFile, new bruker:* CLI options, detect .d input, load Bruker spectra, filter by requested MS level, serialize filtered spectra into a temporary indexed mzML for downstream Comet, clear peak data but keep metadata, and warn if IDs lack IM annotations.
Tests — CMake and DDA flows
src/tests/topp/CMakeLists.txt
Made DecoyDatabase_DDA generation unconditional; added optional CometAdapter DDA workflow gated on COMET_BINARY with FDR filtering and an IM metadata verification test depending on Comet output; SageAdapter registration remains conditional on SAGE_BINARY.
Test fixtures (idXML)
src/tests/topp/THIRDPARTY/Chy_test.idXML, .../CometAdapter_1_out.idXML, .../CometAdapter_2_out.idXML, .../CometAdapter_3_out.idXML, .../CometAdapter_4_out.idXML, .../CometAdapter_6_out.idXML
Added three CometAdapter UserParam entries (export_mode=auto, calibration_tolerance=0.0, calibrate=false) to multiple idXML fixtures; updated search-parameter-related entries in test fixtures.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CometAdapter
    participant BrukerTimsFile
    participant mzMLTemp
    participant CometEngine

    User->>CometAdapter: invoke with `.d` input + ms_level
    CometAdapter->>CometAdapter: detect file type -> BRUKER .d
    CometAdapter->>BrukerTimsFile: load(config)
    BrukerTimsFile-->>CometAdapter: spectra (with IM metadata)
    CometAdapter->>CometAdapter: filter spectra by ms_level
    CometAdapter->>mzMLTemp: serialize filtered spectra to indexed mzML
    mzMLTemp-->>CometAdapter: indexed mzML path
    CometAdapter->>CometEngine: run Comet on mzML
    CometEngine-->>CometAdapter: identification results
    CometAdapter->>CometAdapter: annotate IDs with IM (warn if incomplete)
    CometAdapter-->>User: write idXML (with IM metadata)
Loading

Suggested labels

Review effort 2/5

Suggested reviewers

  • jpfeuffer
  • singjc
  • jcharkow

Poem

🐰 I hopped through spectra, .d in sight,

Bruker notes shimmered in ion-mobility light,
Comet took the mzML and sang its tune,
Tests woke up and pipelined noon —
A rabbit's cheer for code in bloom!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely summarizes the main change: adding Bruker .d DDA-PASEF support to CometAdapter, which is the primary focus of all changes across SearchEngineBase, CometAdapter, test configurations, and test fixtures.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/comet-bruker-d-support

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (3)
docs/superpowers/specs/2026-04-10-cometadapter-bruker-d-support-design.md (1)

58-59: Document the expected Bruker nativeID CV term/pattern explicitly.

This section discusses native-ID mismatch handling, but adding the exact expected format would make troubleshooting deterministic.

✍️ Proposed doc addition
 - Native ID validation: log a warning if `addMissingIMToPeptideIDs` returns false for .d input (since DDA-PASEF data should always have IM).
+  - Expected Bruker nativeID metadata/pattern: `MS:1002818` ("Bruker TDF nativeID format"), with IDs like `frame=<FRAME_ID> scan=<SCAN_ID>`.
Based on learnings: In OpenMS BrukerTimsFile.cpp, the correct PSI-MS CV term is `MS:1002818` with nativeID pattern `frame= scan=`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/specs/2026-04-10-cometadapter-bruker-d-support-design.md`
around lines 58 - 59, Update the native-ID mismatch handling section to
explicitly state the expected Bruker nativeID CV term and pattern: add that the
PSI-MS CV term is MS:1002818 and the nativeID should follow the pattern
"frame=<FRAME_ID> scan=<SCAN_ID>". Also mention that when processing .d
(DDA-PASEF) inputs the function addMissingIMToPeptideIDs should never return
false because IM is expected, and add a warning note in the text suggesting to
log or surface a diagnostic if addMissingIMToPeptideIDs does return false for .d
files.
src/topp/CometAdapter.cpp (2)

709-709: Prefer '\n' over std::endl in the new log messages.

These new logging paths do not need an unconditional flush.

As per coding guidelines, "Avoid std::endl for performance reasons; prefer \n in C++".

Also applies to: 811-812

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

In `@src/topp/CometAdapter.cpp` at line 709, Replace the use of std::endl in the
new logging calls with '\n' to avoid unnecessary flushes: locate the
OPENMS_LOG_INFO statements added in CometAdapter (the lines that print "Loaded
... MS" and the similar messages around the same area referenced) and change the
trailing std::endl to '\n' in those log message expressions (also update the
occurrences noted near the later two lines). Ensure the log text and spacing
remain identical except for replacing std::endl with '\n'.

121-122: Add braces around the export_mode branch.

This helper introduces a new conditional without braces, which goes against the repository’s C++ style and makes later edits easier to get wrong.

♻️ Suggested cleanup
-    if (mode == "spectrum") c.export_mode = BrukerTimsFile::Config::SPECTRUM;
-    else c.export_mode = BrukerTimsFile::Config::AUTO;
+    if (mode == "spectrum")
+    {
+      c.export_mode = BrukerTimsFile::Config::SPECTRUM;
+    }
+    else
+    {
+      c.export_mode = BrukerTimsFile::Config::AUTO;
+    }

As per coding guidelines, "Use braces on their own lines and keep them aligned in C++ code" and "Always use braces for code blocks in C++, even for single-line blocks (unless trivial one-liners)".

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

In `@src/topp/CometAdapter.cpp` around lines 121 - 122, The two-line conditional
that sets c.export_mode based on mode should use explicit braces to follow C++
style: change the if/else that assigns c.export_mode (using
BrukerTimsFile::Config::SPECTRUM and BrukerTimsFile::Config::AUTO) to use block
braces for both branches so each assignment is wrapped in its own { ... } block,
keeping braces on their own lines and aligned with the surrounding code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/superpowers/plans/2026-04-10-cometadapter-bruker-d-support.md`:
- Around line 327-331: The documented Step 3 uses `cmake --build` with
`-DWITH_OPENTIMS=OFF`, which is ignored; update the instructions under "Step 3:
Verify build without WITH_OPENTIMS (if feasible)" to first run a configure
invocation that passes the cache variable (e.g., `cmake -S . -B <build-dir>
-DWITH_OPENTIMS=OFF`) and then build the `CometAdapter` target from that build
directory with `cmake --build <build-dir> --target CometAdapter -j$(nproc)` so
the `#ifdef` guarded code path is actually tested; reference the Step 3 heading,
the `cmake -S . -B ... -DWITH_OPENTIMS=OFF` configure command and the `cmake
--build ... --target CometAdapter` build command in the doc change.

In `@docs/superpowers/specs/2026-04-10-cometadapter-bruker-d-support-design.md`:
- Line 72: The fenced code block at the diagram around "idXML output" is missing
a language identifier causing markdownlint MD040; update that code fence by
adding a language tag like "text" (i.e., change the opening ``` to ```text) so
the block becomes ```text ... ``` and the lint warning is resolved.

In `@src/tests/topp/CMakeLists.txt`:
- Around line 3009-3026: Add a post-check after the TOPP_CometAdapter_DDA /
TOPP_FalseDiscoveryRate tests that parses the produced idXML (preferably the
FDR-filtered ${TESTS_TEMP_DIR}/CometAdapter_DDA_fdr.tmp.idXML) and asserts that
at least one peptide hit contains ion-mobility metadata (e.g. presence of an ion
mobility CV term/userParam or non-empty mobility/drift time on a
PeptideHit/SpectrumIdentificationItem). Implement this as an additional add_test
(or a small script invoked by set_tests_properties DEPENDS) that opens the
idXML, looks for the IM field on any identification entry, and fails if none are
found; reference the existing test names TOPP_CometAdapter_DDA and
TOPP_FalseDiscoveryRate when wiring the dependency so it runs only after the
adapter and FDR steps.
- Line 3008: The if condition uses an unquoted expansion (${COMET_BINARY}) which
breaks when COMET_BINARY contains spaces; update the conditional that currently
reads if (NOT (${COMET_BINARY} STREQUAL "COMET_BINARY-NOTFOUND")) to compare a
quoted expansion (e.g., quote the COMET_BINARY variable in the STREQUAL check)
or simplify to if (COMET_BINARY) so that the COMET_BINARY variable is handled
safely; locate the conditional referencing COMET_BINARY in the targed CMakeLists
and apply the quoted comparison or the simplified truthy check.

In `@src/topp/CometAdapter.cpp`:
- Around line 700-719: The current flow loads full Bruker MS2 peak arrays into
exp (via BrukerTimsFile::load) and keeps them in memory until after
MzMLFile().store(tmp_mzml, exp), which causes OOM on large runs; after writing
the temporary mzML you must free the heavy binary arrays by either reloading
metadata-only from tmp_mzml (call MzMLFile::load into a fresh MSSpectrum
container or PeakFile with metadata-only option) or explicitly clear the binary
arrays in exp (e.g., for each spectrum call clear() on its intensity and m/z
arrays) before launching Comet; apply the same change to the other .d path (the
code around lines 739-744) so Comet only sees metadata-only spectra and full
peak data is not retained in memory.

---

Nitpick comments:
In `@docs/superpowers/specs/2026-04-10-cometadapter-bruker-d-support-design.md`:
- Around line 58-59: Update the native-ID mismatch handling section to
explicitly state the expected Bruker nativeID CV term and pattern: add that the
PSI-MS CV term is MS:1002818 and the nativeID should follow the pattern
"frame=<FRAME_ID> scan=<SCAN_ID>". Also mention that when processing .d
(DDA-PASEF) inputs the function addMissingIMToPeptideIDs should never return
false because IM is expected, and add a warning note in the text suggesting to
log or surface a diagnostic if addMissingIMToPeptideIDs does return false for .d
files.

In `@src/topp/CometAdapter.cpp`:
- Line 709: Replace the use of std::endl in the new logging calls with '\n' to
avoid unnecessary flushes: locate the OPENMS_LOG_INFO statements added in
CometAdapter (the lines that print "Loaded ... MS" and the similar messages
around the same area referenced) and change the trailing std::endl to '\n' in
those log message expressions (also update the occurrences noted near the later
two lines). Ensure the log text and spacing remain identical except for
replacing std::endl with '\n'.
- Around line 121-122: The two-line conditional that sets c.export_mode based on
mode should use explicit braces to follow C++ style: change the if/else that
assigns c.export_mode (using BrukerTimsFile::Config::SPECTRUM and
BrukerTimsFile::Config::AUTO) to use block braces for both branches so each
assignment is wrapped in its own { ... } block, keeping braces on their own
lines and aligned with the surrounding code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b6a801a-06ce-4e9f-9108-9154c7b0d506

📥 Commits

Reviewing files that changed from the base of the PR and between 1017611 and 75bffbe.

📒 Files selected for processing (5)
  • docs/superpowers/plans/2026-04-10-cometadapter-bruker-d-support.md
  • docs/superpowers/specs/2026-04-10-cometadapter-bruker-d-support-design.md
  • src/openms/source/APPLICATIONS/SearchEngineBase.cpp
  • src/tests/topp/CMakeLists.txt
  • src/topp/CometAdapter.cpp

Comment thread src/tests/topp/CMakeLists.txt Resolved
Comment thread src/tests/topp/CMakeLists.txt Resolved
Comment thread src/topp/CometAdapter.cpp Resolved
timosachsenberg and others added 2 commits April 10, 2026 12:24
Move DecoyDatabase generation out of the SageAdapter-only block so it
is shared by both CometAdapter and SageAdapter DDA-PASEF tests.
Without decoys, FDR filtering is meaningless.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…t assertion, remove docs

- Clear peak arrays from MSExperiment after writing temporary mzML
  for Comet. Only spectrum metadata (native IDs, drift times) is
  needed for post-processing IM annotation. Avoids unnecessary memory
  usage during the Comet run on large DDA-PASEF files.
- Add grep-based test assertion that verifies IM UserParam metadata
  is present in CometAdapter DDA output idXML.
- Remove implementation plan and design spec docs (served their
  purpose, not user-facing).

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/tests/topp/CMakeLists.txt (1)

3015-3015: ⚠️ Potential issue | 🟠 Major

Stop expanding COMET_BINARY / SAGE_BINARY inside if().

Line 3015 and Line 3043 use if (NOT (${...} STREQUAL "...-NOTFOUND")). That form is fragile in CMake and breaks when the resolved path contains spaces. Use CMake truthiness (if(COMET_BINARY), if(SAGE_BINARY)) or quote the string comparison instead.

Suggested fix
-  if (NOT (${COMET_BINARY} STREQUAL "COMET_BINARY-NOTFOUND"))
+  if (COMET_BINARY)
@@
-  if (NOT (${SAGE_BINARY} STREQUAL "SAGE_BINARY-NOTFOUND"))
+  if (SAGE_BINARY)
#!/bin/bash
set -eu
tmpdir="$(mktemp -d)"

cat > "${tmpdir}/bad.cmake" <<'EOF'
set(COMET_BINARY "C:/Program Files/Comet/comet.exe")
if (NOT (${COMET_BINARY} STREQUAL "COMET_BINARY-NOTFOUND"))
  message(STATUS "unexpectedly parsed")
endif()
EOF

cat > "${tmpdir}/good.cmake" <<'EOF'
set(COMET_BINARY "C:/Program Files/Comet/comet.exe")
if (COMET_BINARY)
  message(STATUS "parsed correctly")
endif()
EOF

! cmake -P "${tmpdir}/bad.cmake"
cmake -P "${tmpdir}/good.cmake"

Also applies to: 3043-3043

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

In `@src/tests/topp/CMakeLists.txt` at line 3015, The if() checks that expand
variables inside the condition (if (NOT (${COMET_BINARY} STREQUAL
"COMET_BINARY-NOTFOUND")) and the analogous SAGE_BINARY check) are fragile with
paths containing spaces; change these to use CMake truthiness (if(COMET_BINARY)
and if(SAGE_BINARY)) or perform a safe quoted comparison (if (NOT
("${COMET_BINARY}" STREQUAL "COMET_BINARY-NOTFOUND"))) so the condition does not
break when the resolved path contains spaces; update the two occurrences
referencing COMET_BINARY and SAGE_BINARY accordingly.
🧹 Nitpick comments (1)
src/tests/topp/CMakeLists.txt (1)

3037-3039: Consider using ${CMAKE_COMMAND} -P for more portable file content validation.

The test currently shells out to grep, which may not be consistently available across all CTest runners despite working in current CI environments. A CMake-based approach using file(READ) and string(FIND) would be more self-contained and eliminate external tool dependencies. While this specific test functions correctly on Windows via Visual Studio's environment, this refactor aligns with OpenMS test best practices for cross-platform robustness.

Portable alternative
-    add_test(NAME "TOPP_CometAdapter_DDA_IM_check"
-      COMMAND grep -q "UserParam type=\"float\" name=\"IM\"" ${TESTS_TEMP_DIR}/CometAdapter_DDA_out.tmp.idXML)
+    add_test(NAME "TOPP_CometAdapter_DDA_IM_check"
+      COMMAND ${CMAKE_COMMAND}
+        -DINPUT_FILE=${TESTS_TEMP_DIR}/CometAdapter_DDA_out.tmp.idXML
+        -DPATTERN=UserParam\ type=\"float\"\ name=\"IM\"
+        -P ${DATA_DIR_TOPP}/check_file_contains.cmake)
# src/tests/topp/check_file_contains.cmake
if (NOT DEFINED INPUT_FILE OR NOT DEFINED PATTERN)
  message(FATAL_ERROR "INPUT_FILE and PATTERN are required")
endif()

file(READ "${INPUT_FILE}" CONTENTS)
string(FIND "${CONTENTS}" "${PATTERN}" POS)
if (POS EQUAL -1)
  message(FATAL_ERROR "Pattern not found in ${INPUT_FILE}: ${PATTERN}")
endif()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tests/topp/CMakeLists.txt` around lines 3037 - 3039, Replace the
grep-based test with a CMake-scripted check: create a script (e.g.,
check_file_contains.cmake) that expects INPUT_FILE and PATTERN, uses file(READ)
and string(FIND) to fail if pattern not found, then update the add_test for
TOPP_CometAdapter_DDA_IM_check to invoke ${CMAKE_COMMAND} -P
check_file_contains.cmake with INPUT_FILE set to
${TESTS_TEMP_DIR}/CometAdapter_DDA_out.tmp.idXML and PATTERN set to 'UserParam
type="float" name="IM"'; keep the set_tests_properties(... DEPENDS
"TOPP_CometAdapter_DDA") unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/tests/topp/CMakeLists.txt`:
- Line 3015: The if() checks that expand variables inside the condition (if (NOT
(${COMET_BINARY} STREQUAL "COMET_BINARY-NOTFOUND")) and the analogous
SAGE_BINARY check) are fragile with paths containing spaces; change these to use
CMake truthiness (if(COMET_BINARY) and if(SAGE_BINARY)) or perform a safe quoted
comparison (if (NOT ("${COMET_BINARY}" STREQUAL "COMET_BINARY-NOTFOUND"))) so
the condition does not break when the resolved path contains spaces; update the
two occurrences referencing COMET_BINARY and SAGE_BINARY accordingly.

---

Nitpick comments:
In `@src/tests/topp/CMakeLists.txt`:
- Around line 3037-3039: Replace the grep-based test with a CMake-scripted
check: create a script (e.g., check_file_contains.cmake) that expects INPUT_FILE
and PATTERN, uses file(READ) and string(FIND) to fail if pattern not found, then
update the add_test for TOPP_CometAdapter_DDA_IM_check to invoke
${CMAKE_COMMAND} -P check_file_contains.cmake with INPUT_FILE set to
${TESTS_TEMP_DIR}/CometAdapter_DDA_out.tmp.idXML and PATTERN set to 'UserParam
type="float" name="IM"'; keep the set_tests_properties(... DEPENDS
"TOPP_CometAdapter_DDA") unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e4669fc-9e63-439d-93bd-26c07e49384d

📥 Commits

Reviewing files that changed from the base of the PR and between b221971 and aaed29f.

📒 Files selected for processing (2)
  • src/tests/topp/CMakeLists.txt
  • src/topp/CometAdapter.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/topp/CometAdapter.cpp

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/tests/topp/THIRDPARTY/CometAdapter_1_out.idXML`:
- Around line 4-9: The SearchParameters fixture contains machine-local absolute
paths because CometAdapter writes raw tool params into SearchParameters; update
the serialization path in CometAdapter so that when running in test mode it
strips or canonicalizes path-valued UserParam values (e.g., params with names
like "in","out","database","comet_executable","pin_out" or any value containing
path separators) before adding them to SearchParameters. Modify the code path in
the CometAdapter that writes tool params (the block mentioned at
CometAdapter.cpp:798-801) to replace absolute paths with either a stable
placeholder (e.g., "<REDACTED_PATH>" or basename) or omit them entirely in test
mode so the golden fixture no longer contains machine-specific filesystem
details.
- Around line 59-61: The Bruker-specific parameters are being written without
their "bruker:" namespace because
DefaultParamHandler::writeParametersToMetaValues is not preserving hierarchical
namespaces when flattening parameters; update that function to detect and retain
nested namespaces (e.g., parameters registered in CometAdapter.cpp as
"CometAdapter:1:bruker:...") when converting Param objects to MetaValue entries
so the serialized names include the "bruker:" segment (ensure the logic that
builds the meta key concatenates all namespace segments rather than dropping the
"bruker" token), and add/adjust unit tests to assert that parameters registered
with the "bruker" namespace produce meta keys like
"CometAdapter:1:bruker:export_mode" rather than "CometAdapter:1:export_mode".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 71f79825-036e-487b-83e6-d18f6797daf9

📥 Commits

Reviewing files that changed from the base of the PR and between aaed29f and e6ae2e0.

📒 Files selected for processing (6)
  • src/tests/topp/THIRDPARTY/Chy_test.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_1_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_2_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_3_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_4_out.idXML
  • src/tests/topp/THIRDPARTY/CometAdapter_6_out.idXML

Comment on lines +4 to +9
<SearchParameters id="SP_0" db="/home/sachsenb/Development/tmp2/OpenMS/src/tests/topp/THIRDPARTY/proteins.fasta" db_version="" taxonomy="" mass_type="monoisotopic" charges="0:0" enzyme="trypsin" missed_cleavages="1" precursor_peak_tolerance="3" precursor_peak_tolerance_ppm="true" peak_mass_tolerance="0.50025" peak_mass_tolerance_ppm="false" >
<UserParam type="string" name="CometAdapter:1:in" value="/home/sachsenb/Development/tmp2/OpenMS/src/tests/topp/THIRDPARTY/spectra_comet.mzML"/>
<UserParam type="string" name="CometAdapter:1:out" value="/tmp/CometAdapter_1_out1.idXML"/>
<UserParam type="string" name="CometAdapter:1:database" value="/home/sachsenb/Development/tmp2/OpenMS/src/tests/topp/THIRDPARTY/proteins.fasta"/>
<UserParam type="string" name="CometAdapter:1:comet_executable" value="/mnt/c/Program Files/OpenMS-3.1.0-pre-nightly-2024-02-02/share/OpenMS/THIRDPARTY/Comet/comet.exe"/>
<UserParam type="string" name="CometAdapter:1:pin_out" value="/tmp/CometAdapter_1_out2.tsv"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Normalize machine-local paths out of the golden fixture.

These reference lines now embed a local username, workstation-specific install paths, and /tmp output locations. That leaks developer filesystem details and makes the fixture non-reproducible when regenerated on CI or another machine. Since src/topp/CometAdapter.cpp:798-801 writes all tool params into SearchParameters, this churn will keep coming back unless test mode strips or canonicalizes path-valued params before serialization/comparison.

Also applies to: 96-96

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

In `@src/tests/topp/THIRDPARTY/CometAdapter_1_out.idXML` around lines 4 - 9, The
SearchParameters fixture contains machine-local absolute paths because
CometAdapter writes raw tool params into SearchParameters; update the
serialization path in CometAdapter so that when running in test mode it strips
or canonicalizes path-valued UserParam values (e.g., params with names like
"in","out","database","comet_executable","pin_out" or any value containing path
separators) before adding them to SearchParameters. Modify the code path in the
CometAdapter that writes tool params (the block mentioned at
CometAdapter.cpp:798-801) to replace absolute paths with either a stable
placeholder (e.g., "<REDACTED_PATH>" or basename) or omit them entirely in test
mode so the golden fixture no longer contains machine-specific filesystem
details.

Comment on lines +59 to +61
<UserParam type="string" name="CometAdapter:1:export_mode" value="auto"/>
<UserParam type="float" name="CometAdapter:1:calibration_tolerance" value="0.0"/>
<UserParam type="string" name="CometAdapter:1:calibrate" value="false"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== CometAdapter parameter registration ==="
rg -n -C2 'export_mode|calibration_tolerance|calibrate|bruker:' src/topp/CometAdapter.cpp

echo
echo "=== SearchParameters metadata serialization ==="
rg -n -C2 'writeParametersToMetaValues' src/topp/CometAdapter.cpp src/openms/source/DATASTRUCTURES/DefaultParamHandler.cpp src/openms/include/OpenMS/DATASTRUCTURES/DefaultParamHandler.h

echo
echo "=== Serialized keys present in the updated fixtures ==="
rg -n 'CometAdapter:1:(bruker:)?(export_mode|calibration_tolerance|calibrate)' src/tests/topp/THIRDPARTY

Repository: OpenMS/OpenMS

Length of output: 5291


The new Bruker options are being serialized without the bruker: namespace prefix.

The parameters are registered correctly with the bruker: prefix (lines 274–280 in CometAdapter.cpp), but the serialized metadata shows them unprefixed as CometAdapter:1:export_mode, CometAdapter:1:calibration_tolerance, and CometAdapter:1:calibrate instead of the expected CometAdapter:1:bruker:* nesting. This indicates a bug in how hierarchical parameters are serialized to metadata via DefaultParamHandler::writeParametersToMetaValues, causing Bruker-specific options to pollute the top-level CometAdapter metadata namespace across all affected test fixtures.

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

In `@src/tests/topp/THIRDPARTY/CometAdapter_1_out.idXML` around lines 59 - 61, The
Bruker-specific parameters are being written without their "bruker:" namespace
because DefaultParamHandler::writeParametersToMetaValues is not preserving
hierarchical namespaces when flattening parameters; update that function to
detect and retain nested namespaces (e.g., parameters registered in
CometAdapter.cpp as "CometAdapter:1:bruker:...") when converting Param objects
to MetaValue entries so the serialized names include the "bruker:" segment
(ensure the logic that builds the meta key concatenates all namespace segments
rather than dropping the "bruker" token), and add/adjust unit tests to assert
that parameters registered with the "bruker" namespace produce meta keys like
"CometAdapter:1:bruker:export_mode" rather than "CometAdapter:1:export_mode".

The new bruker:export_mode, bruker:calibration_tolerance, and
bruker:calibrate parameters are written as UserParams to all idXML
output via writeParametersToMetaValues. Regenerate reference files
so FuzzyDiff comparisons pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@timosachsenberg
timosachsenberg force-pushed the feat/comet-bruker-d-support branch from e6ae2e0 to 058542d Compare April 10, 2026 12:17
@timosachsenberg
timosachsenberg merged commit 7e564b1 into develop Apr 10, 2026
40 of 41 checks passed
@timosachsenberg
timosachsenberg deleted the feat/comet-bruker-d-support branch April 10, 2026 14:53
github-actions Bot pushed a commit that referenced this pull request Apr 11, 2026
Add missing changelog entries for commits merged after the last sync:
- #9127: Fix LinearResampler right_index bounds clamping (intensity spike bug)
- #9126: CometAdapter Bruker .d DDA-PASEF input support
- #9121: PeptideDataBaseSearchFI runtime search diagnostics and tolerance estimation
- #9122: PeptideDataBaseSearchFI automatic mass accuracy calibration (two-pass search)
- #9123: PeptideDataBaseSearchFI protein-level FDR (picked-protein)
- #9129: OpenSwathWorkflow Bruker DIA MS2 frame aggregation, denoising, and streaming

Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Apr 11, 2026
Add missing changelog entries for commits merged after the last sync:
- #9127: Fix LinearResampler right_index bounds clamping (intensity spike bug)
- #9126: CometAdapter Bruker .d DDA-PASEF input support
- #9121: PeptideDataBaseSearchFI runtime search diagnostics and tolerance estimation
- #9122: PeptideDataBaseSearchFI automatic mass accuracy calibration (two-pass search)
- #9123: PeptideDataBaseSearchFI protein-level FDR (picked-protein)
- #9129: OpenSwathWorkflow Bruker DIA MS2 frame aggregation, denoising, and streaming

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot mentioned this pull request Apr 12, 2026
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