Skip to content

Remove duplicate Comet score metavalues in PepXMLFile parser - #9089

Merged
timosachsenberg merged 1 commit into
developfrom
copilot/fix-comet-scores-duplicated
Jul 8, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
copilot/fix-comet-scores-duplicated

Conversation

Copilot AI commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

PepXMLFile::startElement stored several Comet scores twice at parse time — once under the canonical MS: CV accession (or the canonical COMET:-prefixed key) and again under a redundant, differently-cased duplicate key holding the identical value.

Changes

PepXMLFile.cpp — remove the six duplicate metavalues that are never read anywhere in the codebase:

removed (redundant) canonical key kept
COMET:xcorr MS:1002252
COMET:spscore MS:1002255
COMET:sprank MS:1002256
COMET:deltacnstar MS:1002254
Comet:lnrSp COMET:lnRankSP
Comet:IonFrac COMET:IonFrac

COMET:deltaCn is intentionally kept. Unlike the six above, it is consumed by PercolatorFeatureSetHelper::addCOMETFeatures as a scored Percolator feature. That helper only recomputes deltaCn ((xcorr - 2nd_xcorr)/max(1, xcorr)) when the key is absent, so removing it here would silently switch Percolator's deltaCn feature from Comet's authoritative reported value to an OpenMS approximation — changing rescoring/FDR. This cleanup is intended to be behavior-preserving, so the key stays. (This corrects the earlier revision of this PR, which removed COMET:deltaCn and broke PercolatorFeatureSetHelper_test — that test's comet.topperc_check.idXML deltaCn values are Percolator recomputations, not parser duplicates, and must not be deleted.)

Test reference idXML files — drop the now-absent duplicate UserParam entries from CometAdapter_[1-4,6]_out.idXML, Chy_test.idXML, and IDFileConverter_24_output.idXML. COMET:deltaCn is preserved throughout; comet.topperc_check.idXML is unchanged.

Verification

  • PepXMLFile_test, PercolatorFeatureSetHelper_test — pass
  • TOPP_IDFileConverter_24 (+ diff) — pass end-to-end
  • TOPP_CometAdapter_1 — freshly generated output has an identical UserParam key structure to the updated reference (residual numeric diffs locally are only the local comet 2023.01 vs reference 2025.01 version mismatch)

Rebased onto current develop (was 521 commits behind; the old Arrow-23 CMake pin no longer configured against system Arrow 24).

Copilot AI linked an issue Apr 6, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix duplicated comet scores issue Remove duplicate Comet score metavalues in PepXMLFile parser Apr 6, 2026
Copilot AI requested a review from jpfeuffer April 6, 2026 10:16

Copy link
Copy Markdown
Contributor

Adversarial review result: no blocking issue found. The PepXML changes remove duplicate Comet metadata while preserving the remaining score annotations used by the tests.

I did not find source-comment tracker references. No build/tests run locally.

PepXMLFile::startElement stored several Comet scores twice at parse time:
once under the canonical MS CV accession (or the canonical COMET:-prefixed
key) and again under a redundant, differently-cased duplicate key with the
identical value. Remove the six duplicates that are never read anywhere:

  COMET:xcorr       (dup of MS:1002252)
  COMET:spscore     (dup of MS:1002255)
  COMET:sprank      (dup of MS:1002256)
  COMET:deltacnstar (dup of MS:1002254)
  Comet:lnrSp       (dup of COMET:lnRankSP)
  Comet:IonFrac     (dup of COMET:IonFrac)

COMET:deltaCn is intentionally kept: unlike the six above, it is consumed by
PercolatorFeatureSetHelper::addCOMETFeatures as a scored feature. That helper
only recomputes deltaCn ((xcorr - 2nd_xcorr)/max(1, xcorr)) when the key is
absent, so dropping it here would silently switch Percolator's deltaCn feature
from Comet's authoritative reported value to an OpenMS approximation, changing
rescoring/FDR. This cleanup is intended to be behavior-preserving, so the key
stays.

Update the reference idXML files (CometAdapter_[1-4,6]_out, Chy_test,
IDFileConverter_24_output) to drop the six now-absent duplicate UserParam
entries; COMET:deltaCn is preserved throughout.

Co-Authored-By: Claude Fable 5 <[email protected]>
@timosachsenberg
timosachsenberg force-pushed the copilot/fix-comet-scores-duplicated branch from 6f94cf4 to a25ebdb Compare July 8, 2026 15:16
@timosachsenberg
timosachsenberg marked this pull request as ready for review July 8, 2026 15:19
@timosachsenberg
timosachsenberg merged commit 36ee712 into develop Jul 8, 2026
42 checks passed
@timosachsenberg
timosachsenberg deleted the copilot/fix-comet-scores-duplicated branch July 8, 2026 19:52
timosachsenberg added a commit that referenced this pull request Jul 10, 2026
Adds entries for PRs merged in the last couple of days that were missing
changelog coverage: the TOPPView precursor-highlighting feature (#9715),
the Xerces-C++ PRIVATE-linkage/XMLHandler API change (#9712, which also
supersedes a stale note left by the LibSVM PRIVATE-linkage entry), the
FragmentMassError variance fix (#9618), the PepXMLFile duplicate Comet
metavalue fix (#9089), and the clang/OpenMP and TextExporter USI
documentation additions (#9162, #9173).

Co-authored-by: Claude <[email protected]>
@jonasscheid jonasscheid mentioned this pull request Oct 13, 2026
4 tasks done
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.

Comet scores duplicated

3 participants