Repository navigation
fix(mapper): p.? for an inversion past the transcript - #336
Conversation
An inversion that ends after the last base of the transcript was cut at the end of the transcript, so its protein came from bases other than the inverted ones. These bases are unknown, so c_to_p now gives p.?, as for the other edits that end there.
As in biocommons/hgvs and Mutalyzer, p. compares the proteins. A longer protein whose change starts at the stop codon is an extension, one whose change starts in front of it a delins, not a frameshift, as the reading frame stays. A stop codon in place of the old one keeps the residue change, and one in front of it gives a nonsense variant.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Inversion ambiguity and protein consequence tests src/mapper/altseq.rs, src/mapper/variant.rs, DIFFERENCES.md |
incorporate_inv marks inversions extending beyond the transcript as ambiguous. Tests cover protein consequences for in-frame stop-codon changes and inversions beyond or ending at the transcript boundary. The documentation describes the p.? outcome when replacement bases are unknown. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- varfish-org/hgvs-rs#320: Changes
AltSeqBuilderbounds handling and inversion setup errors, which is directly related to transcript-end inversion handling.
Suggested reviewers: hoeze
Merge Risk: 
Minimal · up to 9caf9
-
The change returns an unknown protein consequence when an inversion requires unavailable transcript bases, while preserving exact-boundary behavior. No actionable merge-blocking risk was identified; normal test validation remains necessary.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · 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.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #336 +/- ##
==========================================
+ Coverage 91.30% 91.34% +0.04%
==========================================
Files 20 20
Lines 13904 13975 +71
==========================================
+ Hits 12695 12766 +71
Misses 1209 1209
🚀 New features to boost your workflow:
|
An inversion that ends after the last base of the transcript sequence was cut at that end, so
c_to_pbuilt its protein from other bases than the inverted ones. These bases are unknown, so it now givesp.?, as for the other edits that end there. E.g. APOA1c.305_*5561invgavep.(Glu102_Gln267delins...CysTer). biocommons/hgvs cuts the inversion as hgvs-rs did, so DIFFERENCES.md lists it.New tests also pin the descriptions of in-frame changes of the stop codon, which stay as they are, as in biocommons/hgvs and Mutalyzer. A longer protein whose change starts at the stop codon is an extension, and one whose change starts in front of it is a delins, e.g.
p.(Lys9delinsAsnGlnAla), not a frameshift, as the reading frame stays. A stop codon in place of the old one keeps the residue change, and one in front of it gives a nonsense variant.Details
On a transcript that ends at c.*14, biocommons/hgvs 1.5.7 rejects
c.26_*20delas out of bounds, but cutsc.26_*20invand givesp.(Lys9_Ter10delinsArgGlyProLeuSerLeuXaa), the same as forc.26_*14inv. hgvs-rs 4.0.0 gave the same. Nowc.26_*20invgivesp.?, andc.26_*14inv, whose bases are all known, keeps its description. HGVS givesp.?for a deletion of the last exons of DMD because "it is not known what sequences ... are added to the transcript".For the ClinVar variant
NC_000011.10:g.116830247_116836307inv, Mutalyzer givesNM_000039.3:c.305_*5561invand no protein ("Variant affects one or more splice sites"). VariantValidator describes it on the genome only.The pinned descriptions agree with Mutalyzer on ClinVar variants, e.g.
NM_001005242.3(PKP2):c.2511_2513delinsATTgivesp.(Asp837delinsGluLeuGlyLys).A known gap stays: if the inserted sequence of a delins brings a stop codon in front of the old one, HGVS describes a "deletion-insertion of this sequence, not ... a deletion-insertion removing the entire C-terminal amino acid sequence". hgvs-rs, biocommons/hgvs and Mutalyzer give the latter, e.g.
NM_023067.4(FOXL2):c.673_*315inv(376 to 264 amino acids) givesp.(Ala225_Leu376delins...ArgArgThr).On a ClinVar subset, mehari 0.48.0 with this branch changes only this APOA1 inversion, on 29 transcripts and in both modes: p. becomes
p.?, and with the unknown protein mehari dropsstop_gained,stop_lostandprotein_altering_variant, keeping the 3' UTR term.fix(mapper): p.? for an inversion past the transcript
test(mapper): pin p. of in-frame stop codon changes
Summary by CodeRabbit
Bug Fixes
p.?when the sequence beyond the transcript is unknown, rather than implying a specific outcome.Documentation