Skip to content

Commit

Permalink
Interaction participants identifier bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarinllao committed Oct 4, 2018
1 parent 8eeb548 commit 672cb95
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/pathme/wikipathways/rdf_sparql.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
?uri_id rdf:type ?uri_type .
?uri_id wp:participants ?participants_entry .
optional {?participants_entry dcterms:identifier ?participants_id .}
optional {?participants_entry dcterms:bdbEntrezGene ?ncbigene_participants .}
optional {?participants_entry wp:bdbEntrezGene ?ncbigene_participants .}
}
"""

Expand All @@ -100,8 +100,8 @@
?uri_id wp:target ?target_entry .
optional {?source_entry dcterms:identifier ?dc_source .}
optional {?target_entry dcterms:identifier ?dc_target .}
optional {?source_entry dcterms:bdbEntrezGene ?ncbigene_source .}
optional {?target_entry dcterms:bdbEntrezGene ?ncbigene_target .}
optional {?source_entry wp:bdbEntrezGene ?ncbigene_source .}
optional {?target_entry wp:bdbEntrezGene ?ncbigene_target .}
}
"""

Expand Down
13 changes: 11 additions & 2 deletions src/pathme/wikipathways/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ def get_valid_gene_identifier(node_ids_dict, hgnc_manager):
return _validate_query(hgnc_manager, hgnc_entry, ensembl_id, ENSEMBL)

elif 'ec-code' in node_ids_dict['uri_id']:
ec_number = node_ids_dict['name']
ec_number = check_multiple(node_ids_dict['name'], 'ec-code')
return EXPASY, ec_number, ec_number

# Only wikipathways identifier is given
elif 'bdb_wikidata' in node_ids_dict:
name = node_ids_dict['name']
name = check_multiple(node_ids_dict['name'], 'wikidata')

# Find out whether the name is a valid HGNC symbol
hgnc_entry = hgnc_manager.get_gene_by_hgnc_symbol(name)
Expand All @@ -130,6 +130,15 @@ def get_valid_gene_identifier(node_ids_dict, hgnc_manager):
log.warning('Adding WikiPathways node %s (%s)', name, WIKIPATHWAYS)
return WIKIPATHWAYS, name, name

elif 'wikipedia' in node_ids_dict['uri_id']:
wiki_name = check_multiple(node_ids_dict['identifier'], 'wikipedia_id')
wiki_id = check_multiple(node_ids_dict['name'], 'wikipedia_name')
return 'WIKIPEDIA', wiki_name, wiki_id

elif 'identifier' and 'namespace' in node_ids_dict:
node_id_dict = {'bdb_'+node_ids_dict['namespace']: node_ids_dict['identifier']}
return get_valid_gene_identifier(node_id_dict, hgnc_manager)

raise Exception('Unknown identifier for node %s', node_ids_dict)


Expand Down

0 comments on commit 672cb95

Please sign in to comment.