Skip to content

Commit

Permalink
#3481 updated codeQL version to v2 and #3482 Fix user searches for va…
Browse files Browse the repository at this point in the history
…riants where the N is accidentally ommitted from NM_
  • Loading branch information
Bharath-kandula committed Jul 31, 2023
1 parent 5136c66 commit 014e339
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion genes/hgvs/hgvs_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,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
cleaned_hgvs = "N" + cleaned_hgvs if cleaned_hgvs.startswith("M_") else cleaned_hgvs # Fix M_ prefix
if cleaned_hgvs.startswith("M_") or cleaned_hgvs.startswith("m_"):
cleaned_hgvs = "NM_" + cleaned_hgvs[2:]
# 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
6 changes: 5 additions & 1 deletion genes/tests/test_clean_hgvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ def test_clean_hgvs(self):
test_cases = [
("M_206933.3(USH2A):c.4298G>A", "NM_206933.3(USH2A):c.4298G>A"),
("NM_206933.3(USH2A)::c.4298G>A", "NM_206933.3(USH2A):c.4298G>A"),
("M_206933.3USH2A):c.4298G>A", "NM_206933.3USH2A:c.4298G>A")
("M_206933.3USH2A):c.4298G>A", "NM_206933.3USH2A:c.4298G>A"),
("m_206933.3USH2A):c.4298G>A", "NM_206933.3USH2A:c.4298G>A"),
("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"),
]

for input_hgvs, expected_result in test_cases:
Expand Down

0 comments on commit 014e339

Please sign in to comment.