Skip to content

feat(IDRipper): split merged .idparquet into per-run .idparquet outputs - #9237

Merged
timosachsenberg merged 3 commits into
OpenMS:developfrom
timosachsenberg:feat/idripper-idparquet
Apr 29, 2026
Merged

timosachsenberg merged 3 commits into
OpenMS:developfrom
timosachsenberg:feat/idripper-idparquet

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • IDRipper -in now accepts .idparquet (in addition to .idXML).
  • Output format follows input format: .idXML → .idXML, .idparquet → .idparquet.
  • Output ordering is preserved end-to-end: the rip walks IdentificationRuns in the same order they were merged.

The order chain:

  1. IDMerger writes search_params.parquet rows in input-file order.
  2. The QPXFile / ProteinIdentificationArrowIO importer reads rows in storage order into vector<ProteinIdentification>.
  3. IDRipper::IdentificationRuns assigns ident_run_idx 0,1,… in that vector's iteration order.
  4. RipFileMap is a std::map keyed on (ident_run_idx, file_origin_idx), so the output loop walks runs in the same order they were merged.

Depends on

Test plan

  • ctest -R TOPP_IDRipper — 15/15 existing idXML tests pass.
  • End-to-end roundtrip: merge two distinct idparquet files → rip → verify output dirs match input by run_identifier and date, in the original merge order. Both -numeric_filenames and basename-derived naming verified.
  • Add an idparquet rip ctest fixture (follow-up).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • IDRipper supports an additional identification input format and preserves the detected input format for outputs.
  • Bug Fixes

    • Generalized precondition/error messaging to reference the input file generically.
  • Tests

    • Added end-to-end tests and fixtures to validate splitting behavior and format conversion, with deterministic naming and output diffs against references.

Allow IDRipper -in to take a merged .idparquet directory and emit one
.idparquet directory per source IdentificationRun (mirroring the existing
.idXML behaviour).  Output format follows input format: .idXML in -> .idXML
out, .idparquet in -> .idparquet out.

Output ordering is preserved end-to-end.  The IdentificationRuns indexer
assigns ident_run_idx in the order ProteinIdentifications appear in the
in-memory vector, which mirrors the row order of search_params.parquet
(written by IDMerger in input-file order).  RipFileMap is sorted by
(ident_run_idx, file_origin_idx), so the rip iteration walks the runs in
the same order they were merged in.

Verified with merge -> rip round-trip: input1.idparquet -> [run_0]
and input2.idparquet -> [run_1] in the merged file rip back into
ripped/input1.idparquet and ripped/input2.idparquet (or merged_0_0,
merged_1_1 with -numeric_filenames), with run_identifiers and dates
matching the originals.

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

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

IDRipper now accepts idparquet in addition to idXML, detects each input's file type, and preserves that format for outputs by selecting matching extensions and passing the corresponding output FileType to storage; exception text was generalized to reference the input file generically.

Changes

Cohort / File(s) Summary
Core tool
src/topp/IDRipper.cpp
Adds support for idparquet input alongside idXML; uses getTypeByFileName to detect input type and selects matching output extension and {out_type} when calling storeIdentifications; generalizes precondition exception message.
Tests — CTest integration
src/tests/topp/CMakeLists.txt
Adds CTest coverage for .idparquet splitting: runs IDRipper with numeric naming and per-run splitting, converts shards with IDFileConverter, and diffs results with FuzzyDiff (whitelisting identification run date) with explicit DEPENDS chaining.
Tests — fixtures
src/tests/topp/IDRipper_idparquet_0.idXML, src/tests/topp/IDRipper_idparquet_1.idXML
Adds two IdXML test fixtures representing expected per-run outputs (protein/peptide IDs, search params, run metadata) used to validate .idparquet → .idXML shard conversion and comparison.

Possibly related PRs

Poem

🐰 I hopped through files both XML and parquet bright,
Detecting formats by filename, choosing right.
I split the runs, kept each output true,
Bytes preserved — a tidy hop anew. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: IDRipper now supports splitting merged .idparquet files into per-run .idparquet outputs, which is the core feature introduced in this changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

coderabbitai[bot]

This comment was marked as resolved.

