-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0107f0c
commit a7870e6
Showing
6 changed files
with
58 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import logging | ||
from functools import cached_property | ||
|
||
from cmat.clinvar_xml_io.clinical_classification import ClinicalClassification | ||
|
||
from cmat.clinvar_xml_io.clinvar_record import ClinVarRecord | ||
from cmat.clinvar_xml_io.xml_parsing import find_mandatory_unique_element, find_elements | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.INFO) | ||
|
||
|
||
class ClinVarReferenceRecord(ClinVarRecord): | ||
"""Reference records (RCVs) summarise information from submitted records (SCVs) and include additional annotations | ||
and cross-references supplied by ClinVar.""" | ||
|
||
def __init__(self, record_xml, xsd_version): | ||
super().__init__(record_xml, xsd_version) | ||
|
||
def __str__(self): | ||
return f'ClinVarReferenceRecord object with accession {self.accession}' | ||
|
||
@property | ||
def last_updated_date(self): | ||
return self.record_xml.attrib['DateLastUpdated'] | ||
|
||
@property | ||
def created_date(self): | ||
return self.record_xml.attrib['DateCreated'] | ||
|
||
@cached_property | ||
def clinical_classifications(self): | ||
clinical_classifications = [] | ||
if self.xsd_version < 2: | ||
# V1 only ever has a single clinical classification / clinical significance | ||
clinical_classifications.append( | ||
ClinicalClassification(find_mandatory_unique_element(self.record_xml, './ClinicalSignificance'), self)) | ||
else: | ||
for clin_class in find_elements(self.record_xml, './Classifications/*'): | ||
clinical_classifications.append(ClinicalClassification(clin_class, self)) | ||
return clinical_classifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3087,4 +3087,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters