BootStrap: debootstrap OSVersion: xenial MirrorURL: http://us.archive.ubuntu.com/ubuntu/ # This is an example of a custom-built singularity image to run Rstudio in Open OnDemand # at https://www.umassrc.org:444/ # # Bioconductor, leidenbase, monocle3, and DiffBind installs are commented out # to serve as examples of different ways some packages may need to be installed %help This will run RStudio Server %environment export PATH=/usr/lib/rstudio-server/bin:${PATH} %apprun rserver exec rserver "${@}" %runscript exec rserver "${@}" %post echo "Hello from inside the container" export DEBIAN_FRONTEND="noninteractive" sed -i 's/$/ universe/' /etc/apt/sources.list apt-get update # Install ubuntu system-level packages apt-get -y install pkg-config apt-transport-https zlib1g zlib1g-dbg zlib1g-dev libbz2-dev liblzma* *pcre* libcurl4-openssl-dev vim m4 wget unzip autoconf automake dh-autoreconf curl tcl8.5 libx11-6 build-essential cmake libffi6 libffi-dev libssl* git wget software-prope rties-common gcc fort77 aptitude gdebi-core libclang-3.8-dev libclang-common-3.8-dev libclang-dev libclang1-3.8 libobjc-5-dev libobjc4 ps misc sudo libxml2-dev gdebi-core libudunits2-dev libgdal1-dev librsvg2* libv8-3.14.5 libv8-3.14-dev libv8-3.14-dbg # The aptitude command works better than apt-get for some packages aptitude -y install g++ xorg-dev libreadline-dev gfortran locales-all # The installed version of GDAL is too old (or has a version issue) so this installs GDAL v2. add-apt-repository ppa:ubuntugis/ubuntugis-unstable apt-get update apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev # install needed libgit2 library and dependency from non-default repository add-apt-repository ppa:cran/libgit2 apt-get -y update apt-get -y install libssh2-1-dev libgit2-dev # Install Rstudio 4.0 export PATH=/usr/lib/rstudio-server/bin:${PATH} # Add the R repository for version 4.0 echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/" >> /etc/apt/sources.list apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 apt-get -y update apt-cache showpkg r-base aptitude -y install r-base-core r-base-dev r-recommended r-recommended r-cran-mgcv r-cran-nlme # Install R packages echo "install.packages('Matrix')" | Rscript - echo "install.packages('codetools')" | Rscript - echo "install.packages(c('devtools','curl'))" | Rscript - # Download and install rstudio-server wget https://download2.rstudio.org/server/xenial/amd64/rstudio-server-1.3.1093-amd64.deb gdebi -n ./rstudio-server-1.3.1093-amd64.deb # Install bioconductor packages - there may be better ways to do this, but this is working currently. echo 'install.packages("BiocManager") BiocManager::install()' | Rscript - echo "BiocManager::install(c('DESeq2', 'ShortRead', 'Rsubread'))" | Rscript - echo "BiocManager::install(c('systemPipeR', 'ChIPpeakAnno', 'EnsDb.Hsapiens.v75', 'regioneR', 'org.Hs.eg.db', 'clusterProfiler'))" | Rscript - # Install packages echo 'install.packages(c( "pwr", "reshape2", "ggpubr","ggdendro"),dependencies = TRUE)' | Rscript - echo 'install.packages(c("tidyverse", "extraDistr", "gplots", "GGally", "ggrepel", "RColorBrewer"),dependencies = TRUE)' | Rscript - echo 'install.packages(c( "knitr", "RCurl", "plotly", "rmarkdown"),dependencies = TRUE)' | Rscript - echo 'install.packages(c( "pheatmap", "stringr", "purr", "tibble"),dependencies = TRUE)' | Rscript - rm -rf /var/run && ln -s /tmp /var/run %test # Uncommenting these tests would ensure that monocle3 and DiffBind load before finalizing the image #export PATH=/usr/lib/rstudio-server/bin:${PATH} #echo "library(monocle3)" | Rscript - && \ #echo "library(DiffBind)" | Rscript - && echo "Successful test"