Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 434: Add VCV IDs to evidence strings #444

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add VCV ID to parsers
  • Loading branch information
apriltuesday committed Oct 17, 2024
commit 2527db6d3554fe2e401a4c2c5b75b21ae7e4c60e
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