diff --git a/annotation/clinvar_xml_parser.py b/annotation/clinvar_xml_parser.py index 51a668519..ce81e48ed 100644 --- a/annotation/clinvar_xml_parser.py +++ b/annotation/clinvar_xml_parser.py @@ -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._(.+)?:c[.][0-9_a-zA-Z>]+)( .*)?$") + RE_GOOD_CHGVS = re.compile("^(N._(.+)?:c[.][^ ]+)( .*)?$") RE_ORPHA = re.compile("ORPHA([0-9]+)") @staticmethod diff --git a/annotation/clinvar_xml_parser_via_vcv.py b/annotation/clinvar_xml_parser_via_vcv.py index 089fab8e7..9a9ec6452 100644 --- a/annotation/clinvar_xml_parser_via_vcv.py +++ b/annotation/clinvar_xml_parser_via_vcv.py @@ -7,7 +7,7 @@ class ClinVarXmlParserViaVCV(ClinVarXmlParser): - PARSER_VERSION = 202 # change this whenever the parsing changes, so we know to ignore the old cache + PARSER_VERSION = 203 # change this whenever the parsing changes, so we know to ignore the old cache @classmethod def load_from_clinvar_id(cls, clinvar_variation_id: int) -> ClinVarXmlParserOutput: @@ -115,7 +115,8 @@ def parse_variant_coordinate(self, elem): start = elem.get("start") ref = elem.get("referenceAllele") alt = elem.get("alternateAllele") - self.latest.variant_coordinate = f"{chr}:{start} {ref}>{alt} ({assembly})" + if chr and start and ref and alt: + self.latest.variant_coordinate = f"{chr}:{start} {ref}>{alt} ({assembly})" @parser_path( diff --git a/annotation/templates/annotation/clinvar_records_detail.html b/annotation/templates/annotation/clinvar_records_detail.html index 9e8c8fa5b..40a30b7c3 100644 --- a/annotation/templates/annotation/clinvar_records_detail.html +++ b/annotation/templates/annotation/clinvar_records_detail.html @@ -37,7 +37,9 @@ {% for record in records %} - {% clinvar_stars record.stars record.review_status %} {{ record.submitter }} + {% clinvar_stars record.stars record.review_status %} {{ record.submitter }} +
{{ record.record_id }} + {% if record.c_hgvs %}{% c_hgvs record.c_hgvs %}{% elif record.variant_coordinate %}{{ record.variant_coordinate }}{% else %}-{% endif %} {{ record.clinical_significance | ekey:"clinical_significance" }} {% if record.condition %}{% ontology_term record.condition %}{% else %}-{% endif %}