diff --git a/src/hgvs/utils/altseqbuilder.py b/src/hgvs/utils/altseqbuilder.py index 8ae433b9..2d5c474a 100644 --- a/src/hgvs/utils/altseqbuilder.py +++ b/src/hgvs/utils/altseqbuilder.py @@ -186,7 +186,7 @@ def _get_variant_region(self): ): result = self.T_UTR elif ( - self._var_c.posedit.edit.type == "dup" + self._var_c.posedit.edit.type in ["dup", "ins"] and self._var_c.posedit.pos.end.datum == Datum.CDS_END ): result = self.T_UTR diff --git a/tests/data/cache-py3.hdp b/tests/data/cache-py3.hdp index ff1c19d2..ba089408 100644 Binary files a/tests/data/cache-py3.hdp and b/tests/data/cache-py3.hdp differ diff --git a/tests/test_hgvs_variantmapper.py b/tests/test_hgvs_variantmapper.py index 72d9408b..0c003ea5 100644 --- a/tests/test_hgvs_variantmapper.py +++ b/tests/test_hgvs_variantmapper.py @@ -118,6 +118,12 @@ def test_map_of_c_out_of_reference_bound(self): with pytest.raises(HGVSError, match="coordinate is out of bounds"): self.vm.c_to_p(var_c) + def test_map_of_ins_three_prime_utr(self): + hgvs_c = "NM_004985.4:c.567_*1insCCC" + var_c = self.hp.parse_hgvs_variant(hgvs_c) + var_p = self.vm.c_to_p(var_c) + self.assertEqual(str(var_p), "NP_004976.2:p.?") + def test_map_of_dup_three_prime_utr(self): hgvs_c = "NM_153223.3:c.2959_*1dup" var_c = self.hp.parse_hgvs_variant(hgvs_c) diff --git a/tests/test_hgvs_variantmapper_cp_sanity.py b/tests/test_hgvs_variantmapper_cp_sanity.py index 4cc09ca5..e186f744 100644 --- a/tests/test_hgvs_variantmapper_cp_sanity.py +++ b/tests/test_hgvs_variantmapper_cp_sanity.py @@ -159,11 +159,16 @@ def test_five_prime_utr(self): hgvsp_expected = "MOCK:p.?" self._run_conversion(hgvsc, hgvsp_expected) - def test_three_prime_utr(self): + def test_sub_three_prime_utr(self): hgvsc = "NM_999999.1:c.*3G>A" hgvsp_expected = "MOCK:p.?" self._run_conversion(hgvsc, hgvsp_expected) + def test_ins_three_prime_utr(self): + hgvsc = "NM_999999.1:c.39_*1insA" + hgvsp_expected = "MOCK:p.?" + self._run_conversion(hgvsc, hgvsp_expected) + def test_dup_three_prime_utr(self): hgvsc = "NM_999999.1:c.12_*1dup" hgvsp_expected = "MOCK:p.?"