Repository navigation
[FIX] ProteomicsLFQ: merge coincident FFId features of positional isomers (fixes -out_qpx duplicate rows) - #10453
Conversation
…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]>
|
Warning Review limit reachedYou'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. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (7)
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. Comment |
|
we could have features with same RT, mz but different IM I think... depends how it is stored |
|
Yeah feel free to request changes. Not sure if this is the best way honestly. |
|
I guess it is fine |
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
…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
Description
Fixes
ProteomicsLFQ -out_qpxfailing 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)SPRPTAEKvsESKSSPRPT(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.
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.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.Tests.
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.test_FeatureOverlapFilter.py. pyOpenMS was not built locally, so CI validates it.TOPP_ProteomicsLFQ*tests pass locally with unchanged references (macOS arm64, Release).-feat_dir.Checklist