From e7f9567bb7f2dd390abfdd6ae72478655b0ecb64 Mon Sep 17 00:00:00 2001 From: Brendan ODonnell Date: Wed, 20 Dec 2023 11:29:19 -0500 Subject: [PATCH] Fix tests --- src/hgvs/utils/altseqbuilder.py | 6 +++--- tests/test_hgvs_assemblymapper.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hgvs/utils/altseqbuilder.py b/src/hgvs/utils/altseqbuilder.py index 679c7d5d..e3f42fe2 100644 --- a/src/hgvs/utils/altseqbuilder.py +++ b/src/hgvs/utils/altseqbuilder.py @@ -342,10 +342,10 @@ def _setup_incorporate(self): if pos.base < 0: # 5' UTR result = cds_start - 1 else: # cds/intron - if pos.offset <= 0: - result = (cds_start - 1) + pos.base + pos.offset - 1 + if pos.offset < 0: + result = (cds_start - 1) + pos.base - 2 else: - result = (cds_start - 1) + pos.base + result = (cds_start - 1) + pos.base - 1 elif pos.datum == Datum.CDS_END: # 3' UTR result = cds_stop + pos.base - 1 else: diff --git a/tests/test_hgvs_assemblymapper.py b/tests/test_hgvs_assemblymapper.py index 55bb24dd..25953bf3 100644 --- a/tests/test_hgvs_assemblymapper.py +++ b/tests/test_hgvs_assemblymapper.py @@ -228,7 +228,7 @@ def test_map_of_dup_intron_exon_boundary_rc(self): def test_map_of_dup_exon_intron_boundary(self): hgvs_c = "NM_024529.4:c.131+1_131+3dup" - hgvs_p = "NP_078805.3:p.(Gly44_Thr45insVal)" + hgvs_p = "NP_078805.3:p.(Thr45Ter)" var_c = self.hp.parse_hgvs_variant(hgvs_c) var_p = self.am.c_to_p(var_c) @@ -237,7 +237,7 @@ def test_map_of_dup_exon_intron_boundary(self): def test_map_of_dup_exon_intron_boundary_rc(self): hgvs_c = "NM_004985.4:c.111+1_111+4dup" - hgvs_p = "NP_004976.2:p.(Asp38GlyfsTer11)" + hgvs_p = "NP_004976.2:p.(Asp38ValfsTer11)" var_c = self.hp.parse_hgvs_variant(hgvs_c) var_p = self.am.c_to_p(var_c)