Skip to content

Commit

Permalink
Merge branch 'main' into python-312
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Jul 6, 2024
2 parents f68db43 + f30be1f commit 63f3644
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hgvs/extras/babelfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def __init__(self, hdp, assembly_name):
)
self.ac_to_name_map = make_ac_name_map(assembly_name)
self.name_to_ac_map = make_name_ac_map(assembly_name)
# We need to accept accessions as chromosome names, so add them pointing at themselves
self.name_to_ac_map.update({ac: ac for ac in self.name_to_ac_map.values()})

def hgvs_to_vcf(self, var_g):
"""**EXPERIMENTAL**
Expand Down
5 changes: 5 additions & 0 deletions tests/test_hgvs_extras_babelfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ def _v2h(*v):
hgvs_g = _v2h(*v)
hgvs_string = hgvs_g.format()
assert hgvs_string == expected_hgvs_string


def test_vcf_to_hgvs_contig_chrom(parser, babelfish38):
hgvs_g = babelfish38.vcf_to_g_hgvs("NC_000006.12", 49949409, "GAA", "G")
assert hgvs_g.format() == "NC_000006.12:g.49949413_49949414del"

0 comments on commit 63f3644

Please sign in to comment.