Skip to content

Commit

Permalink
add to evidence and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apriltuesday committed Sep 18, 2024
1 parent 017fc32 commit afb1a34
Show file tree
Hide file tree
Showing 6 changed files with 1,090 additions and 1,086 deletions.
2 changes: 1 addition & 1 deletion cmat/clinvar_xml_io/clinvar_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def accession(self):
@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']
return find_mandatory_unique_element(self.record_xml, './MeasureSet').attrib.get('Acc', None)

@property
def last_updated_date(self):
Expand Down
1 change: 1 addition & 0 deletions cmat/output_generation/clinvar_to_evidence_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def generate_evidence_string(clinvar_record, allele_origins, disease_name, disea
'variantFunctionalConsequenceId': consequence_attributes.so_term.accession,
'variantId': clinvar_record.measure.vcf_full_coords, # CHROM_POS_REF_ALT notation.
'variantRsId': clinvar_record.measure.rs_id,
'variantIdFromSource': clinvar_record.vcv_id,

# PHENOTYPE ATTRIBUTES.
# The alphabetical list of *all* valid disease names from all traits from that ClinVar record, reported as a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"variantFunctionalConsequenceId": "SO_0001583",
"variantHgvsId": "NC_000014.9:g.67729209A>G",
"variantId": "14_67729209_A_G",
"variantIdFromSource": "VCV000002046",
"variantRsId": "rs28940313"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"variantFunctionalConsequenceId": "SO_0001583",
"variantHgvsId": "NC_000007.14:g.94423102G>A",
"variantId": "7_94423102_G_A",
"variantIdFromSource": "VCV000374196",
"variantRsId": "rs1057518967"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"variantFunctionalConsequenceId": "SO_0001583",
"variantHgvsId": "NC_000014.9:g.67729209A>G",
"variantId": "14_67729209_A_G",
"variantIdFromSource": "VCV000002046",
"variantRsId": "rs28940313"
}
Loading

0 comments on commit afb1a34

Please sign in to comment.