Pan-organism OrgDb database, Accession number translated to organism name in R
1
0
Entering edit mode
j_denton • 0
@672b5b3e
Last seen 12 months ago
United States

Hello all, Thanks to James W. MacDonald I was able to figure out how to convert NCBI forms to Enseml forms, however the database provided requires you to know the species before hand (library(org.Hs.eg.db), where Hs is Homo sapiens). I can't seem to find a database that compiles all species, nor can I find a tool that can take an accession number and translate it into its organism's name. I am using R. Thank you for any help, J. Denton edit for clarification: for the accession number translation, an example would be NP_062749.2=Mus Musculus.

AccNo OrgDb convert Organismname RStudio • 683 views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 3 hours ago
United States

If you already know all the species, it's a simple matter of iterating through the available OrgDb packages.

> library(org.Hs.eg.db)
> library(org.Mm.eg.db)

> library(org.Gg.eg.db)

> getIds <- function(x) head(grep("^NP", keys(x, "REFSEQ"), value = TRUE))
> rando <- c(getIds(org.Hs.eg.db), getIds(org.Mm.eg.db), getIds(org.Gg.eg.db))
> theorgs <- c("org.Hs.eg.db","org.Mm.eg.db","org.Gg.eg.db")
> thespecies <- c("Human","Mouse","Chicken")

> fun <- function(x,y) {
         tmp <- mapIds(get(x), y, "SYMBOL", "REFSEQ")
         return(tmp[!is.na(tmp)])
}

> symblst <- lapply(theorgs, fun, y = rando)
'select()' returned 1:1 mapping
between keys and columns
'select()' returned 1:1 mapping
between keys and columns
'select()' returned 1:1 mapping
between keys and columns
> names(symblst) <- thespecies
> symblst
$Human
   NP_570602    NP_000005 
      "A1BG"        "A2M" 
NP_001334352 NP_001334353 
       "A2M"        "A2M" 
NP_001334354    NP_000653 
       "A2M"       "NAT1" 

$Mouse
   NP_031402    NP_033721 
       "Pzp"      "Aanat" 
NP_001185714 NP_001185716 
      "Aatk"       "Aatk" 
NP_001364432 NP_001389718 
      "Aatk"       "Aatk" 

$Chicken
NP_001003718    NP_989428 
     "TENM2"      "TENM2" 
   NP_989429 NP_001263212 
     "FZD10"       "FZD9" 
   NP_989430    NP_989431 
      "FZD4"       "TFAM"
ADD COMMENT
0
Entering edit mode

It appears that my code is not working, as I keep getting an error regarding "argument x"

getIds <- function(x) head(grep("NP_062749", keys(x, "REFSEQ"), value = TRUE))

rando <- c(getIds(org.Hs.eg.db), getIds(org.Mm.eg.db), getIds(org.Rn.eg.db))

theorgs <- c("org.Hs.eg.db","org.Mm.eg.db","org.Rn.eg.db")

thespecies <- c("Human","Mouse","Rat")

fun <- function(x,y) { tmp <- mapIds(get(x), y, "SYMBOL", "REFSEQ") return(tmp[!is.na(tmp)]) }

symblst <- lapply(theorgs, fun, y = rando)

Error in .testForValidKeys(x, keys, keytype, fks) : None of the keys entered are valid keys for 'REFSEQ'. Please use the keys method to see a listing of valid arguments.

ADD REPLY
0
Entering edit mode

The getIds function was meant to just get some example IDs so I could provide an example. You already have the IDs! You should be using a vector of the IDs you are trying to annotate as the input rather than the fake (rando) set of IDs that I used.

ADD REPLY

Login before adding your answer.

Traffic: 628 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