Skip to content

[FIX] ProteomicsLFQ: merge coincident FFId features of positional isomers (fixes -out_qpx duplicate rows) - #10453

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
jpfeuffer:jpfeuffer-fix-proteomicslfq-qpx-duplicate-features
Oct 8, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
jpfeuffer:jpfeuffer-fix-proteomicslfq-qpx-duplicate-features

Conversation

@jpfeuffer

Copy link
Copy Markdown
Contributor

Description

Fixes ProteomicsLFQ -out_qpx failing with exit 5 (ConsensusMapArrowExport: refusing invalid QPX feature table ... repeats the QPX feature identity 'feature_id' ... peptidoform ''), reported by bigbio/quantms on PXD007058 phospho HCD/EThcD data with ProSE IDs.

Root cause. FeatureFinderIdentification builds one target per peptidoform and sets the feature m/z to the target's theoretical m/z. ProSE localizes a phosphosite (or deamidation) differently in the HCD and EThcD scans of the same precursor (e.g. scans 1910/1911, precursor 1905: ESKS(Phospho)SPRPTAEK vs ESKSSPRPT(Phospho)AEK). The two positional-isomer targets share m/z and RT, so FFId extracts the same signal twice and reports two features with the same charge, RT, m/z and (mostly) intensity. Both copies were quantified and linked. When the PSM FDR filter later removed the copies' hits, they became indistinguishable unidentified consensus features with the same QPX primary key (peptidoform '', charge, run, rt, observed_mz), which the validator correctly rejects. Comet + Percolator rarely give two peptidoforms for one precursor, so the problem showed up with ProSE IDs. Some copies differed in m/z only by floating-point noise (1e-13 to 3e-8 Th, e.g. different summation order or rounded modification mass deltas).

Fix.

  • New FeatureOverlapFilter::mergeCoincidentFeatures(FeatureMap&) collapses features with equal charge whose RT and m/z agree within a relative tolerance of 1e-8 (0.01 ppm, far below instrument resolution). The most intense feature is kept (the first one on ties), the peptide identifications of all of them are moved onto it, survivor order is preserved, and the function returns the number of features removed.
  • ProteomicsLFQ calls it per run right before IDConflictResolverAlgorithm::resolve, which then keeps the best identification and moves the others to the unassigned PSMs (so they still count for inference and spectral counting). Merges are logged at INFO level.
  • The duplicate signal is no longer counted twice. No distinct signal is dropped, and the QPX validator is unchanged.

Tests.

  • Class test FeatureOverlapFilter_test: merging, kept identifications, highest intensity kept, ties, order, no merge for other charge or RT or a 0.08 ppm m/z difference, and floating-point-noise m/z.
  • pyOpenMS binding plus test_FeatureOverlapFilter.py. pyOpenMS was not built locally, so CI validates it.
  • All 92 TOPP_ProteomicsLFQ* tests pass locally with unchanged references (macOS arm64, Release).
  • Real repro (2 PXD007058 runs, ProSE+Percolator idXML, biosaur2 seeding, targeted_only): before, exit 5 with 19–21 duplicate rows; after, exit 0 with valid QPX feature/psm/pg parquet. 13+13 features were merged and no duplicate coordinates remain in the consensusXML. Also passes with psmFDR 0.10 and 0.50 and with -feat_dir.

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.)

…mers

FeatureFinderIdentification builds one target per peptidoform. Positional
isomers (e.g. a phosphosite localized differently in the HCD and EThcD scans
of one precursor, as ProSE reports them) have the same m/z and RT, so the same
signal was extracted, quantified and linked once per isomer. Copies whose
identifications were removed by the PSM FDR filter became identical
unidentified consensus features, and the QPX feature export refused them as
duplicate feature_id / primary key rows (-out_qpx exit 5).

New FeatureOverlapFilter::mergeCoincidentFeatures collapses features with the
same charge, RT and m/z (relative tolerance 1e-8, i.e. floating-point noise)
into the most intense one, keeping all peptide identifications. ProteomicsLFQ
calls it per run before IDConflictResolverAlgorithm, which then picks the best
identification and moves the others to the unassigned PSMs. Exposed in
pyOpenMS; class and Python tests added.

Co-authored-by: Copilot App <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba3c3767-b663-45d0-a0aa-3afce5044ec8
📥 Commits

Reviewing files that changed from the base of the PR and between 03703a7 and fe1b3f2.

📒 Files selected for processing (7)
  • CHANGELOG
  • src/openms/include/OpenMS/PROCESSING/FEATURE/FeatureOverlapFilter.h
  • src/openms/source/PROCESSING/FEATURE/FeatureOverlapFilter.cpp
  • src/pyOpenMS/bindings/bind_processing.cpp
  • src/pyOpenMS/tests/unittests/test_FeatureOverlapFilter.py
  • src/tests/class_tests/openms/source/FeatureOverlapFilter_test.cpp
  • src/topp/ProteomicsLFQ.cpp
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@timosachsenberg

Copy link
Copy Markdown
Contributor

we could have features with same RT, mz but different IM I think... depends how it is stored

@jpfeuffer

Copy link
Copy Markdown
Contributor Author

Yeah feel free to request changes. Not sure if this is the best way honestly.
Maybe we should even note down the positional uncertainty and combine the features somehow. But also then spectrum generation wont really work.

@timosachsenberg

Copy link
Copy Markdown
Contributor

I guess it is fine

@timosachsenberg
timosachsenberg merged commit 41c0efd into OpenMS:develop Oct 8, 2026
32 checks passed
timosachsenberg pushed a commit that referenced this pull request Oct 8, 2026
Brings in #10448, #10453, #10449 (ProSE -rescore), #10429, #10463, #10455 and
#10452. #10429 is the same PeptideIndexing change this branch carried from
#10403, so the files merged identically; its duplicate CHANGELOG entry is
dropped. The CHANGELOG conflict keeps both sides.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UQCiwdbPoEkrebED8VQ2TJ
timosachsenberg pushed a commit that referenced this pull request Oct 13, 2026
…ow) into the branch

Brings in refactor/identificationdata-value-model at 102fa59: develop up to
dac9590 and the cherry-picked model commits, which this branch already had.
Conflicts keep this branch's later edits (adapter helpers, query order, molecule
key, model functions and their tests) together with the PR's own changes (the
missing-run message of ProteinRunReferences, DigestedOligo::addEvidence). The
format writers run develop's run check on their peptide-identification view.

Ports of develop changes to code that this branch moved to identification data:
- #10445 (keep_matching with only hitless identifications): the resolution on
  identification data keeps all identifications of a feature when none has a
  match, instead of keeping one and making the others unassigned. Develop's
  test gets the protein run that every identification needs here.
- #10453 (FeatureOverlapFilter::mergeCoincidentFeatures, used by ProteomicsLFQ
  on maps with identification data): the links of merged features move to the
  kept feature, so their identifications do not become unassigned; removal
  goes through FeatureMap::eraseFeatures(). New test section.
- PeptideAndProteinQuant_test: develop's dotted-file-name section adds the
  search run, as the other sections do.
- IDConflictResolver_3_output.consensusXML: develop's file with this branch's
  order of the unassigned identifications (the same 17-line move as before; a
  permutation of develop's file, checked line by line).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
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.

2 participants