Skip to content

Commit

Permalink
#3482 updated search to handle C_ for variants NC_ (#882)
Browse files Browse the repository at this point in the history
* #3482 updated search to handle C_ for variants NC_

* #3482 Fix User search for NC_ NR_ and NM_
  • Loading branch information
Bharath-kandula authored Aug 31, 2023
1 parent fb27d8b commit 997f1f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genes/hgvs/hgvs_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ def clean_hgvs(self, hgvs_string) -> Tuple[str, List[str]]:
cleaned_hgvs = clean_string(hgvs_string) # remove non-printable characters
cleaned_hgvs = cleaned_hgvs.replace(" ", "") # No whitespace in HGVS
cleaned_hgvs = cleaned_hgvs.replace("::", ":") # Fix double colon
if cleaned_hgvs[0:2].upper() == "M_":
cleaned_hgvs = "NM_" + cleaned_hgvs[2:]
if cleaned_hgvs[0:2].upper() in ("M_", "C_", "R_"):
cleaned_hgvs = "N" + cleaned_hgvs
# Lowercase mutation types, e.g. NM_032638:c.1126_1133DUP - won't matter if also changes gene name as that's
# case-insensitive
MUTATION_TYPES = ["ins", "del", "dup", "inv"] # Will also handle delins and del...ins
Expand Down
5 changes: 5 additions & 0 deletions genes/tests/test_clean_hgvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def test_clean_hgvs(self):
("nm_206933.3(USH2A):c.4298G>A", "NM_206933.3(USH2A):c.4298G>A"),
("m_206933.3(USH2A)::c.4298G>A", "NM_206933.3(USH2A):c.4298G>A"),
("m_206933.3(USH2A):c.4298G>A", "NM_206933.3(USH2A):c.4298G>A"),
("c_000007.13:g.117199563G>T", "NC_000007.13:g.117199563G>T"),
("c_000007.13::g.117199563G>T", "NC_000007.13:g.117199563G>T"),
("nc_000007.13:g.117199563G>T", "NC_000007.13:g.117199563G>T"),
("R_001566.1(TERC):n.427_428insC", "NR_001566.1(TERC):n.427_428insC"),
("r_001566.1(TERC)::n.427_428insC", "NR_001566.1(TERC):n.427_428insC"),
]

for input_hgvs, expected_result in test_cases:
Expand Down

0 comments on commit 997f1f7

Please sign in to comment.