Skip to content

Instantly share code, notes, and snippets.

@MarkFilus
Last active October 11, 2018 17:29
Show Gist options
  • Save MarkFilus/3cba4932e813d808049eddad2b8a0b34 to your computer and use it in GitHub Desktop.
Save MarkFilus/3cba4932e813d808049eddad2b8a0b34 to your computer and use it in GitHub Desktop.
Install Cactus on Ubuntu 16.04

Installing Cactus on Ubuntu 16.04

This assumes you've already installed anaconda python (miniconda is enough and you do not need admin to install).

Install apt dependencies

sudo apt -y update
sudo apt -y install build-essential pkg-config libbz2-dev libtokyocabinet-dev libkyototycoon-dev kyototycoon libkyotocabinet-dev

Download from Github

git clone https://github.com/ComparativeGenomicsToolkit/cactus.git
cd cactus
git submodule update --init --recursive

Note: we are now in cactus directory, this is important for a few steps.

Set up python:

conda create -n cactus python=2.7 # must be python 2
source activate cactus
pip install --pre toil
pip install -e . # must be in cactus directory
export CACTUS_BINARIES_MODE=local
export PATH="`pwd`/bin:$PATH"
export PYTHONPATH="`pwd`:`pwd`/src"

Compile binaries:

make #run this in cactus dir. Do not use -j

You're done. Consider adding the following block to the file ~/.conda/envs/cactus/etc/conda/activate.d/acti.sh. (This runs every time you source the environment.)

export CACTUS_BINARIES_MODE=local
export PATH="/path/to/cactus/bin:$PATH"
export PYTHONPATH="/path/to/cactus:/path/to/cactus/src"

There's an example files below from the anaconda environment on our cluster, there's some extra stuff I put in to restore the old environment on a source deactivate.

Note on if you don't have sudo

Easiest way is to try to get some container software like docker, but if not try to compile for source or download from apt. Here's some things to try, I've not tested any of this:

  • you can extract a package to your home directory using a command like apt-get download kyototycoon && dpkg -x kyototycoon_0.9.56-1build2_amd64.deb $HOME I did not test it, but add ~/usr/lib/x86_64-linux-gnu to $LD_LIBRARY_PATH and ~/usr/bin to $PATH, and you should maybe get it to work without needing sudo, the only problem is you need to find all the dependencies

  • https://askubuntu.com/questions/193695/installing-packages-into-local-directory

# location on cluster: /opt/anaconda2/envs/cactus/etc/conda/activate.d/
export old_path="$PATH"
export old_pypath="$PYTHONPATH"
# set a default queue
export TOIL_TORQUE_ARGS="-q dept_24_core"
# these last three are the most important
export PATH="/opt/cactus/bin:$PATH"
export PYTHONPATH="/opt/cactus:/opt/cactus/src"
export CACTUS_BINARIES_MODE=local
# location on cluster: /opt/anaconda2/envs/cactus/etc/conda/deactivate.d/
export PATH="$old_path"
export PYTHONPATH="$old_pypath"
unset old_path
unset old_pypath
unset CACTUS_BINARIES_MODE
unset TOIL_TORQUE_ARGS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment