I have been trying to install DESeq2 via a Docker container, running it interactively, and then starting an R session where I can manually install the package.
Here is my Dockerfile, which pulls down R version 3.4.1 and installs additional packages on top of it.
FROM r-base:3.4.1
WORKDIR /home
RUN apt-get update && \
apt-get install -y \
build-essential \
gdb \
git \
jags \
libcurl4-openssl-dev \
libopenblas-base \
libopenblas-dev \
libssl-dev \
libssh2-1-dev \
libxml2 \
libxml2-dev \
python-dev \
python-pip \
wget \
sudo
RUN pip install awscli boto3
ENV PATH=$PATH:~/.local/bin/
ADD . /home/
ENV R_THREADS=30
When I run this interactively and start an R session, I first check the R version and notice that it becomes 3.6.1
(even though it was supposed to be 3.4.1
) and then I try installing DESeq2 via:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("DESeq2")
When I try this, I get the following response:
ERROR: dependencies ‘cli’, ‘pillar’ are not available for package ‘tibble’
* removing ‘/usr/local/lib/R/site-library/tibble’
* installing *source* package ‘GenomicRanges’ ...
** using staged installation
** libs
ERROR: dependencies ‘reshape2’, ‘tibble’ are not available for package ‘ggplot2’
* removing ‘/usr/local/lib/R/site-library/ggplot2’
ERROR: dependency ‘ggplot2’ is not available for package ‘viridis’
* removing ‘/usr/local/lib/R/site-library/viridis’
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:6: genefilter.so] Error 1
ERROR: compilation failed for package ‘genefilter’
* removing ‘/usr/local/lib/R/site-library/genefilter’
ERROR: dependencies ‘ggplot2’, ‘acepack’, ‘htmlTable’, ‘viridis’ are not available for package ‘Hmisc’
* removing ‘/usr/local/lib/R/site-library/Hmisc’
ERROR: dependencies ‘genefilter’, ‘ggplot2’, ‘Hmisc’, ‘RcppArmadillo’ are not available for package ‘DESeq2’
* removing ‘/usr/local/lib/R/site-library/DESeq2’
So then I try doing install.packages("devtools")
to address that first ERROR, but I then run into a train of more dependency issues.
I would also try installing DESeq2 the following way, but it's not compatible with R versions >= 3.5 and my container updates to a later version anyway:
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
Does anyone know of a proper way to install DESeq2 (dependencies and all) for either earlier or later versions of R? I need to be able to do so using a Docker container, as i'm trying to automate this program and deploy it on the cloud. Thanks!
UPDATE
I also tried this multi-image Dockerfile, which pulls down an existing Bioconductor-deseq2 image, as well as the Ubuntu image. This container builds successfully, but then when it invokes the entrypoint script run_deseq2.py
, it says /bin/sh: 1: Rscript: not found
, and in that python script, I have a step where I invoke an R script via a subprocess command. So this means it's not saving the path to R that it got from the first image pulled.
FROM quay.io/biocontainers/bioconductor-deseq2:1.26.0--r36he1b5a44_0
ADD src/setup.R /
RUN Rscript /setup.R
RUN echo "Done setup."
FROM ubuntu:19.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /
RUN apt-get update && \
apt-get install -y \
python-dev \
python-pip \
wget
RUN pip install awscli boto3
COPY src/run_deseq2.py /
COPY src/s3_utils.py /
COPY src/job_utils.py /
COPY src/deseq2.R /
COPY src/ModelLoxTag.R /
ENV PATH=$PATH:~/.local/bin/
ENV R_THREADS=30
# Run docker, starting with run script
ENTRYPOINT ["python", "/run_deseq2.py"]
Here's an existing dockerfile for DESeq2 that may help you restructure your dockerfile. https://hub.docker.com/r/genomicpariscentre/deseq2/dockerfile
I have no experience with R programs and docker, so I'm sorry I can't help out with that part.