Repository navigation
Description
Details About Your Environment
Operating System and Hardware
macOS; the indexing issue is platform-independent. Hardware: N/A.
OpenMS Version
Source inspected on develop at cfdc95a6163f41145d619e412d9742d5557afe8b and PR #10745 at 0b485609213cf290213560205ac0e5ad4e571440. Runtime merger reproduction used installed OpenMS 3.7.0-pre-disabled-20261021 (Oct 21, 2026).
Installation Method
Other: source inspection plus an existing local OpenMS installation. No full build or end-to-end execution of the PR was performed.
Describe the Bug
Bug Description
ProSE must assign merge indices by input occurrence, not by path. Supplying the same -in path twice is supported: TOPP_ProSE_7_merged explicitly searches the same mzML twice and requests two per-file outputs plus a merged output. Rejecting duplicate inputs is therefore not a compatible fix.
This was identified while reviewing #10745 and is tracked separately because the underlying pooling/indexing defect is outside that PR's changed lines. The PR's new splitMergedPsms() exposes the defect in the per-file outputs when pooled protein FDR is applied.
Cause and impact
IDMergerAlgorithmdeduplicates primary MS run paths viafile_origin_to_idx_.emplace(...), and assigns each peptide identification'sid_merge_indexby looking up its path. Two occurrences of the same path consequently receive the same index.- ProSE's
poolSearchedFiles_()assumes those indices enumerate pooled input occurrences. Its correction for skipped/failed inputs does not recover occurrence identity after path deduplication. Replacing the merged run's paths with the full input list does not repair the peptide indices. - In [FIX] ProSE: FDR:protein switches between final results and intermediates; outputs agree; full parameter names; run-view counts; c/z test #10745,
splitMergedPsms()trustsid_merge_indexas a position inresult.per_file. With two identical inputs, every surviving pooled PSM is moved to entry 0; entry 1 receives no PSMs. The indices are valid integers, so validation succeeds rather than taking the fallback. The TOPP caller invokes this split after-out_mergedwhenmerged.protein_fdr_appliedis true.
For [A, A], the expected merged indices include both 0 and 1, each identifying its own input occurrence. Currently all are 0. For [A, A, B], subsequent distinct inputs can also be associated with the wrong occurrence.
Validated reproduction of the indexing defect
From the repository root, using an existing IDMerger executable:
IDMerger \
-in src/tests/topp/newIDMergerTest1.idXML src/tests/topp/newIDMergerTest1.idXML \
-out /tmp/duplicate-input-merged.idXML \
-merge_proteins_add_PSMs -testObserved using the installed executable:
Input peptide IDs per occurrence: 2
Merged peptide IDs: 4
Merge indices: [0, 0, 0, 0]
Split counts by input position: [4, 0]; expected [2, 2]
FAIL: duplicate input occurrences collapse to index 0
The final split counts above are computed from the actual merged indices using the PR splitter's routing rule; they are not output from an end-to-end ProSE run of the PR. The PR's splitter and caller were checked directly in source.
Relevant source
- IDMergerAlgorithm path deduplication and index assignment.
- ProSE pooling and skipped-input remapping.
- PR #10745 splitter.
- Supported duplicate-input integration test. Its assertions cover the merged FileInfo summary, not occurrence indices or both per-file outputs, so this defect can pass unnoticed.
Expected resolution / regression coverage
- Preserve input-occurrence identity throughout ProSE pooling, merged output, and splitting; retain the real paths, including duplicates, in their original order.
- Cover both the prebuilt aggregate and direct-pooling paths (
build_pooled_aggregateenabled/disabled). - Add regression coverage for
[A, A]and[A, A, B], including skipped/failed input positions. Verify exact indices and that each occurrence receives only its own surviving PSMs after splitting. - Extend the existing duplicate-input TOPP test to inspect both per-file outputs as well as the merged output.
- Avoid changing IDMerger's general path-deduplication contract without assessing other callers; the necessary behavior is occurrence-based indexing for ProSE.
Severity: Major — incorrect provenance in merged results and incorrect/empty per-file outputs in the PR's pooled-protein-FDR split workflow.
Activity
coderabbitai commentedon Oct 27, 2026
🔗 Related PRs
#10745 - [FIX] ProSE: outputs agree with -out_merged; full parameter names in refusals; run-view spectrum counts; c/z annotation test [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
jpfeuffer commentedon Oct 27, 2026
Policy clarification following maintainer discussion: prefer rejecting duplicate input files rather than introducing occurrence-based merge semantics solely to support accidental repeated inputs. This supersedes the original report’s assertion that duplicates must remain supported: TOPP_ProSE_7_merged uses a duplicate as a test convenience, not proof of an intended public contract.
Proposed scope:
Important distinction for IDMergerAlgorithm: two DISTINCT identification files can legitimately reference the SAME primary MS run (for example, results from different searches of the same spectra). A shared primary MS run path is therefore not sufficient evidence of a duplicate input identification file. Preserve intentional same-run merging and its path-based provenance; do not globally forbid repeated primary MS run paths in the algorithm. It receives identification objects rather than CLI input filenames, so duplicate-file validation belongs at the file-loading boundary.
The observed data-integrity defect remains real, but early rejection of repeated physical inputs is the preferred resolution instead of supporting them as separate occurrences.
timosachsenberg commentedon Oct 28, 2026
I agree that the stronger contract is better. We should reject and adapt the tests
martand-codes commentedon Nov 18, 2026
Hi @jpfeuffer and @timosachsenberg,
I'd love to take this one on if it's still available!
The updated scope in the thread is very clear:
IDMergerAlgorithm's internal path deduplication intact.TOPP_ProSE_7_mergedto use two distinct fixtures and add explicit rejection tests.Let me know if I'm good to start drafting a fix on
develop!timosachsenberg commentedon Nov 18, 2026
Closing: the defect reported here is fixed on develop.
id_merge_indexper input position instead of per run path (poolSearchedFiles_(), now insrc/openms/source/ANALYSIS/ID/PROSE/ProSEPooling.cpp). An input given twice is two inputs, andsplitMergedPsms()gives each occurrence its own share of the pooled result.ProSEAlgorithm_testcovers this: an input given twice through search →mergeFileResults→splitMergedPsms, and the split with both inputs of one path.Not done, and not part of this issue any more: the alternative discussed above of rejecting a file given twice in ProSE and in the IDMerger CLI. On develop ProSE only refuses repeated input stems together with
-out_qpx/-out_parquet, and IDMerger still accepts the same file twice and duplicates its PSMs. If we want that stricter contract, it should get a new issue with that scope, as title and description here describe the index defect.@martand-codes thanks for the offer. There is nothing left to pick up under this issue.
Generated by Claude Code