Error: package ‘GenomeInfoDb’ could not be loaded

PLEASE ADVISE:
While working on the scRNAseq using Seurat, I installed and had no problem with the code
BiocManager::install("SingleCellExperiment")

However when tried to load it using the code
library(SingleCellExperiment)

it failed and message showed in my console as:
Error: package ‘GenomeInfoDb’ could not be loaded

  1. stop(gettextf("package %s could not be loaded", sQuote(pkg)), call. = FALSE, domain = NA)

  2. .getRequiredPackages2(pkgInfo, quietly = quietly)

  3. library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)

  4. .getRequiredPackages2(pkgInfo, quietly = quietly)

  5. library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)

  6. .getRequiredPackages2(pkgInfo, quietly = quietly)

  7. library(SingleCellExperiment)

here is my sessionInfo

R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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] parallel stats4 stats graphics grDevices datasets utils methods base

other attached packages:
[1] IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.0 MatrixGenerics_1.2.0 matrixStats_0.57.0
[6] cowplot_1.1.0 scales_1.1.1 RCurl_1.98-1.2 Matrix_1.3-0 forcats_0.5.0
[11] stringr_1.4.0 dplyr_1.0.2 purrr_0.3.4 readr_1.4.0 tidyr_1.1.2
[16] tibble_3.0.4 ggplot2_3.3.2 tidyverse_1.3.0 Seurat_3.2.3 BiocManager_1.30.10

loaded via a namespace (and not attached):
[1] Rtsne_0.15 colorspace_2.0-0 deldir_0.2-3 ellipsis_0.3.1 ggridges_0.5.2
[6] fs_1.5.0 rstudioapi_0.13 spatstat.data_1.7-0 leiden_0.3.6 listenv_0.8.0
[11] ggrepel_0.9.0 fansi_0.4.1 lubridate_1.7.9.2 xml2_1.3.2 codetools_0.2-18
[16] splines_4.0.3 knitr_1.30 polyclip_1.10-0 jsonlite_1.7.2 broom_0.7.3
[21] ica_1.0-2 cluster_2.1.0 dbplyr_2.0.0 png_0.1-7 uwot_0.1.10
[26] shiny_1.5.0 sctransform_0.3.2 compiler_4.0.3 httr_1.4.2 backports_1.2.1
[31] assertthat_0.2.1 fastmap_1.0.1 lazyeval_0.2.2 cli_2.2.0 later_1.1.0.1
[36] htmltools_0.5.0 tools_4.0.3 rsvd_1.0.3 igraph_1.2.6 gtable_0.3.0
[41] glue_1.4.2 RANN_2.6.1 reshape2_1.4.4 tinytex_0.28 Rcpp_1.0.5
[46] spatstat_1.64-1 scattermore_0.7 cellranger_1.1.0 vctrs_0.3.6 nlme_3.1-151
[51] lmtest_0.9-38 xfun_0.19 globals_0.14.0 rvest_0.3.6 mime_0.9
[56] miniUI_0.1.1.1 lifecycle_0.2.0 irlba_2.3.3 renv_0.12.3 goftest_1.2-2
[61] future_1.21.0 MASS_7.3-53 zoo_1.8-8 hms_0.5.3 promises_1.1.1
[66] spatstat.utils_1.17-0 RColorBrewer_1.1-2 yaml_2.2.1 reticulate_1.18 pbapply_1.4-3
[71] gridExtra_2.3 rpart_4.1-15 stringi_1.5.3 bitops_1.0-6 rlang_0.4.9
[76] pkgconfig_2.0.3 evaluate_0.14 lattice_0.20-41 ROCR_1.0-11 tensor_1.5
[81] patchwork_1.1.1 htmlwidgets_1.5.3 tidyselect_1.1.0 parallelly_1.22.0 RcppAnnoy_0.0.18
[86] plyr_1.8.6 magrittr_2.0.1 R6_2.5.0 generics_0.1.0 DBI_1.1.0
[91] withr_2.3.0 pillar_1.4.7 haven_2.3.1 mgcv_1.8-33 fitdistrplus_1.1-3
[96] survival_3.2-7 abind_1.4-5 future.apply_1.6.0 modelr_0.1.8 crayon_1.3.4
[101] KernSmooth_2.23-18 plotly_4.9.2.2 rmarkdown_2.6 readxl_1.3.1 grid_4.0.3
[106] data.table_1.13.4 reprex_0.3.0 digest_0.6.27 xtable_1.8-4 httpuv_1.5.4
[111] munsell_0.5.0 viridisLite_0.3.0

Did you try to reinstall GenomeInfoDb in case:

 BiocManager::install("GenomeInfoDb")

Thanks for suggestion. I tried, however the issue still exists...

Did the installation of GenomeInfoDb itself run successfully? Does library(GenomeInfoDb) work as expected?

Thanks for responding. Yes. the installation itself worked.

> BiocManager::install("GenomeInfoDb")
Bioconductor version 3.12 (BiocManager 1.30.10), R 4.0.3 (2020-10-10)
Installing package(s) 'GenomeInfoDb'
also installing the dependency ‘GenomeInfoDbData’

