Repository navigation
UniPEFF: do not apply isoform-scoped features to the canonical entry - #10266
Merged
Merged
Conversation
A UniProtKB feature with <location sequence="P56181-2"> carries coordinates of that isoform, not of the entry's canonical sequence (uniprot.xsd, locationType). The XML handler ignored <location>, and prepareEntry() classified every feature onto the canonical entry, so isoform coordinates were written as canonical PEFF annotations: on human Swiss-Prot, e.g. sp:O00139 got \ModResPsi=(556|MOD:00046|...) although canonical residue 556 is D, and 40 ModRes/VariantSimple positions in 14 entries lay past the end of the sequence. UniProtFeature gains location_sequence (location/@sequence). prepareEntry() skips features that set it (per-feature OPENMS_LOG_DEBUG), and the run ends with one summary log line counting them. Tests: UniProtXMLFile_test checks the parsed attribute and its absence; new TOPP_UniPEFF_12 mixes isoform-scoped modified residues and sequence variants with canonical ones. Existing goldens are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vtf85tr3QGsMbs53Zz11FB
- The summary line counted every feature with <location sequence="...">, including types UniPEFF never writes (human Swiss-Prot: 1,839 features in 756 entries, e.g. 437 sequence conflicts). It now counts only features that would otherwise have become annotations of the canonical entry (1,228 in 442 entries). New test TOPP_UniPEFF_12_summary checks the count; the fixture gains an isoform-scoped sequence conflict that must not be counted. - Drop the claim that -debug 1 shows per-feature details: TOPP tools currently print no OPENMS_LOG_DEBUG output. - Move UniProtFeature::location_sequence next to the other location fields, away from the lines #9966 changes, so the two branches merge cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX
timosachsenberg
commented
Sep 28, 2026
timosachsenberg
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed the current head. The parser retains location/@sequence, and prepareEntry() filters these features before merging half-cystines or assigning annotation IDs. The mixed canonical/isoform fixture covers the important output behavior, and the summary test excludes feature types that UniPEFF would never emit. The current Build and Test and wheel workflows pass.
I found no blocking issue in this PR. It would be useful to merge this before #9966 so that isoform expansion starts from corrected canonical annotations; moving the filtered annotations onto reconstructed isoforms can remain a separate follow-up.
5 tasks done
timosachsenberg
pushed a commit
that referenced
this pull request
Sep 28, 2026
Brings in #10266 (isoform-scoped features are no longer applied to the canonical entry), so isoform expansion now builds on the corrected canonical annotations. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX
timosachsenberg
pushed a commit
that referenced
this pull request
Sep 28, 2026
With #10266, some UniProt feature coordinates refer to another isoform (<location sequence="...">), so "UniProt feature coordinates refer to the canonical sequence only" no longer holds. State both actual reasons in the tool documentation and at writeIsoformPeffEntry(): canonical coordinates are not mapped onto the spliced sequence, and features annotated on an isoform are not applied to its entry either. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX
timosachsenberg
pushed a commit
that referenced
this pull request
Sep 28, 2026
Brings in #10266 (isoform-scoped UniProt features are no longer applied to the canonical entry). Conflict in src/topp/UniPEFF/UniPEFF.cpp at the writePeffEntry() call: keep develop's isoform_scoped_tracker.add() and this branch's writePeffEntry() signature, which no longer takes option_b. TOPP_UniPEFF_12 (new on develop) runs in default mode on an entry with a canonical 6-18 disulfide bond, so its expected output UniPEFF_4_output_location_sequence.peff gains the half-cystine labels (0:6|...)(1:18|...), \DisulfideBond=(2:0,1) and "# HasAnnotationIdentifiers=true" in the sp block header. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0154SXArrtJiK1yY4Qxfc371
4 of 5 tasks
timosachsenberg
added a commit
that referenced
this pull request
Sep 29, 2026
) * UniPEFF: report UniProt isoforms as additional PEFF entries (#9830) UniProtKB XML defines alternative products (isoforms) via the <comment type="alternative products"> subtree plus <feature type="splice variant"> records; the sequences themselves are not stored and must be reconstructed from the canonical sequence. UniPEFF previously skipped all of this. Parser (UniProtXMLFile/UniProtXMLHandler): - new UniProtIsoform POD (first <id>, first <name>, sequence type, space-separated VSP refs) harvested from the alternative-products comment instead of skipping the subtree - UniProtFeature gains the feature/@id attribute so isoform refs can be resolved UniPEFF: - every "described" isoform is reconstructed by applying its referenced splice variants to the canonical sequence: a range without <variation> is deleted, one with <variation> is substituted; features are applied C- to N-terminal so coordinates never shift. The rules reproduce UniProt's official isoform FASTA sequences byte-exactly for all 18 described isoforms of P02768 and P15692 (the issue's examples) - reconstructed isoforms are emitted directly after their parent entry with a UniProt-FASTA-style descriptor (\PName=(Isoform N of X), inherited GName/NcbiTaxId/TaxName/ID, no per-isoform SV/EV/PE) and are counted in the per-prefix "# NumberOfEntries=" - "displayed" (= canonical), "external" and "not described" isoforms are skipped with a log message; dangling refs, invalid/overlapping ranges and <original> mismatches are validated and skipped with a warning - new -omit_isoforms flag restores the previous (upstream C#) output byte-exactly Tests: - UniProtXMLFile class test covers isoform + feature-id parsing - new TOPP fixture UniPEFF_3_input_isoforms.xml exercises deletion, replacement, single-position extension, multi-VSP application and every skip path; golden hand-derived and cross-checked - existing goldens gain the P12345-2 isoform entry (fixture's VSP range corrected from 56-62 to 55-61 to match its <original>VYEVVLR) - TOPP_UniPEFF_10 (-omit_isoforms) pins the pre-expansion output Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HJemySJ9eeY5nyq37NHJfR * Address review: TEST_TRUE for boolean asserts, '\n' over std::endl in new logs Applies the two CodeRabbit nitpicks on the isoform change, per AGENTS.md coding guidelines: the two new has_range assertions use TEST_TRUE, and the four log statements added for isoform reconstruction end with '\n' instead of std::endl. Pre-existing statements elsewhere in the files are untouched. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HJemySJ9eeY5nyq37NHJfR * UniPEFF: summarize isoforms without a sequence, refresh stale comments Isoforms typed "external" (stored as their own UniProt entry) or "not described" no longer produce one INFO line each (282 for human Swiss-Prot). They are counted per sequence type and reported once after the run, e.g. "282 isoform(s) without a reconstructable sequence were not emitted (232 'external', 50 'not described')"; the per-isoform line is kept at debug level. Reconstruction failures still warn per isoform. Also update comments that still described the pre-isoform behaviour: the alternative-products gate in UniProtXMLHandler no longer skips the whole subtree, UniProtFeature::original/variation also hold splice variants, and the isoform fixture's skipped isoforms are not each logged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX * UniPEFF docs: why isoform entries carry no annotations, after #10266 With #10266, some UniProt feature coordinates refer to another isoform (<location sequence="...">), so "UniProt feature coordinates refer to the canonical sequence only" no longer holds. State both actual reasons in the tool documentation and at writeIsoformPeffEntry(): canonical coordinates are not mapped onto the spliced sequence, and features annotated on an isoform are not applied to its entry either. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX --------- Co-authored-by: Claude <[email protected]>
timosachsenberg
pushed a commit
that referenced
this pull request
Sep 29, 2026
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
5 tasks done
timosachsenberg
added a commit
that referenced
this pull request
Sep 29, 2026
* UniPEFF: remove the unused isEmpty() helper and two unused handler fields 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 * UniPEFF: write isoform-scoped features to their isoform entries 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 --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
UniPEFF wrote UniProt features annotated on a different isoform as annotations of the canonical entry, so their coordinates landed on the wrong residues.
In UniProtKB XML such features carry
<location sequence="P56181-2">. According touniprot.xsd(locationType), the attribute is "only used when the location is not on the canonical sequence displayed in the current entry". UniPEFF ignored it.Example from human Swiss-Prot:
sp:O00139got\ModResPsi=(556|MOD:00046|O-phospho-L-serine), but canonical residue 556 is D. The serine is in isoform O00139-4.Change
UniProtFeature::location_sequencestoreslocation/@sequence.prepareEntry()no longer applies features that set it to the canonical entry.Effect on human Swiss-Prot (20,431 entries)
\ModResPsion a residue that is not S/T/Y: 427 → 2. The remaining two use a different UniProt convention and are not isoform-scoped (e.g. O75478 "Phosphoserine; in variant Ser-6").\ModRes*/\VariantSimplepositions past the sequence end: 40 → 0. The 20 "out of bounds; omitted" warnings the writer printed for such variants are gone.Tests
UniProtXMLFile_testchecks the parsed attribute and its absence.TOPP_UniPEFF_12mixes isoform-scoped and canonical modified residues and sequence variants.TOPP_UniPEFF_12_summarychecks the summary count; its fixture includes an isoform-scoped sequence conflict that must not be counted.Related
git merge-tree).OPENMS_LOG_DEBUGoutput even with-debug. That is a separate framework issue, so the docs don't point to it.Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI builds🤖 Generated with Claude Code
https://claude.ai/code/session_015br53P8rFQMnErUa4SiMSX
Generated by Claude Code
Summary by CodeRabbit