use bioservices.UniProt (python) to map uniprot accession to [multiple] ensembl ids
I am just trying to get a (one to many) mapping from uniprot accession -> Ensembl ids.
In the spirit of exploration, I have the following code to use bioservices.UniProt pull all possible columns for the selection of uniprot accession ids.
from bioservices import UniProt
u = UniProt()
accession_numbers = ['P30561', 'P53762']
result = u.get_df(accession_numbers)
type(result)
result.columns.tolist()
I know that this mapping exists in UniProt, here is the annotation field on the uniprot website for the first accession (P30561):
However, going through the output columns of result above, the column labeled "Annotation" has the following contents:
0 5.0
1 5.0
2 5.0
3 5.0
4 5.0
5 5.0
6 4.0
7 1.0
This is clearly not a list of Ensembl ids
• 1,753 views
•
link
1 answer
Turns out this works:
from bioservices import UniProt
u = UniProt()
accession_numbers = ['P30561', 'P53762']
u.mapping(fr='UniProtKB_AC-ID',to='Ensembl',query=accession_numbers)
• 0 views
•
link
Log in to answer this question.
The
Annotationfield seems to the correspond to theAnnotation Score, which you would have figured out with a little bit of effort.Annotation score for:
Look for a column that can take you to the NCBI/Entrez Gene ID. There is no basis to assume that a column titled
Annotationwill give you a gene ID.