Skip to content

Commit

Permalink
add VCV ID to parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
apriltuesday committed Oct 17, 2024
1 parent a9f8241 commit 2527db6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmat/clinvar_xml_io/clinvar_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ class ClinVarRecordMeasure:
MS_REPEAT_EXPANSION = 'repeat_expansion'
MS_NO_COMPLETE_COORDS = 'no_complete_coords'

def __init__(self, measure_xml, clinvar_record):
def __init__(self, measure_xml, clinvar_record, vcv_id):
self.measure_xml = measure_xml
self.clinvar_record = clinvar_record
self.vcv_id = vcv_id

@property
def all_names(self):
Expand Down
7 changes: 6 additions & 1 deletion cmat/clinvar_xml_io/clinvar_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, record_xml, xsd_version, trait_class=ClinVarTrait, measure_cl
if not variant_measure:
self.measure = None
else:
self.measure = measure_class(variant_measure, self)
self.measure = measure_class(variant_measure, self, self.vcv_id)

def __str__(self):
return f'ClinVarRecord object with accession {self.accession}'
Expand All @@ -60,6 +60,11 @@ def write(self, output):
def accession(self):
return find_mandatory_unique_element(self.record_xml, './ClinVarAccession').attrib['Acc']

@property
def vcv_id(self):
"""ClinVar's accession for a MeasureSet, present only in RCV records."""
return find_optional_unique_element(self.record_xml, './MeasureSet').attrib['Acc']

@property
def last_updated_date(self):
"""This tracks the latest update date, counting even minor technical updates.
Expand Down

0 comments on commit 2527db6

Please sign in to comment.