Skip to content

Release: PeptideAtlas count fix and the #428 review fixes - #434

Merged
enriquea merged 6 commits into
mainfrom
dev
Oct 7, 2026
Merged

enriquea merged 6 commits into
mainfrom
dev

Conversation

@enriquea

@enriquea enriquea commented Oct 7, 2026

Copy link
Copy Markdown
Member

Releases dev to main. main is already an ancestor of dev, so this merges without conflicts.

What's in it

#430: PeptideAtlas site counts (#425)

parse_peptideatlas_zip added each peptide's total count once for every phospho form. A site is now credited with each form's own count.

  • On build 606, total observations fall from 7.57 billion to 92.5 million, and 91% of sites change.
  • The plugin version moves to 0.1.1.
  • Rebuild any peptideatlas:phospho table built before this release. Delete the cached parsed TSV first, or pass --overwrite.

#431: brings #428 onto dev

#428 was merged into main directly. #431 merges main back into dev and reconciles #428's PeptideAtlas column checks with #430's counting.

#433: fixes from the post-merge review of #428

  • AlphaGenome. The duplicate-row check no longer collects duplicated keys to the driver; it ran out of memory on a file given twice. On the real 16.6M-row shard the check takes about 4.5 s, and a doubled input fails in about a minute.
  • COSMIC CGC. A header must match one known generation in full, cosmic-cgc-v2 or cosmic-cgc-legacy-v1. A gene catalog that resolves no symbol now raises. The plugin version moves to 0.2.0.
  • pQTL. A symbol is resolved through previous symbols, then aliases, and only when exactly one gene lists it. The build fails when no symbol maps. The plugin version moves to 0.1.1.
  • PeptideAtlas. The ProForma mass window no longer accepts sulfation. A lookup for peptide_instance.tsv can no longer return the modified table.
  • Core. build_parameters is stored as a JSON copy when the provenance is stamped.
  • CHANGELOG. Entries for Harden release follow-ups across data builders and plugin contracts #428 and for these fixes.

Checks

  • Each PR was reviewed and tested on its own, and CI on dev (e80b464) is green.
  • Real data:
    • the PeptideAtlas counts on build 606;
    • COSMIC header detection on the real v103 export;
    • AlphaGenome timings on the real shard.

Open follow-ups: #432, #426, #420, #419, #416.

…430)

* fix(peptideatlas): count each phospho form's own observations (#425)

parse_peptideatlas_zip added the parent peptide_instance.n_observations,
which also covers the unmodified and every other form of the peptide,
once per phospho-modified form, instead of each form's own
modified_peptide_instance.n_observations. On the real build 202512/606
that inflated 237,428 of 259,932 sites (82x in total, median 16x per
site; Spearman 0.82 against the corrected counts).

- Step 4 sums each form's own count; step 2 keeps only the peptide
  instance ids. A phospho form without an integer count fails the parse.
- Fixture: peptide_instance 209, seen 100 times, in two phospho forms
  (12 and 8 observations) at P04637 S42. The old rule gives 200, the new
  one 20; the snapshot pins 20 and the round trip expects six sites.
- test_phospho.py: the mocks give each form its own count (equal to the
  parent's, so expected values hold); two regression tests cover the
  two-form sum and a form without a count.
- SKILL.md, the fixture README and the CHANGELOG describe the rule.

* docs(changelog): this fix is #430

* fix(peptideatlas): address the #430 review

- Read a form's count only when it maps to a kept protein: a phospho form
  of a peptide that maps only to decoy or non-canonical proteins adds
  nothing and may lack a count.
- Fixture: peptide 209 gets its own peptide_id (1009) and its unmodified
  form (80 observations), so its forms sum to the peptide's 100 as in
  real builds; a rule summing every form would give 100, not 20.
- Tests: _two_form_zip adds the unmodified form; a parametrized test pins
  that unmodified forms and forms of unkept peptides are not checked.
- Rebuilding: hvantk download returns an existing parsed TSV unchanged,
  so CHANGELOG and SKILL.md say to delete it or pass --overwrite. The
  plugin version moves to 0.1.1 so provenance tells the builds apart.
- Real build 606: every peptide's form counts sum to its own count; the
  508,098 repeated peptide_mapping keys involve only dropped proteins, so
  no site is counted twice through them (documented in SKILL.md).
#428 was merged into main directly, so dev did not have it. Both branches had
changed the PeptideAtlas parser: #428 hardened it on main, and #430 changed its
counting rule on dev. They conflicted in
hvantk/skills/peptideatlas/phospho/shared/datasets.py, in step 2.

Resolution: keep #430's set of peptide_instance ids, since counts now come from
each modified form. Keep #428's required-column check, applied to the one
column step 2 still reads (peptide_instance_id). #428 also required
peptide_instance.n_observations; that requirement is dropped, because the
parser no longer reads that column.
Since #430, the parser counts each phospho form's own
modified_peptide_instance.n_observations. #428's required-column checks were
written against the old rule, and #430's tests predate those checks.

- modified_peptide_instance must have an n_observations column. If the column
  is renamed, the parse now fails up front with "missing required column",
  instead of failing on the first contributing row.
- test_parse_rejects_missing_required_columns now renames that column instead
  of peptide_instance.n_observations, which the parser no longer reads.
- _two_form_zip's biosequence table gets biosequence_gene_name, which #428 made
  required. Without it, every #430 regression test failed on the column check.
- The empty-canonical-table test gets n_observations in its
  modified_peptide_instance table, so its other tables stay valid, as its
  comment says.

Every required column is present in the real build 606 tables.
Fixes the findings of the post-merge review of #428 in AlphaGenome, COSMIC CGC, pQTL, PeptideAtlas and core, and adds the CHANGELOG entries #428 lacked. Deferred items are tracked in #432.
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b382463-b4a1-4631-8713-4f0bc236b92b
  • 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.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 22 high · 4 medium · 38 minor

Alerts:
⚠ 64 issues (≤ 0 issues of at least minor severity)

Results:
64 new issues

Category Results
Documentation 38 minor
Security 22 high
Complexity 4 medium

View in Codacy

🟢 Metrics 59 complexity

Metric Results
Complexity 59

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Docs only: the pQTL examples pass the HGNC lookup table as hgnc_ht, the CHANGELOG entries for #428-#433 are corrected and tidied, and the contributor pages describe schema_ids and the round-trip test rule.
@enriquea
enriquea merged commit 540811d into main Oct 7, 2026
18 of 19 checks passed
@enriquea enriquea mentioned this pull request Oct 7, 2026
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.

1 participant