monarch-initiative / biolink-api

API for linked biological knowledge
https://api.monarchinitiative.org/api/
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

gene_to_uniprot_from_mygene (mapping of HGNC issue) #358

Open lpalbou opened 4 years ago

lpalbou commented 4 years ago

We got a message this morning on the alliance helpdesk that the ribbon wasn't working for a new HGNC id: https://agr-jira.atlassian.net/browse/AGRHELP-74 (may require jira account to access)

I checked the biolink log and essentially there is no uniprot results for that new HGNC id: http://mygene.info/v3/query?q=HGNC:53833&fields=uniprot

As a counter example, we do have uniprot results for older HGNC: http://mygene.info/v3/query?q=HGNC:11998&fields=uniprot

Error log of https://github.com/geneontology/biolink-api/blob/master/biolink/api/entityset/endpoints/slimmer.py#L149:

results:  {'took': 2, 'total': 1, 'max_score': 13.838859, 'hits': [{'_id': '114483833', '_score': 13.838859}]}
hit:  {'_id': '114483833', '_score': 13.838859}
2020-07-22 09:47:10,636 - root - ERROR - An exception occurred: 'uniprot'
[2020-07-22 09:47:10,636] ERROR in app: Exception on /api/ontology/ribbon/ [GET]
Traceback (most recent call last):
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 325, in wrapper
    resp = resource(*args, **kwargs)
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/Users/albou/go-api/biolink-api/biolink/api/ontol/endpoints/ontology_endpoint.py", line 363, in get
    prots = gene_to_uniprot_from_mygene(s)
  File "/Users/albou/go-api/biolink-api/biolink/api/entityset/endpoints/slimmer.py", line 153, in gene_to_uniprot_from_mygene
    if 'Swiss-Prot' in hit['uniprot']:
KeyError: 'uniprot'
2020-07-22 09:47:10,636 - app - ERROR - Exception on /api/ontology/ribbon/ [GET]
Traceback (most recent call last):
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask_restplus/api.py", line 325, in wrapper
    resp = resource(*args, **kwargs)
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/albou/go-api/biolink-api/venv/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/Users/albou/go-api/biolink-api/biolink/api/ontol/endpoints/ontology_endpoint.py", line 363, in get
    prots = gene_to_uniprot_from_mygene(s)
  File "/Users/albou/go-api/biolink-api/biolink/api/entityset/endpoints/slimmer.py", line 153, in gene_to_uniprot_from_mygene
    if 'Swiss-Prot' in hit['uniprot']:
KeyError: 'uniprot'

Notes:

@deepakunni3 @cmungall

kshefchek commented 4 years ago

the code is still there but was refactored in https://github.com/biolink/biolink-api/commit/34be1d735d01ea7d11a91f578d363070c5bf7b30