Question: Map uniprot entry name to accession number
1
3.4 years ago by
Diego Diez750
Japan
Diego Diez750 wrote:

Is there a way to map Uniprot names (e.g. RASH_HUMAN) to other identifiers using Bioconductor? I have tried biomaRt, the AnnotationDbi-based packages and uniprot.ws, but all seem to need accession accession numbers. I had more hope with uniprot.ws since it is possible to do this conversion from the uniprot web site itself.

uniprot.ws • 509 views
modified 3.4 years ago by Mike Smith4.0k • written 3.4 years ago by Diego Diez750
Answer: Map uniprot entry name to accession number
4
3.4 years ago by
Mike Smith4.0k
EMBL Heidelberg / de.NBI
Mike Smith4.0k wrote:

I don't know whether you can do it with uniprot.ws, but you can query their ID conversion tool directly using the httr package.

library(httr)
results <- POST(url = "http://www.uniprot.org/mapping/",
body = list(from = 'ID',
to = 'ACC',
format = 'tab',
query = 'RASH_HUMAN A4_HUMAN RASH_MOUSE'))
content(results, type = 'text/tab-separated-values', col_names = TRUE, col_types = NULL, encoding = "ISO-8859-1")

       From     To
1 RASH_HUMAN P01112
2   A4_HUMAN P05067
3 RASH_MOUSE Q61411

Just change the 'to' argument to retrieve a different identifier.  The full list they provide is here. I'm not sure you can get back multiple mappings in a single query, so if you want more you might need to run several queries and mash your results back together.

Excellent! I very quickly experimented with httr but seems I didn't really know how to use it. This not only solves my problem but it is  educational. Thank you!