cannot open URL 'https://bioconductor.org/packages/3.12/data/annotation/bin/macosx/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/data/annotation/bin/macosx/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/data/experiment/bin/macosx/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/data/experiment/bin/macosx/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/workflows/bin/macosx/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/workflows/bin/macosx/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'trying URL 'https://bioconductor.org/packages/3.12/bioc/bin/macosx/contrib/4.0/GenomeInfoDb_1.26.2.tgz'
Content type 'application/x-gzip' length 4025755 bytes (3.8 MB)
==================================================
downloaded 3.8 MB


The downloaded binary packages are in
	/var/folders/0s/0jmwlt5j70b0fjk8kx4k2r080000gn/T//RtmpyZ9EDb/downloaded_packages
installing the source package ‘GenomeInfoDbData’

trying URL 'https://bioconductor.org/packages/3.12/data/annotation/src/contrib/GenomeInfoDbData_1.2.4.tar.gz'
Content type 'application/x-gzip' length 10673545 bytes (10.2 MB)
==================================================
downloaded 10.2 MB

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
Calls: source -> file
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
  cannot open file 'renv/activate.R': No such file or directory
Execution halted
installation of package ‘GenomeInfoDbData’ had non-zero exit status
The downloaded source packages are in
	‘/private/var/folders/0s/0jmwlt5j70b0fjk8kx4k2r080000gn/T/RtmpyZ9EDb/downloaded_packages’
Old packages: 'cowplot'
Update all/some/none? [a/s/n]: 
a
cannot open URL 'https://bioconductor.org/packages/3.12/data/annotation/bin/macosx/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/data/annotation/bin/macosx/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/data/experiment/bin/macosx/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/data/experiment/bin/macosx/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/workflows/bin/macosx/contrib/4.0/PACKAGES.rds': HTTP status was '404 Not Found'cannot open URL 'https://bioconductor.org/packages/3.12/workflows/bin/macosx/contrib/4.0/PACKAGES.gz': HTTP status was '404 Not Found'
  There is a binary version available but the source version is later:

installing the source package ‘cowplot’

trying URL 'https://cran.rstudio.com/src/contrib/cowplot_1.1.1.tar.gz'
Content type 'application/x-gzip' length 1353271 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
Calls: source -> file
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
  cannot open file 'renv/activate.R': No such file or directory
Execution halted
installation of package ‘cowplot’ had non-zero exit status
The downloaded source packages are in
	‘/private/var/folders/0s/0jmwlt5j70b0fjk8kx4k2r080000gn/T/RtmpyZ9EDb/downloaded_packages’

However, when tried

library(SingleCellExperiment)

Traceback showed:

Error: package ‘GenomeInfoDb’ could not be loaded

  1. stop(gettextf("package %s could not be loaded", sQuote(pkg)), call. = FALSE, domain = NA)

  2. .getRequiredPackages2(pkgInfo, quietly = quietly)

  3. library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)

  4. .getRequiredPackages2(pkgInfo, quietly = quietly)

  5. library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, quietly = quietly)

  6. .getRequiredPackages2(pkgInfo, quietly = quietly)

  7. library(SingleCellExperiment)

This shows that the installation didn't work ("non-zero status" means error), but I can't figure out why exactly. Note that the update of cowplot also failed, so this is a problem with your R/bioconductor, not with a particular package.

First, make sure you close all R and RStudio sessions, reopen a single window, and try again.

The warning suggests you are using renv, this could interfere with the usual package installation? You could try, possibly in a new project, to run renv::deactivate() then try to install again.

Perhaps this is related to the bigger problem (posted previously) that I have been encountering and would like to let you know why I came to this step :frowning:
While working on the single cell RNAseq analysis (did initially with R 3.6.1 around 2020/03~2020/08), I was able to get to the point of UMAPs and list of feature genes using Seurat. However, I found out several packages, especially for the advanced downstream analyses such as gene enrichment and differential analysis call for R 4; Therefore, I decided to upgrade to R 4 while locked the environment with renv. (even though I do not know quite well enough how to use it). After done this (changed my working environment), the UMAP is different from what I have done. Intuitive thinking, therefore, was to downgrade my R back to R 3.6.1. Unfortunately, I found out that this version of R is out.

In other words, is this possible to replicate what I have done before ? Please see the sessionInfo () from previous analysis

R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/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] stats graphics grDevices utils datasets methods base

other attached packages:
[1] cowplot_1.0.0 scales_1.1.0 RCurl_1.98-1.1 Matrix_1.2-18 forcats_0.5.0
[6] stringr_1.4.0 dplyr_0.8.5 purrr_0.3.3 readr_1.3.1 tidyr_1.0.2
[11] tibble_2.1.3 ggplot2_3.2.1 tidyverse_1.3.0

