forked from BIMSBbioinfo/VoltRon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
83 lines (72 loc) · 3.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Start from the RStudio base image
FROM rocker/rstudio:latest
# dependencies
RUN apt-get update
RUN apt-get install -y libgdal-dev libfftw3-dev libmagick++-dev cmake libhdf5-dev git libopencv-dev libopencv-features2d-dev
RUN apt-get install -y libssl-dev libcurl4-openssl-dev libgit2-dev libxml2-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libz-dev
# OpenCV
RUN wget https://github.com/opencv/opencv/archive/refs/tags/4.8.1.zip
RUN unzip 4.8.1.zip
RUN rm 4.8.1.zip
RUN wget https://github.com/opencv/opencv_contrib/archive/refs/tags/4.8.1.zip
RUN unzip 4.8.1.zip
RUN rm 4.8.1.zip
RUN mkdir build
WORKDIR "build"
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.8.1/modules/ -D BUILD_opencv_xfeatures2d=ON ../opencv-4.8.1/
RUN make -j5
RUN make install
RUN sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
RUN ldconfig
# Install required R packages
RUN R -e "install.packages(c('shiny', 'devtools', 'BiocManager'), repos='http://cran.rstudio.com/')"
# Install VoltRon dependencies
RUN R -e "install.packages(c('grDevices', 'data.table', 'RcppAnnoy', 'RANN', 'Matrix', 'dplyr', 'ggplot2', 'ggrepel', 'igraph', 'irlba', 'rjson', 'magick', 'ids', 'sp', 'reshape2', 'rlang', 'ggpubr', 'shinyjs'), repos='http://cran.rstudio.com/')"
RUN R -e "install.packages(c('stringr', 'uwot', 'RCDT'), repos='http://cran.rstudio.com/')"
RUN R -e "BiocManager::install(c('EBImage', 'S4Arrays'))"
# Install Suggested dependencies
RUN R -e "BiocManager::install(c('DelayedArray'))"
RUN R -e "BiocManager::install(c('HDF5Array'))"
RUN R -e "remotes::install_github('bnprks/BPCells/[email protected]')"
RUN R -e "remotes::install_github('BIMSBbioinfo/ImageArray')"
RUN R -e "remotes::install_github('BIMSBbioinfo/HDF5DataFrame')"
RUN R -e "remotes::install_github('BIMSBbioinfo/ZarrDataFrame')"
RUN R -e "install.packages('Seurat')"
RUN R -e "BiocManager::install('glmGamPoi')"
RUN R -e "install.packages('arrow')"
RUN R -e "BiocManager::install('RBioFormats')"
RUN R -e "BiocManager::install('ComplexHeatmap')"
RUN R -e "devtools::install_github('xuranw/MuSiC')"
RUN R -e "BiocManager::install('SingleCellExperiment')"
RUN R -e "BiocManager::install('SpatialExperiment')"
RUN R -e "install.packages('dplyr')"
RUN R -e "BiocManager::install('DESeq2')"
RUN R -e "install.packages('ggnewscale')"
RUN R -e "install.packages('patchwork')"
RUN R -e "install.packages('anndata')"
RUN R -e "install.packages('R.utils')"
RUN R -e "devtools::install_github('immunogenomics/presto')"
RUN R -e "devtools::install_github('vitessce/vitessceR')"
# Install VoltRon dependencies
RUN R -e "devtools::install_github('Artur-man/VoltRon')"
# Install basilisk and setup environment
USER rstudio
RUN R -e "BiocManager::install('basilisk')"
RUN R -e "basilisk::obtainEnvironmentPath(VoltRon::getBasilisk())"
RUN sh -c 'echo "options(voltron.python.path = \"/home/rstudio/.cache/R/basilisk/1.18.0/VoltRon/0.2.0/VoltRon_basilisk_env/bin/python\")" > /home/rstudio/.Rprofile'
# set up java
USER root
RUN apt-get update -y
RUN apt upgrade -y
RUN apt-get install -y openjdk-21-jdk
RUN export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-arm64/
RUN R CMD javareconf -e
# Install java based packages
RUN R -e "install.packages('rJava')"
RUN R -e "BiocManager::install('RBioFormats')"
RUN sh -c 'echo "options(java.parameters = \"-Xmx10g\")" >> /home/rstudio/.Rprofile'
# Install spacexr
RUN apt-get install -y libgsl-dev
RUN R -e "options(timeout = 600000000); devtools::install_github(\"dmcable/spacexr\")"
# increase cache disk size for ImageMagick
RUN sed -i 's/2GiB/10GiB/g' /etc/ImageMagick-6/policy.xml