Bioconductor / S4Vectors

Foundation of vector-like and list-like containers in Bioconductor
https://bioconductor.org/packages/S4Vectors
17 stars 20 forks source link

Installation issue on R version 4.4.0 and Ubuntu 22.04.4 LTS #124

Closed wguesdon closed 3 months ago

wguesdon commented 3 months ago

I have been stuck for a while with an installation error for S4Vectors.

I am not sure what caused the issue. After reading online, my hypothesis so far is that the latest versions of R treat compilation warnings as errors.

If anyone has any pointers, that would be useful. Thank you

I was installing the packages with Renv. The install issue happened at the Desq2 step.

###############

Installation steps

###############

library(renv)

initialize a new project-local environment with a private R library

renv::init(bioconductor = "3.18")

Install required packages for the project

packages <- c('tidyverse', 'data.table', 'ggpubr', 'dplyr', 'ggplot2', 'devtools', 'ade4', 'made4', 'pheatmap', 'roxygen2', 'testthat')

renv::install(packages)

Bioconductor packages

bioconductor_packages <- c('limma', 'edgeR', 'DESeq2', 'Biobase') for (pkg in bioconductor_packages) { renv::install(sprintf('bioc::%s', pkg)) }

Error

Error: Error installing package 'S4Vectors':

############

sessionInfo()

############

sessionInfo() R version 4.4.0 (2024-04-24) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.4 LTS

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

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

time zone: Europe/London tzcode source: system (glibc)

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

loaded via a namespace (and not attached): [1] compiler_4.4.0 BiocManager_1.30.23 tools_4.4.0 renv_1.0.7

wguesdon commented 3 months ago

I found the answer to this in a previously closed issue.

My mistake was using bioconductor = "3.18" when I should have used a later version for R 4.4.0

using renv::init(bioconductor = "3.20") fixed the issue.

hpages commented 3 months ago

Are you sure you want to use Bioconductor 3.20? This is the development version of Bioconductor. The current release version (3.19) is what we recommend for end users because it's a lot more stable.

Anyways, at the root of the problem is that you're using the wrong tool to install Bioconductor packages. If you use the right tool (BiocManager::install()), you'll get notified if you're using an old version of Bioconductor. It will also guarantee that you get the right package versions for your version of Bioconductor. Overall, 99% of installation problems can be avoided by using BiocManager::install(). See https://bioconductor.org/install/

wguesdon commented 3 months ago

Thank you for your comment. That is a good point. I will try it with 3.19 as well. I use renv::install('bioc::DESeq2') for the installation primarily to ensure reproducibility and to create different environments for each project.

Is there a way to do this without renv for Bioconductor packages? So I could use BiocManager::install() but still have a reproducible environment.

LiNk-NY commented 3 months ago

Thank you for your comment. That is a good point. I will try it with 3.19 as well. I use renv::install('bioc::DESeq2') for the installation primarily to ensure reproducibility and to create different environments for each project.

Is there a way to do this without renv for Bioconductor packages? So I could use BiocManager::install() but still have a reproducible environment.

You can re-create the environments for each Bioconductor release with Docker, see https://bioconductor.org/help/docker. You can also set a P3M CRAN snapshot that coincides with that version of Bioconductor or use BiocArchive.

We do not recommend the use of renv with Bioconductor.