@timosachsenberg
timosachsenberg force-pushed the feat/idripper-idparquet branch from 761b8af to b794491 Compare April 28, 2026 20:42
Chain off the existing TOPP_IDMerger_idparquet output: rip the merged
.idparquet into per-run .idparquet directories with -split_ident_runs and
-numeric_filenames, then convert each split back to .idXML and diff
against a reference.

The deterministic numeric naming (merged_<ident_run_idx>_<file_origin_idx>)
combined with two distinct references implicitly verifies that:
  - rip succeeds on .idparquet input
  - both per-run .idparquet output directories are produced
  - their content matches the originating IdentificationRun
  - run-to-output mapping follows merge order (split 0 -> first input,
    split 1 -> second input)

Five tests added: TOPP_IDRipper_idparquet, _convert_{0,1}, _diff_{0,1}.

Addresses CodeRabbit suggestion in PR OpenMS#9237 review.

Co-Authored-By: Claude Opus 4.7 (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.

Actionable comments posted: 1

🤖 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/CMakeLists.txt`:
- Around line 195-225: The test output directory
${TESTS_TEMP_DIR}/IDRipper_idparquet_out is only created at configure time which
allows stale files to persist between runs; before the TOPP_IDRipper_idparquet
test you should delete and recreate that directory at test-run time (e.g. insert
a file(REMOVE_RECURSE ${TESTS_TEMP_DIR}/IDRipper_idparquet_out) followed by
file(MAKE_DIRECTORY ${TESTS_TEMP_DIR}/IDRipper_idparquet_out) or wrap those
steps in a CTest pre-test command) so that TOPP_IDRipper_idparquet, and
downstream tests TOPP_IDRipper_idparquet_convert_0/1 and their diffs, always run
against a clean output directory.
🪄 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: a78334f2-2c39-4a4e-b2ae-6216b160e573

📥 Commits

Reviewing files that changed from the base of the PR and between b794491 and 3d0b00f.

📒 Files selected for processing (3)
  • src/tests/topp/CMakeLists.txt
  • src/tests/topp/IDRipper_idparquet_0.idXML
  • src/tests/topp/IDRipper_idparquet_1.idXML
✅ Files skipped from review due to trivial changes (2)
  • src/tests/topp/IDRipper_idparquet_0.idXML
  • src/tests/topp/IDRipper_idparquet_1.idXML

Comment on lines +195 to +225
file(MAKE_DIRECTORY ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
add_test("TOPP_IDRipper_idparquet"
${TOPP_BIN_PATH}/IDRipper -test
-in ${TESTS_TEMP_DIR}/IDMerger_idparquet_output.tmp.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out
-split_ident_runs -numeric_filenames)
set_tests_properties("TOPP_IDRipper_idparquet" PROPERTIES DEPENDS "TOPP_IDMerger_idparquet")

add_test("TOPP_IDRipper_idparquet_convert_0"
${TOPP_BIN_PATH}/IDFileConverter
-in ${TESTS_TEMP_DIR}/IDRipper_idparquet_out/IDMerger_idparquet_output.tmp_0_0.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_0.tmp.idXML)
set_tests_properties("TOPP_IDRipper_idparquet_convert_0" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet")
add_test("TOPP_IDRipper_idparquet_diff_0"
${DIFF}
-in1 ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_0.tmp.idXML
-in2 ${DATA_DIR_TOPP}/IDRipper_idparquet_0.idXML
-whitelist "IdentificationRun date")
set_tests_properties("TOPP_IDRipper_idparquet_diff_0" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_convert_0")

add_test("TOPP_IDRipper_idparquet_convert_1"
${TOPP_BIN_PATH}/IDFileConverter
-in ${TESTS_TEMP_DIR}/IDRipper_idparquet_out/IDMerger_idparquet_output.tmp_1_1.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_1.tmp.idXML)
set_tests_properties("TOPP_IDRipper_idparquet_convert_1" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet")
add_test("TOPP_IDRipper_idparquet_diff_1"
${DIFF}
-in1 ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_1.tmp.idXML
-in2 ${DATA_DIR_TOPP}/IDRipper_idparquet_1.idXML
-whitelist "IdentificationRun date")
set_tests_properties("TOPP_IDRipper_idparquet_diff_1" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_convert_1")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clean the rip output directory before this test chain runs.

Line 195 creates ${TESTS_TEMP_DIR}/IDRipper_idparquet_out only at configure time. If an earlier ctest run left IDMerger_idparquet_output.tmp_0_0.idparquet or _1_1.idparquet behind, TOPP_IDRipper_idparquet_convert_0/1 can still read those stale files and mask a regression where the current TOPP_IDRipper_idparquet invocation stops emitting one of the expected outputs. A per-run cleanup/recreate step, or a fresh test-specific output directory, would make this coverage trustworthy.

🧹 One way to harden the test setup
-file(MAKE_DIRECTORY ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
+add_test("TOPP_IDRipper_idparquet_cleanup"
+  ${CMAKE_COMMAND} -E remove_directory ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
+add_test("TOPP_IDRipper_idparquet_mkdir"
+  ${CMAKE_COMMAND} -E make_directory ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
+set_tests_properties("TOPP_IDRipper_idparquet_mkdir" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_cleanup")
+
 add_test("TOPP_IDRipper_idparquet"
   ${TOPP_BIN_PATH}/IDRipper -test
     -in ${TESTS_TEMP_DIR}/IDMerger_idparquet_output.tmp.idparquet
     -out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out
     -split_ident_runs -numeric_filenames)
-set_tests_properties("TOPP_IDRipper_idparquet" PROPERTIES DEPENDS "TOPP_IDMerger_idparquet")
+set_tests_properties("TOPP_IDRipper_idparquet" PROPERTIES DEPENDS "TOPP_IDMerger_idparquet;TOPP_IDRipper_idparquet_mkdir")
📝 Committable suggestion

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

Suggested change
file(MAKE_DIRECTORY ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
add_test("TOPP_IDRipper_idparquet"
${TOPP_BIN_PATH}/IDRipper -test
-in ${TESTS_TEMP_DIR}/IDMerger_idparquet_output.tmp.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out
-split_ident_runs -numeric_filenames)
set_tests_properties("TOPP_IDRipper_idparquet" PROPERTIES DEPENDS "TOPP_IDMerger_idparquet")
add_test("TOPP_IDRipper_idparquet_convert_0"
${TOPP_BIN_PATH}/IDFileConverter
-in ${TESTS_TEMP_DIR}/IDRipper_idparquet_out/IDMerger_idparquet_output.tmp_0_0.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_0.tmp.idXML)
set_tests_properties("TOPP_IDRipper_idparquet_convert_0" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet")
add_test("TOPP_IDRipper_idparquet_diff_0"
${DIFF}
-in1 ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_0.tmp.idXML
-in2 ${DATA_DIR_TOPP}/IDRipper_idparquet_0.idXML
-whitelist "IdentificationRun date")
set_tests_properties("TOPP_IDRipper_idparquet_diff_0" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_convert_0")
add_test("TOPP_IDRipper_idparquet_convert_1"
${TOPP_BIN_PATH}/IDFileConverter
-in ${TESTS_TEMP_DIR}/IDRipper_idparquet_out/IDMerger_idparquet_output.tmp_1_1.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_1.tmp.idXML)
set_tests_properties("TOPP_IDRipper_idparquet_convert_1" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet")
add_test("TOPP_IDRipper_idparquet_diff_1"
${DIFF}
-in1 ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_1.tmp.idXML
-in2 ${DATA_DIR_TOPP}/IDRipper_idparquet_1.idXML
-whitelist "IdentificationRun date")
set_tests_properties("TOPP_IDRipper_idparquet_diff_1" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_convert_1")
add_test("TOPP_IDRipper_idparquet_cleanup"
${CMAKE_COMMAND} -E remove_directory ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
add_test("TOPP_IDRipper_idparquet_mkdir"
${CMAKE_COMMAND} -E make_directory ${TESTS_TEMP_DIR}/IDRipper_idparquet_out)
set_tests_properties("TOPP_IDRipper_idparquet_mkdir" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_cleanup")
add_test("TOPP_IDRipper_idparquet"
${TOPP_BIN_PATH}/IDRipper -test
-in ${TESTS_TEMP_DIR}/IDMerger_idparquet_output.tmp.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out
-split_ident_runs -numeric_filenames)
set_tests_properties("TOPP_IDRipper_idparquet" PROPERTIES DEPENDS "TOPP_IDMerger_idparquet;TOPP_IDRipper_idparquet_mkdir")
add_test("TOPP_IDRipper_idparquet_convert_0"
${TOPP_BIN_PATH}/IDFileConverter
-in ${TESTS_TEMP_DIR}/IDRipper_idparquet_out/IDMerger_idparquet_output.tmp_0_0.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_0.tmp.idXML)
set_tests_properties("TOPP_IDRipper_idparquet_convert_0" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet")
add_test("TOPP_IDRipper_idparquet_diff_0"
${DIFF}
-in1 ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_0.tmp.idXML
-in2 ${DATA_DIR_TOPP}/IDRipper_idparquet_0.idXML
-whitelist "IdentificationRun date")
set_tests_properties("TOPP_IDRipper_idparquet_diff_0" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_convert_0")
add_test("TOPP_IDRipper_idparquet_convert_1"
${TOPP_BIN_PATH}/IDFileConverter
-in ${TESTS_TEMP_DIR}/IDRipper_idparquet_out/IDMerger_idparquet_output.tmp_1_1.idparquet
-out ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_1.tmp.idXML)
set_tests_properties("TOPP_IDRipper_idparquet_convert_1" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet")
add_test("TOPP_IDRipper_idparquet_diff_1"
${DIFF}
-in1 ${TESTS_TEMP_DIR}/IDRipper_idparquet_out_1.tmp.idXML
-in2 ${DATA_DIR_TOPP}/IDRipper_idparquet_1.idXML
-whitelist "IdentificationRun date")
set_tests_properties("TOPP_IDRipper_idparquet_diff_1" PROPERTIES DEPENDS "TOPP_IDRipper_idparquet_convert_1")
🤖 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 195 - 225, The test output
directory ${TESTS_TEMP_DIR}/IDRipper_idparquet_out is only created at configure
time which allows stale files to persist between runs; before the
TOPP_IDRipper_idparquet test you should delete and recreate that directory at
test-run time (e.g. insert a file(REMOVE_RECURSE
${TESTS_TEMP_DIR}/IDRipper_idparquet_out) followed by file(MAKE_DIRECTORY
${TESTS_TEMP_DIR}/IDRipper_idparquet_out) or wrap those steps in a CTest
pre-test command) so that TOPP_IDRipper_idparquet, and downstream tests
TOPP_IDRipper_idparquet_convert_0/1 and their diffs, always run against a clean
output directory.

@timosachsenberg
timosachsenberg merged commit 51b5181 into OpenMS:develop Apr 29, 2026
10 of 11 checks passed
timosachsenberg pushed a commit that referenced this pull request Apr 30, 2026
Added entries for:
- Perf: BrukerTimsFile FrameAggregator boost::unordered_flat_map (#9243)
- Native .featureparquet and .consensusparquet formats (#9242)
- IsobaricWorkflow: .idparquet and .mzId input support (#9241)
- IDMerger: fix preserved input file order (#9240)
- PercolatorAdapter: fix in-process post-filter (#9240)
- IDRipper: .idparquet input/output support (#9237)
- ProteomicsLFQ: .idparquet and .mzId input support (#9236)
- FileTypes::FEATUREPARQUET, FileTypes::CONSENSUSPARQUET in Library section (#9242)

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
timosachsenberg added a commit that referenced this pull request Apr 30, 2026
Added entries for:
- IDRipper .idparquet input/output support (#9237)
- FEATUREPARQUET and CONSENSUSPARQUET file types (#9242)
- BrukerTimsFile FrameAggregator perf improvement with boost::unordered_flat_map (#9243)
- PercolatorAdapter: fix post-filters on in-process backend (#9240)
- IDMerger: fix input file order preservation (#9240)
- ProteomicsLFQ: .idparquet/.mzId input support (#9236)
- IsobaricWorkflow: .idparquet/.mzId input support (#9241)
- wnetalign/wnet/pylmcf FetchContent dependencies (#8992)
- OpenMS Library: FileTypes::FEATUREPARQUET/CONSENSUSPARQUET (#9242)
- OpenMS Library: FeatureGroupingAlgorithmWNet and WNetMatcher (#8992)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[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