select with org.Mm.eg.db does not give ENSEMBL ids
1
0
Entering edit mode
raf4 ▴ 30
@raf4-8249
Last seen 23 months ago
United States

Dear org.Mm.eg.db Maintainer,

I canot get ENSEMBL IDS from org.Mm.eg.db. The analogous code works with org.Hs.eg.db Please advise or fix. I tried writing maintainer@bioconductor.org, but my e-mail was returned.

> library(org.Mm.eg.db) 
> 
> genessym<-read.table("data/genes_sym.txt",sep="\t",header=T,as.is=T)
> dim(genessym)
[1] 47  1
> ids<-genessym$SYMBOL
> ids
 [1] "Cacna1c" "Cacn1d"  "Cacna1s" "Cacna1g" "Cacna1h" "Cacna1i" "Cacnb1"  "Cacnb2"  "Cacnb3"  "Cacnb4"  "Rrad"    "Rem1"  
[13] "Rem2"    "Ryr1"    "Ryr2"    "Ryr3"    "Atp2a1"  "Atp2a2"  "Atp2a3"  "Adra1a"  "Adra2a"  "Adrb2"   "Adrb1"   "Myh11"  
[25] "Acta2"   "Agtr2"   "Itpr1"   "Itpr2"   "Itpr3"   "Prkca"   "Prkaca"  "Prkg1"   "Prkg2"   "Prkaa1"  "Prkaa2"  "Prkag1"
[37] "Prkar1a" "Prkar2a" "Prkab2"  "Prkacb"  "Ppp1ca"  "Ppp2ca"  "Ppp2ccb" "Sphk1"   "Sphk2"   "Rock1"   "Rock2"  
> select(org.Mm.eg.db, keys=ids, columns=c("SYMBOL","ENSEMBL"), keytype="SYMBOL") 
Error: unexpected input in "select(org.Mm.eg.db, keys=ids, columns=c("SYMBOL","ENSEMBL"), keytype="SYMBOL") "
> 
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] org.Mm.eg.db_3.16.0  AnnotationDbi_1.60.0 IRanges_2.32.0       S4Vectors_0.36.1     Biobase_2.58.0       BiocGenerics_0.44.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9             XVector_0.38.0         zlibbioc_1.44.0        bit_4.0.5              R6_2.5.1              
 [6] rlang_1.0.6            fastmap_1.1.0          blob_1.2.3             httr_1.4.4             GenomeInfoDb_1.34.6  
[11] tools_4.2.2            png_0.1-8              cli_3.6.0              DBI_1.1.3              bit64_4.0.5          
[16] crayon_1.5.2           GenomeInfoDbData_1.2.9 bitops_1.0-7           vctrs_0.5.1            KEGGREST_1.38.0      
[21] RCurl_1.98-1.9         memoise_2.0.1          cachem_1.0.6           RSQLite_2.2.20         compiler_4.2.2        
[26] Biostrings_2.66.0      pkgconfig_2.0.3      
>

Thank you,

Richard Friedman

Columbia University Cancer Center

Biomedical Informatics Shared Resource

org.Mm.eg.db • 937 views
ADD COMMENT
1
Entering edit mode
Guido Hooiveld ★ 4.1k
@guido-hooiveld-2020
Last seen 11 hours ago
Wageningen University, Wageningen, the …

FWIW: your code is working in my hands; see below.

Two thoughts: confirm that your input is a character vector, and in case the function select is masked by another package you may want to explicitly specify to use the function from the library AnnotationDbi:

> AnnotationDbi::select(org.Mm.eg.db, keys=ids, columns=c("SYMBOL","ENSEMBL"), keytype="SYMBOL") 



> library(org.Mm.eg.db)
> ids <- c("Cacna1c","Cacn1d","Cacna1s","Cacna1g","Cacna1h","Cacna1i","Cacnb1","Cacnb2","Cacnb3","Cacnb4","Rrad","Rem1")
> select(org.Mm.eg.db, keys=ids, columns=c("SYMBOL","ENSEMBL"), keytype="SYMBOL") 
'select()' returned 1:1 mapping between keys and columns
    SYMBOL            ENSEMBL
1  Cacna1c ENSMUSG00000051331
2   Cacn1d               <NA>
3  Cacna1s ENSMUSG00000026407
4  Cacna1g ENSMUSG00000020866
5  Cacna1h ENSMUSG00000024112
6  Cacna1i ENSMUSG00000022416
7   Cacnb1 ENSMUSG00000020882
8   Cacnb2 ENSMUSG00000057914
9   Cacnb3 ENSMUSG00000003352
10  Cacnb4 ENSMUSG00000017412
11    Rrad ENSMUSG00000031880
12    Rem1 ENSMUSG00000000359
> class(ids)
[1] "character"
> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] org.Mm.eg.db_3.16.0  AnnotationDbi_1.60.0 IRanges_2.32.0      
[4] S4Vectors_0.36.1     Biobase_2.58.0       BiocGenerics_0.44.0 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9             XVector_0.38.0         zlibbioc_1.44.0       
 [4] bit_4.0.5              R6_2.5.1               rlang_1.0.6           
 [7] fastmap_1.1.0          blob_1.2.3             httr_1.4.4            
[10] GenomeInfoDb_1.34.6    tools_4.2.2            png_0.1-8             
[13] cli_3.6.0              DBI_1.1.3              bit64_4.0.5           
[16] crayon_1.5.2           GenomeInfoDbData_1.2.9 bitops_1.0-7          
[19] vctrs_0.5.1            KEGGREST_1.38.0        RCurl_1.98-1.9        
[22] memoise_2.0.1          cachem_1.0.6           RSQLite_2.2.20        
[25] compiler_4.2.2         Biostrings_2.66.0      pkgconfig_2.0.3       
> 
ADD COMMENT
0
Entering edit mode

Guido,

Thank you very much. It turned out that I had an extra invisible character in my select command which I had pasted in. When I removed it, the comand worked with just select.

Best wishes,

Rich

ADD REPLY

Login before adding your answer.

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