Fix CnvTranslator c to n#630
Merged
theferrit32 merged 2 commits intov3from Apr 21, 2026
Merged
Conversation
CnvTranslator._from_hgvs accepted CDS-relative (c.) HGVS expressions but
built SequenceLocation objects directly from sv.posedit.pos.{start,end}.base
without first converting to transcript-relative coordinates. That produced
locations whose start/end pointed into the 5' UTR of the named transcript
and therefore had wrong ga4gh:SL.* digests.
Mirror the AlleleTranslator path (HgvsTools.extract_allele_values) and
run c_to_n when sv.type == "c", after the existing intronic guard and the
refget_accession lookup.
Concrete example: NM_001331029.1:c.100_200del previously produced
start=99, end=200 (points into the UTR). After this fix it produces
start=249, end=350 (the correct transcript-relative positions).
Behavior change for any consumer that was passing c. HGVS to
CnvTranslator — their digests will change. The pre-fix digests were
objectively wrong so no correct consumer can have been relying on them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pins the c_to_n conversion in CnvTranslator by asserting NM_001331029.1:c.100_200del resolves to transcript positions 249-350 (not CDS-relative 99-200 which would land in the 5' UTR). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Close #629