I needed to install poretools, but the setup instructions assume you have sudo priviliges. After combing through 879868070879 posts on stack overflow, the R-help mailing list, serverfault, etc., I finally arrived at solution using the nuclear option. There may be a better way, but this worked for me.
First, nuke and rebuild your own R from source. First, remove your existing installation (as usual, rm -rf with caution...)
rm -rf ~/RDownload the latest R source, configure with --enable-R-shlib to build R as a shared library. Using --prefix=<path>, give it a path you have +w access to install to.
On my cluster, trial and error proved that running make twice would work after make failed the first time.
mkdir ~/R
cd R
PREFIX=$(pwd)
wget http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz
tar -zxvf R-3.1.1.tar.gz
cd R-3.1.1
./configure --prefix=$PREFIX --enable-R-shlib
make
make
make installInstall some packages:
options("repos" = c(CRAN = "http://cran.rstudio.com/"))
install.packages("codetools")
install.packages("MASS")
install.packages("ggplot2")Make sure you're using this R:
echo "export PATH=$HOME/R/bin:$PATH" >> ~/.bashrcNuke your old anaconda python:
rm -rf ~/anacondaDownload the latest anaconda python installer from http://continuum.io/downloads. The installer is a big shell script run it with bash (regardless of whether you use bash, zsh, etc.). Agree to the license, and let it append to your PATH by appending to your ~/.bashrc.
bash Anaconda-2.0.1-Linux-x86_64.shApparently the readline library distributed with Anaconda is broken on Linux. Remove and re-install with pip.
conda remove readline
pip install readlineNow, you need rpy2 to provide a Python interface to the R language. Don't just go pip installing rpy2 - it won't work. You'll need to download the rpy2 source, and build it telling it where your R lives, like so:
wget --no-check-certificate https://pypi.python.org/packages/source/r/rpy2/rpy2-2.4.2.tar.gz
tar -zxvf rpy2-2.4.2.tar.gz
cd rpy2-2.4.2
export LDFLAGS="-Wl,-rpath,export LDFLAGS="-Wl,-rpath,${HOME}/R/lib64/R/lib"
python setup.py build --r-home ${HOME}/R/ installJust for good measure, log out and log back into your shell.
git clone https://github.com/arq5x/poretools
cd poretools
python setup.py installOr save yourself the headache and get running on AWS in less than 10 seconds. I was able to plow through some basic analyses on several runs in a few minutes on a free-tier eligible t2.micro instance.
- Go to your EC2 concole console.aws.amazon.com/ec2 and click "Launch Instance"
- Search community AMIs for "poretools" or by the ID: ami-4c0ec424.
- Select and launch the AMI on a t2.micro instance.
