Last active
January 20, 2019 22:44
-
-
Save TylerLafayette/2bf34b88d60b760d3ddf29fdc755c9ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# check to make sure script is running as root | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run this script using sudo to make sure all packages install correctly." | |
exit | |
fi | |
# attempt to disable user interaction/pauses during installation | |
export DEBIAN_FRONTEND=noninteractive | |
# update packages repo and install unzip to be sure its there | |
apt --assume-yes update | |
apt --assume-yes install unzip | |
# install the latest stable version of R and Rscript | |
# taken from (https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04) | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 | |
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' | |
# update again | |
apt --assume-yes update | |
# install r-base | |
apt --assume-yes install r-base | |
# install ggplot2 (version 3.1.0) | |
GGPLOT2_FILENAME="ggplot2_3.1.0.tar.gz" | |
wget https://cran.r-project.org/src/contrib/$GGPLOT2_FILENAME | |
R CMD INSTALL $GGPLOT2_FILENAME | |
# install plink (beta 6.7 stable) | |
PLINK_FILENAME="plink_linux_x86_64_20181202.zip" | |
wget http://s3.amazonaws.com/plink1-assets/$PLINK_FILENAME | |
mkdir plink_install | |
unzip $PLINK_FILENAME -d plink_install | |
mv plink_install/* /usr/local/bin | |
# install admixture | |
# taken from (http://hpc.ilri.cgiar.org/admixture-software) | |
wget http://software.genetics.ucla.edu/admixture/binaries/admixture_linux-1.3.0.tar.gz | |
tar -xvf admixture_linux-1.3.0.tar.gz | |
cd admixture_linux-1.3.0/ | |
cp -r . /usr/local/bin | |
cd .. | |
# cleanup | |
echo "Cleaning up..." | |
rm -r admixture_linux-1.3.0 | |
rm -r plink_install | |
rm $PLINK_FILENAME | |
rm $GGPLOT2_FILENAME | |
rm admixture_linux-1.3.0.tar.gz | |
echo "Everything installed successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment