Let's say I want to map a KEGG ID to a ChEBI ID using bioservices
, I can do:
from bioservices import *
kegg_con = KEGG()
kegg_entry = kegg_con.parse(kegg_con.get('C00033'))
print(kegg_entry['DBLINKS']['ChEBI'].split())
This will return
[u'15366', u'30089']
meaning that there are two ChEBI IDs associated with the KEGG compound (KEGG entry C00033).
An alternative - if one has to do a lot of mappings - is to use the built-in converter like this:
map_kegg_chebi = kegg_con.conv("chebi", "compound")
print(map_kegg_chebi['cpd:C00033'])
This will print
u'chebi:15366'
So for the same compound, only one ID is returned although there are two assicated with this compound. Is there a way to retrieve both of them?