biothings / mygene.py

mygene is an easy-to-use Python wrapper to access MyGene.Info services.
Other
82 stars 13 forks source link

querymany unexpectedly failing to find gene symbol #23

Closed arudhir closed 1 year ago

arudhir commented 1 year ago
> mg.query('P62993-1', scope='uniprot.Swiss-Prot', fields='symbol')  # works
{'took': 7,
 'total': 1,
 'max_score': 0.99839664,
 'hits': [{'_id': '2885', '_score': 0.99839664, 'symbol': 'GRB2'}]}

 > mg.querymany('P62993-1', scope='uniprot.Swiss-Prot', fields='symbol')  # doesn't work
[{'query': 'P62993-1', 'notfound': True}]

> mg.querymany('P62993', scope='uniprot.Swiss-Prot', fields='symbol')  # failure not caused by isoform information
[{'query': 'P62993', 'notfound': True}]

> mg.querymany(['P62993-1'], scope='uniprot.Swiss-Prot', fields='symbol')
[{'query': 'P62993-1', 'notfound': True}]

> mg.querymany(['P62993'], scope='uniprot.Swiss-Prot', fields='symbol')
[{'query': 'P62993', 'notfound': True}]

For what it's worth, P62993-1 is the canonical sequence as well: https://www.uniprot.org/uniprotkb/P62993/entry#P62993-1

Edit: Closed because I think "uniprot" is serving me better as a scope.

https://docs.mygene.info/en/latest/doc/data.html#available-fields