#!/bin/bash r_pkgs=( DESeq2 genefilter biomaRt ggplot2 gplots RColorBrewer ) pip_pkgs=( biopython ) if [[ $(id -u) -ne 0 ]]; then echo "Error: run this script as the root user, not EUID $(id -u)." exit 1 fi set -e # Make most errors fatal. ubuntu_update () { apt-get update apt-get -y upgrade } ubuntu_install_r_cran () { cat < /etc/apt/sources.list.d/cgi-r-cran.list # Newest R version from CRAN per # https://cran.r-project.org/bin/linux/ubuntu/ deb https://cran.fhcrc.org/bin/linux/ubuntu $(lsb_release -cs)/ EOF local key=E084DAB9 grep -q $key <( apt-key list ) || apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key apt-get update apt-get -y install r-base-dev # Dependencies of RCurl: apt-get -y install libxml2-dev libcurl4-gnutls-dev } python_install_packages() { apt-get -y install python-pip python-dev pip install --upgrade ${pip_pkgs[@]} } r_install_packages() { local pkgs=$@ pkgs=\"$(printf "\",\"%s" $pkgs)\" Rscript --vanilla - <