loaded via a namespace (and not attached):
[1] nlme_3.1-141 fs_1.3.2 bitops_1.0-6 lubridate_1.7.4
[5] RcppAnnoy_0.0.16 RColorBrewer_1.1-2 httr_1.4.1 numDeriv_2016.8-1.1
[9] tools_3.6.1 backports_1.1.5 R6_2.4.0 irlba_2.3.3
[13] KernSmooth_2.23-15 DBI_1.1.0 lazyeval_0.2.2 colorspace_1.4-1
[17] sn_1.5-5 withr_2.1.2 npsurv_0.4-0 tidyselect_1.0.0
[21] mnormt_1.5-6 compiler_3.6.1 cli_2.0.1 rvest_0.3.5
[25] xml2_1.2.5 TFisher_0.2.0 sandwich_2.5-1 caTools_1.18.0
[29] lmtest_0.9-37 mvtnorm_1.0-11 ggridges_0.5.2 rappdirs_0.3.1
[33] digest_0.6.23 pkgconfig_2.0.3 bibtex_0.4.2.2 dbplyr_1.4.2
[37] readxl_1.3.1 rlang_0.4.5 rstudioapi_0.11 generics_0.0.2
[41] zoo_1.8-7 jsonlite_1.6.1 ica_1.0-2 gtools_3.8.1
[45] magrittr_1.5 fansi_0.4.1 Rcpp_1.0.2 munsell_0.5.0
[49] ape_5.3 reticulate_1.14 lifecycle_0.2.0 stringi_1.4.5
[53] multcomp_1.4-12 gbRd_0.4-11 MASS_7.3-51.4 gplots_3.0.3
[57] Rtsne_0.15 plyr_1.8.5 grid_3.6.1 parallel_3.6.1
[61] gdata_2.18.0 listenv_0.8.0 ggrepel_0.8.2 crayon_1.3.4
[65] lattice_0.20-38 haven_2.2.0 splines_3.6.1 hms_0.5.3
[69] pillar_1.4.3 igraph_1.2.4.1 future.apply_1.4.0 codetools_0.2-16
[73] stats4_3.6.1 leiden_0.3.3 reprex_0.3.0 glue_1.3.1
[77] lsei_1.2-0 modelr_0.1.6 BiocManager_1.30.10 vctrs_0.2.4
[81] Rdpack_0.11-1 cellranger_1.1.0 gtable_0.3.0 RANN_2.6.1
[85] future_1.16.0 assertthat_0.2.1 broom_0.5.5 survival_2.44-1.1
[89] cluster_2.1.0 globals_0.12.5 fitdistrplus_1.0-14 TH.data_1.0-10
[93] ROCR_1.0-7

I'm not familiar with renv, so can't really help you on that.

Just one thing I can add: almost by definition, UMAP is supposed to have some randomness. So no big surprise that you would get a somewhat different result running it in different environments. Is that difference really that big to be a problem? Does most of that difference not disappear with tuning a bit the parameters?

In particular, the main change could be Seurat 3.1.0 (3 Aug 2019) which started using the package uwot for the UMAP by default (previous versions since 2.3.1 used the Python package umap-learn via reticulate). You don't have the Seurat version in your sessionInfo(), based on the R 3.6.1 (2019-07-05) you probably used Seurat 3.0.2, so a different implementation of UMAP. You should be able to run the Python version in RunUMAP() with the option umap.method = "umap-learn".

1 Like

Thank you for the insightful answer!
While took your notes and tried to look back any of my previous saved documents, I could not find the version of the Seurat, however I did find this which confirmed your thoughts here:

Run UMAP

seurat_integrated <- RunUMAP(seurat_integrated,

  •                          dims = 1:40,
    
  •                          reduction = "pca")
    

Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per session
08:44:03 UMAP embedding parameters a = 0.9922 b = 1.112
08:44:03 Read 29629 rows and found 40 numeric columns
08:44:03 Using Annoy for neighbor search, n_neighbors = 30
08:44:03 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
08:44:10 Writing NN index file to temp file /var/folders/hr/szgyxy3d5l5ffhm8yj89fqs80000gn/T//Rtmpy6W1ys/file2e7c4a44e5c8
08:44:10 Searching Annoy index using 1 thread, search_k = 3000
08:44:21 Annoy recall = 100%
08:44:22 Commencing smooth kNN distance calibration using 1 thread
08:44:25 Initializing from normalized Laplacian + noise
08:44:27 Commencing optimization for 200 epochs, with 1343698 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
08:44:43 Optimization finished

with current newer version which yield a different UMAP

Run UMAP

seurat_integrated <- RunUMAP(seurat_integrated,
dims = 1:40,
reduction = "pca")

The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per session15:05:56 UMAP embedding parameters a = 0.9922 b = 1.112
15:05:56 Read 41082 rows and found 40 numeric columns
15:05:56 Using Annoy for neighbor search, n_neighbors = 30
15:05:56 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:06:08 Writing NN index file to temp file /var/folders/hr/szgyxy3d5l5ffhm8yj89fqs80000gn/T//RtmphnElcO/file6c45e6acc00
15:06:08 Searching Annoy index using 1 thread, search_k = 3000
15:06:21 Annoy recall = 100%
15:06:25 Commencing smooth kNN distance calibration using 1 thread
15:06:28 Initializing from normalized Laplacian + noise
15:06:31 Commencing optimization for 200 epochs, with 1817954 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:06:51 Optimization finished

May I ask your advice of how can I tune the parameters back to previous run?
Thank you so much.