cokelaer / bioservices

Access to Biological Web Services from Python.

Home Page:http://bioservices.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing for UniProt examples

johnnytam100 opened this issue · comments

I tried the following UniProt examples in Colab, and unfortunately they failed:

from bioservices.uniprot import UniProt
u = UniProt(verbose=False)
u.mapping(fr="ACC+ID", to="KEGG_ID", query='P43403')
from bioservices import *
u = UniProt()
u.mapping(fr='ID', to='KEGG_ID', query="ZAP70_HUMAN")

image

My bioservices version is 1.10.2.

May I know if we have a workaround?

@johnnytam100 unfortunately, there was a big change in uniprot API recently, which has been updated in bioservices.
So you must use the new conventions. I also recommend to use the latest version (1.10.4 available on pypi https://pypi.org/project/bioservices/). Then, please check the new documentation on bioservices.readthedocs.io

The documentation may not be up-to-date everywhere though.

In your case the ACC+ID must be changed to UniProtKB_AC-ID and KEGG_ID to KEGG

You can see available mapping in the attribute:

 u.valid_mapping

Where the keys contains the 'from' and the values are the 'to'.