Error using old ensembldb annotations with R 4.0 +
1
0
Entering edit mode
rbenel ▴ 40
@rbenel-13642
Last seen 2.2 years ago
Israel

Hi,

I have been using the EnsDb.Hsapiens.v92 for my annotations for the past few years; however, this past week I updated R to 4.1 and the package is no longer compatible..

Any ideas what I can do to fix this? I would like to be consistent in my research and continue using the same version, EnsDb.Hsapiens.v92.

This is the error I receive.

"Error: package or namespace load failed for 'EnsDb.Hsapiens.v92':
 package 'EnsDb.Hsapiens.v92' was installed before R 4.0.0: please re-install it--"
Code should be placed in three backticks as shown below


sessionInfo( )

R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] ensembldb_2.16.4        AnnotationFilter_1.16.0 GenomicFeatures_1.44.0 
 [4] AnnotationDbi_1.54.1    Biobase_2.52.0          GenomicRanges_1.44.0   
 [7] GenomeInfoDb_1.28.1     IRanges_2.26.0          S4Vectors_0.30.0       
[10] BiocGenerics_0.38.0     dplyr_1.0.7             ggplot2_3.3.5          

loaded via a namespace (and not attached):
 [1] MatrixGenerics_1.4.1        viridis_0.6.1              
 [3] httr_1.4.2                  tidyr_1.1.3                
 [5] bit64_4.0.5                 viridisLite_0.4.0          
 [7] assertthat_0.2.1            BiocFileCache_2.0.0        
 [9] blob_1.2.2                  GenomeInfoDbData_1.2.6     
[11] Rsamtools_2.8.0             yaml_2.2.1                 
[13] progress_1.2.2              lattice_0.20-44            
[15] pillar_1.6.2                RSQLite_2.2.7              
[17] glue_1.4.2                  digest_0.6.27              
[19] RColorBrewer_1.1-2          XVector_0.32.0             
[21] colorspace_2.0-2            Matrix_1.3-4               
[23] XML_3.99-0.6                pkgconfig_2.0.3            
[25] pheatmap_1.0.12             biomaRt_2.48.2             
[27] zlibbioc_1.38.0             purrr_0.3.4                
[29] scales_1.1.1                BiocParallel_1.26.1        
[31] tibble_3.1.3                KEGGREST_1.32.0            
[33] generics_0.1.0              ellipsis_0.3.2             
[35] cachem_1.0.5                withr_2.4.2                
[37] SummarizedExperiment_1.22.0 lazyeval_0.2.2             
[39] magrittr_2.0.1              crayon_1.4.1               
[41] memoise_2.0.0               fansi_0.5.0                
[43] xml2_1.3.2                  tools_4.1.0                
[45] prettyunits_1.1.1           hms_1.1.0                  
[47] matrixStats_0.60.0          BiocIO_1.2.0               
[49] lifecycle_1.0.0             stringr_1.4.0              
[51] munsell_0.5.0               DelayedArray_0.18.0        
[53] Biostrings_2.60.2           compiler_4.1.0             
[55] rlang_0.4.11                grid_4.1.0                 
[57] RCurl_1.98-1.3              rstudioapi_0.13            
[59] rjson_0.2.20                rappdirs_0.3.3             
[61] bitops_1.0-7                restfulr_0.0.13            
[63] gtable_0.3.0                DBI_1.1.1                  
[65] curl_4.3.2                  R6_2.5.0                   
[67] GenomicAlignments_1.28.0    gridExtra_2.3              
[69] rtracklayer_1.52.0          fastmap_1.1.0              
[71] bit_4.0.4                   utf8_1.2.2                 
[73] filelock_1.0.2              ProtGenerics_1.24.0        
[75] stringi_1.7.3               Rcpp_1.0.7                 
[77] vctrs_0.3.8                 png_0.1-7                  
[79] dbplyr_2.1.1                tidyselect_1.1.1
anno EnsDb.Hsapiens.v79 ensDb.HSapiens.v92 AnnotationDbi ensembldb • 1.3k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 14 hours ago
United States

It looks like what you are doing is updating R but not updating your packages. You shouldn't do that, as the Bioconductor packages are meant to be used with a particular R version, which is what the error is telling you. If you install a new version of R, and you don't care to have old versions of R/Bioconductor for backward compatibility, you should do

install.packages("BiocManager")
library(BiocManager)
BiocManager::install(ask = FALSE)

Which will update all your installed packages to the correct version.

ADD COMMENT
0
Entering edit mode

Hi,

I have updated all of my packages, but this one won't update as it's based on a specific ensembl version which was also not downloaded from bioconductor and rather shared on this page as a binary...

Any suggestions what I can do to retain this version of ensebml using R 4.0+ now that I have already upgraded R and Bioconductor...

Thanks

ADD REPLY
0
Entering edit mode

As the EnsDb.Hsapiens.v92 version I was using didn't update with the move to R 4.1, this is the workaround I found in case anyone has a similar issue.

You can find parts of the code used here: https://www.bioconductor.org/packages/release/bioc/vignettes/ensembldb/inst/doc/ensembldb.html#101_Getting_EnsDb_databases

Section 9 and 10 build your own annotation package

library(AnnotationHub)
library(enembldb)
library(devtools)

ah <- AnnotationHub()

#get specific query 
ahDb <- query(ah, pattern = c("Homo sapiens", "EnsDb", 92))

ahDb

#Fetch the EnsDb and use it.
ahEdb <- ahDb[[1]]

## retrieve all genes
gns <- genes(ahEdb)

## and finally we can generate the package
makeEnsembldbPackage(ensdb = dbfile(dbconn(ahEdb)), version = "0.99.12",
                     maintainer = "Johannes Rainer <johannes.rainer@eurac.edu>",
                     author = "J Rainer")
#Even easier then the above is to use Hadley Wickham’s devtools package. You can then build and install the package from within R.
#Start R within your package directory (so that your package directory is R’s working directory).

  build("EnsDb.Hsapiens.v92")

#To install the R package, you’d type
#gets installed in your working directory 
install("EnsDb.Hsapiens.v92")
ADD REPLY

Login before adding your answer.

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