Skip to content

Commit

Permalink
#1455 gives OMIM gene nodes HGNC gene symbol for a name
Browse files Browse the repository at this point in the history
  • Loading branch information
ecwood committed May 15, 2021
1 parent 9f0c6e4 commit 85c62af
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion code/kg2/multi_ont_to_json_kg.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def make_nodes_dict_from_ontologies_list(ontology_info_list: list,
curie_to_uri_expander: callable,
select_datatype_properties: dict) -> Dict[str, dict]: # temporary addition for Ontobio Issue #507
ret_dict = dict()
omim_to_hgnc_symbol = dict()
ontologies_iris_to_curies = dict()

tuis_not_in_mappings_but_in_kg2 = set()
Expand Down Expand Up @@ -834,12 +835,25 @@ def biolink_depth_getter(category: str):
# There isn't a 2 anymore
if mimtype == "1" or mimtype == "4":
node_category_label = kg2_util.BIOLINK_CATEGORY_GENE
gene_symbol = omim_to_hgnc_symbol.get(node_curie_id, None)
if gene_symbol is not None:
old_name = node_name
node_name = gene_symbol
else:
node_name += " related phenotypic feature"
else:
node_category_label = kg2_util.BIOLINK_CATEGORY_NAMED_THING
if filename == 'umls-hgnc.ttl':
locus_group = select_datatype_properties[filename].get(node_curie_id, {}).get('LOCUS_GROUP', None)
hgnc_properties = select_datatype_properties[filename].get(node_curie_id, {})
omim_id = hgnc_properties.get('OMIM_ID', None)
gene_symbol = hgnc_properties.get('GENESYMBOL', None)
if omim_id is not None:
if isinstance(omim_id, list):
for id in omim_id:
omim_to_hgnc_symbol[kg2_util.CURIE_PREFIX_OMIM + ':' + id] = gene_symbol
else:
omim_to_hgnc_symbol[kg2_util.CURIE_PREFIX_OMIM + ':' + omim_id] = gene_symbol
locus_group = hgnc_properties.get('LOCUS_GROUP', None)
if locus_group is not None:
if locus_group == "phenotype":
continue
Expand Down

0 comments on commit 85c62af

Please sign in to comment.