diff --git a/HISTORY.rst b/HISTORY.rst index dd344e4bd..c6d856bfd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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 ================ @@ -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) diff --git a/clinvar_export/clinvar_xml.py b/clinvar_export/clinvar_xml.py index 183356095..d91e049a2 100644 --- a/clinvar_export/clinvar_xml.py +++ b/clinvar_export/clinvar_xml.py @@ -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: @@ -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",},