UniProt.ws - single database for two species
1
0
Entering edit mode
l.nilse • 0
@lnilse-11875
Last seen 6.6 years ago

UniProt.ws library is a great tool which we are using extensively. With

db <- UniProt.ws(taxId=9606)

I can read the database for one specific species. How can I generate a database for two species

db <- UniProt.ws(taxId=c(9606,10090))

or how can I combine two databases to a single one? Thanks for your help.

Lars

uniprot.ws uniprot • 1.3k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

UniProt.ws doesn't generate a database. Instead, what it does is to download all the UniProtKB IDs for a given species, and puts them in an object (your 'db' object). Then when you do a query, the package uses the RCurl package to generate a correctly formed URI to send to www.uniprot.org to do the query.

You could hypothetically hack things to get the mouse UniProtKB IDs into your human 'db' object, and some of the queries would work. But the result you would get is the same if you did the queries separately and then used rbind to combine. As an example, I generated a 'hacked' UniProt.ws object that contained both human and mouse IDs:

> select(zzz, c("Q9Y478","Q8R2R3"), "ENTREZ_GENE")
Getting mapping data for Q9Y478 ... and P_ENTREZGENEID
'select()' returned 1:1 mapping between keys and columns
  UNIPROTKB ENTREZ_GENE
1    Q9Y478        5564
2    Q8R2R3       66939

I also have separate human and mouse UniProt.ws objects (z, and zz, respectively) that I can do separate queries on:

> rbind(select(z, "Q9Y478", "ENTREZ_GENE"), select(zz, "Q8R2R3", "ENTREZ_GENE"))
Getting mapping data for Q9Y478 ... and P_ENTREZGENEID
'select()' returned 1:1 mapping between keys and columns
Getting mapping data for Q8R2R3 ... and P_ENTREZGENEID
'select()' returned 1:1 mapping between keys and columns
  UNIPROTKB ENTREZ_GENE
1    Q9Y478        5564
2    Q8R2R3       66939

So with two separate UniProt.ws objects I can get the same output I would get if I make the combination object, without having to do the hacking (and which may result in unintended results).

 

ADD COMMENT

Login before adding your answer.

Traffic: 793 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6