Skip to content

FeatureFinderIdentification summary statistics print a wrapped 'additional external' peptide count #9999

Closed

Description

@timosachsenberg

Description

FeatureFinderIdentificationAlgorithm::statistics_ prints a nonsensical peptide count when there are no external identifications. Real log line from a ProteomicsLFQ run:

Summary statistics (counting distinct peptides including PTMs):
364 peptides identified (364 internal, 13088582122078209 additional external)
288 peptides with features (288 internal, 0 external)
76 peptides without features (76 internal, 1 external)

364 identified of which 364 internal leaves 0 external, not 1.3e16. The "1 external" on the last line is equally wrong.

Cause

n_external_peps_ is a Size (unsigned) computed by subtraction (src/openms/source/FEATUREFINDER/FeatureFinderIdentificationAlgorithm.cpp:1050):

n_internal_peps_ = internal_seqs.size();
n_external_peps_ = peptide_map_.size() - internal_seqs.size();

internal_seqs and peptide_map_ are not counting the same thing, so internal_seqs.size() can exceed peptide_map_.size() and the unsigned subtraction wraps. The same pattern appears at line 804. The value is then printed directly (line 1092) and also used for n_missing_external (line 1087), which is why the "peptides without features" line is off too.

Expected behaviour

Compute the count as a signed difference, or derive it as a set difference rather than a size subtraction, so it cannot wrap. Reporting-only — no quantification result depends on it.

Reproduction

Any ProteomicsLFQ / FeatureFinderIdentification run without external identifications, e.g.

ProteomicsLFQ -in run.mzML -ids run.idXML -out_cxml out.consensusXML \
  -proteinFDR 1.0 -psmFDR 1.0 -targeted_only true

Observed on develop @ 5fb1c20 while investigating #9992.

Activity

  1. added
    minor
    on Aug 29, 2026
  2. timosachsenberg commented on Aug 30, 2026

    @timosachsenberg
    ContributorAuthor

    Re-checked on current develop: the reported symptom is no longer reachable, and this can be closed as fixed by #9995.

    The 13088582122078209 came from n_external_peps_ = peptide_map_.size() - internal_seqs.size(), where the two sides counted different things. #9995 removed that line along with FeatureFinderIdentification external peptide ID path. What remains in statistics_ is n_peptides_ - quantified.size(), and every quantified sequence is by construction a key of peptide_map_, so it cannot wrap.

    #10012 carries a guard on the remaining subtraction plus a boundary test, but I would describe that as hardening rather than a fix for this issue — the test has to force inconsistent counters through a subclass, because the state does not arise naturally. Attributing the fix here to #9995 is the accurate record.

    Leaving the close to a maintainer since the hardening commit still references this number.

  3. timosachsenberg commented on Aug 30, 2026

    @timosachsenberg
    ContributorAuthor

    The hardening commit and its boundary test are now merged in #10012 (5dcd8f4cc1), so nothing here is outstanding in code.

    Attribution stands as in my previous comment: the wrapped value originally reported came from a subtraction #9995 deleted, so this is accurately "fixed by #9995" with #10012 adding a guard against the class of bug. Closing on that basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectminor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions