Skip to content

Commit

Permalink
Fixing issue with phenotype name in Clinvar (#689)
Browse files Browse the repository at this point in the history
Related-Issue: #689
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Sep 20, 2022
1 parent 6022778 commit 559f561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Expand Up @@ -20,6 +20,7 @@ End-User Summary
- Fixing ClinVar export editor timing issues (#667, #668).
- Fixing hemizygous count display in fold-outs (#646).
- Fixing clinvar submission sex/gender update (#686).
- Fixing issue with phenotype name in Clinvar (#689).

Full Change List
================
Expand All @@ -37,6 +38,7 @@ Full Change List
- Fixing ClinVar export editor timing issues (#667, #668).
- Fixing hemizygous count display in fold-outs (#646).
- Fixing clinvar submission sex/gender update (#686).
- Fixing issue with phenotype name in Clinvar (#689).

-----------------
v1.2.2 (anthenea)
Expand Down
18 changes: 2 additions & 16 deletions clinvar_export/clinvar_xml.py
Expand Up @@ -195,18 +195,6 @@ def build_citation(self, citation):
return self.em("Invalid-Citation", citation)

def build_phenotype_trait_set(self, submission_individual):
def build_xref(term_id):
if term_id.startswith("HP:"):
self.em("XRef", **{"db": "HP", "id": term_id,}),
elif term_id.startswith("OMIM:") or term_id.startswith("MIM:"):
self.em("XRef", **{"db": "OMIM", "id": ("MIM:%s" % term_id.split(":", 1)[1]),}),
elif term_id.startswith("ORPHA:"):
self.em(
"XRef", **{"db": "Orphanet", "id": ("ORPHA:%s" % term_id.split(":", 1)[1]),}
),
else:
return self.em("Invalid-XRef", term_id)

if not submission_individual.phenotypes:
return []
else:
Expand All @@ -218,10 +206,8 @@ def build_xref(term_id):
self.em(
"Trait",
self.em("TraitType", "Finding", **{"val_type": "name"}),
self.em(
"Name",
self.em("ElementValueType", "Preferred", **{"val_type": "name"}),
self.em("ElementValue", phenotype["term_name"]),
ET.Comment(
" %s - %s " % (phenotype["term_id"], phenotype["term_name"],)
),
self.em("XRef", **{"db": "HP", "id": phenotype["term_id"],},),
**{"ClinicalFeaturesAffectedStatus": "present",},
Expand Down

0 comments on commit 559f561

Please sign in to comment.