Skip to content

Commit

Permalink
ClinVarRecord Fix c.HGVS parsing with new method (if it contains gene…
Browse files Browse the repository at this point in the history
… symbol)
  • Loading branch information
TheMadBug committed Sep 1, 2023
1 parent d6f7f35 commit 2e56142
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion annotation/clinvar_xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ClinVarXmlParserOutput:
class ClinVarXmlParser(XmlParser, ABC):

RE_DATE_EXTRACTOR = re.compile("([0-9]+-[0-9]+-[0-9]+).*")
RE_GOOD_CHGVS = re.compile("^(N._[0-9]+[.][0-9]+:c[.][0-9_a-zA-Z>]+)( .*)?$")
RE_GOOD_CHGVS = re.compile("^(N._(.+)?:c[.][0-9_a-zA-Z>]+)( .*)?$")
RE_ORPHA = re.compile("ORPHA([0-9]+)")

@staticmethod
Expand Down
11 changes: 11 additions & 0 deletions annotation/clinvar_xml_parser_via_vcv.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ def parse_c_hgvs(self, elem):
if hgvs := elem.text:
self.latest.c_hgvs = ClinVarXmlParser.parse_hgvs(hgvs)

@parser_path(
"SimpleAllele",
"HGVSlist",
"HGVS",
"Expression")
def parse_hgvs_2(self, elem):
if not self.latest.c_hgvs:
if text := elem.text:
if text.startswith("NM_"):
self.latest.c_hgvs = text

@parser_path(
"SimpleAllele",
"Location",
Expand Down

0 comments on commit 2e56142

Please sign in to comment.