Skip to content

UniPEFF: write isoform-scoped features to their isoform entries - #10340

Merged
timosachsenberg merged 2 commits into
developfrom
claude/awesome-dirac-o71cqc
Sep 29, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
claude/awesome-dirac-o71cqc

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

Description

Follow-up to #9966 and #10266. A UniProt feature whose <location sequence="..."> names an isoform carries that isoform's coordinates. #10266 stopped applying such features to the canonical entry, and since #9966 the isoform is usually written as an entry of its own, so these features now go to that entry:

  • prepareEntry() reconstructs the isoforms first, then sends each feature to the canonical entry (no location/@sequence, or the "displayed" isoform) or to the entry of the isoform it names. Features of isoforms that aren't written (external, not described, not reconstructable, -omit_isoforms) are still skipped and counted.
  • Isoform annotations go through the same steps as canonical ones, against the isoform sequence: half-cystine merge, disulfide range check, and Option B ids or default-mode disulfide labels. writeAnnotationTags(), split out of writePeffEntry(), writes them for both kinds of entry. An isoform entry with ids also sets HasAnnotationIdentifiers.
  • The summary now has two lines: features written to isoform entries, and features not applied because their isoform isn't written.

Example from the new fixture: P55555-2 is the 30-residue canonical sequence with A10 replaced by ASCHSK. UniProt's phosphoserine at S11, disulfide bond C12–C30 and variant R33Q on that isoform now appear on its entry:

>sp:P55555-2 \PName=(Isoform 2 of Isoform feature test protein) ... \Length=35 \ID=ISOF_HUMAN \ModResPsi=(11|MOD:00046|O-phospho-L-serine)(0:12|MOD:00798|half cystine)(1:30|MOD:00798|half cystine) \VariantSimple=(33|Q) \DisulfideBond=(2:0,1)

A second commit removes the unused isEmpty() helper and two unused UniProtXMLHandler fields, which clang flagged (-Wunused-function, -Wunused-private-field).

Tests

  • New fixture UniPEFF_5_input_isoform_features.xml, run by TOPP_UniPEFF_15 (default), _16 (-annotation_identifiers), _17 (-omit_isoforms) and two summary checks. It covers features on a written isoform, on the displayed isoform (stays canonical), on an external and on an unreconstructable isoform (not applied), and a sequence conflict (never written, not counted). The expected outputs were written by hand; the tool's output matches them byte for byte.
  • TOPP_UniPEFF_12_summary keeps its counts (5 features, 2 entries) under the new wording. No other expected output changes, since no other fixture has scoped features on a written isoform.

Local validation

On 3c9621c (develop ef94635 plus this PR), Debug build with clang 18.1.3 (Ubuntu 24.04, Ninja) against Ubuntu packages and Arrow/Parquet from Apache's apt repository:

  • ctest -R 'UniPEFF|UniProtXML': 40 passed, 0 failed (the 32 existing UniPEFF tests plus the 8 new ones). No compiler warnings in the UniPEFF sources.
  • Human UniProtKB/Swiss-Prot (20,431 entries): all 1,228 isoform-scoped features (442 entries) land on their isoform entries at the positions UniProt gives, checked against an independent Python reconstruction. Of the 1,022 with a residue check, 1,020 fit the isoform, 738 of them only the isoform. Canonical entries, isoform sequences and the -omit_isoforms output are byte-identical to before.
  • Not run locally: the rest of the test suite (the change is confined to the UniPEFF tool) and other platforms; CI covers those.

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 (not needed: UniPEFF is a tool without bindings)

🤖 Generated with Claude Code

https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX


Generated by Claude Code

…elds

clang warned about all three (-Wunused-function, -Wunused-private-field):
isEmpty() in UniProtXMLHandler.cpp and UniProtXMLHandler's
gene_name_is_primary_ / organism_name_is_scientific_ had no users. Removing
isEmpty() also puts the UTF-16 conversion comment back above xmlchToString(),
the function it describes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX
A UniProt feature whose <location sequence="..."> names an isoform carries
that isoform's coordinates. #10266 stopped applying such features to the
canonical entry; since #9966 the isoform is usually written as an entry of
its own, so the features now go there:

- prepareEntry() reconstructs the isoforms first and routes each feature to
  the canonical entry (no location/@sequence, or the "displayed" isoform) or
  to the entry of the isoform it names. Features of isoforms that are not
  written (external, not described, not reconstructable, -omit_isoforms) are
  still skipped and counted.
- Isoform annotations go through the same steps as canonical ones against the
  isoform sequence: half-cystine merge, disulfide range check, and Option B
  ids or default-mode disulfide labels. writeAnnotationTags(), split out of
  writePeffEntry(), writes them for both kinds of entry. An isoform entry
  with ids also sets HasAnnotationIdentifiers.
- The summary reports the features written to isoform entries and those not
  applied.

New TOPP_UniPEFF_15/_16/_17 (default, -annotation_identifiers,
-omit_isoforms) and two summary checks run on
UniPEFF_5_input_isoform_features.xml; the expected outputs were written by
hand. TOPP_UniPEFF_12_summary keeps its counts under the new wording.

On human Swiss-Prot, all 1,228 such features (442 entries) land on their
isoform entries at the positions UniProt gives. Canonical entries, isoform
sequences and the -omit_isoforms output are byte-identical to before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 6 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9aa13239-e2d7-415d-b6ad-68e9123ae3b4

📥 Commits

Reviewing files that changed from the base of the PR and between ef94635 and 3c9621c.

📒 Files selected for processing (9)
  • CHANGELOG
  • src/tests/topp/CMakeLists.txt
  • src/tests/topp/UniPEFF_5_input_isoform_features.xml
  • src/tests/topp/UniPEFF_5_output_A.peff
  • src/tests/topp/UniPEFF_5_output_B.peff
  • src/tests/topp/UniPEFF_5_output_omitiso.peff
  • src/topp/UniPEFF/UniPEFF.cpp
  • src/topp/UniPEFF/include/UniProtXMLHandler.h
  • src/topp/UniPEFF/source/UniProtXMLHandler.cpp

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
timosachsenberg merged commit c42f6ac into develop Sep 29, 2026
35 checks passed
@timosachsenberg
timosachsenberg deleted the claude/awesome-dirac-o71cqc branch September 29, 2026 15:40
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