You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CnvTranslator: c. HGVS inputs should be converted to n. before building SequenceLocation #629
CnvTranslator: c. HGVS inputs should be converted to n. before building SequenceLocation
Summary
CnvTranslator._from_hgvs currently builds a SequenceLocation directly from sv.posedit.pos.{start,end}.base for any supported HGVS input, including CDS-relative (c.) expressions. Per the VRS 2.0 specification, SequenceLocation.start/end are indices into the sequence identified by refgetAccession in that sequence's native frame — so when the refget accession points at a transcript (e.g. NM_*), the coordinates need to be transcript-relative (n.), not CDS-relative.
The Sequence Location class refers to coordinates on a SequenceReference; if that sequence represents a coding transcript, then the coordinates refer to the coding transcript, and not a chromosome sequence to which it aligns.
AlleleTranslator's extract_allele_values already handles this with a c_to_n step in HgvsTools. CnvTranslator does not, so a c. CNV input yields a SequenceLocation whose coordinates land in the 5' UTR instead of the intended CDS region — and whose ga4gh:SL.* digest differs from the correct value.
Example
For NM_001331029.1:c.100_200del (CDS positions 100–200 of a transcript with a 150-base 5' UTR):
Mirror the Allele path: after the existing is_intronic guard and derive_refget_accession lookup, run c_to_n when sv.type == "c". Regression test added using NM_001331029.1:c.100_200del against the expected transcript-relative output.
All existing g. CNV tests are unaffected (sv.type != "c", so the new branch doesn't fire). Consumers passing c. HGVS to CnvTranslator will see their output SequenceLocation coordinates and digests update to the transcript-relative values required by the spec.
Activity
Fix CnvTranslator c to n (#630)
theferrit32 commentedon Apr 22, 2026
Closed by #630