Skip to content

R & Bioconductor

Here's some additional information on using R with Singularity/Apptainer

If you need to use bioconductor packages, bioconductor must be installed in the container and fortunately there are ready-made containers such as rocker/tidyverse or bioconductor/bioconductor_docker.

Note

Please note that it is sometimes impossible to install a package because it lacks system dependencies. In this case, you need to rebuild the container from its recipe and adapt it, but this is a little more complicated.

Here's how to install the bioconductor karyoploteR package:

  1. I fix the location of the R_LIB by adding this line in the .Renviron file (it's in my home directory: /beegfs/home/delmotte/.Renviron):

    R_LIBS=/beegfs/data/delmotte/myRlib
    
  2. I switch to my data:

    cd /beegfs/data/delmotte/
    
  3. I get the container:

    singularity pull docker://bioconductor/bioconductor_docker
    
  4. I use the container in interactive mode to install my module

    apptainer shell bioconductor_docker_latest.sif
    R
    BiocManager::install("karyoploteR",lib="/beegfs/data/delmotte/myRlib")
    

And now it's installed.

You won't have to install it even if the container is destroyed, because the module is in your R_LIB directory.