Full Installation

The following document is for the full installation of all software required by the C-HiC module and all programmes that it uses. The document has been written with Ubuntu Linux, although many of the commands are cross platform (*nix) complient.

If you already have certain packages installed feel free to skip over certain steps. Likewise the bin, lib and code directories are relative to the home dir; if this is not the case for your system then make the required changes when running these commands.

Setup the System Environment

1
2
3
4
5
6
7
8
9
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev       \\
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \\
libncursesw5-dev xz-utils tk-dev unzip mcl libgtk2.0-dev r-base-core     \\
libcurl4-gnutls-dev python-rpy2 git libtbb2 pigz liblzma-dev libhdf5-dev \\
texlive-latex-base

cd ${HOME}
mkdir bin lib code
echo 'export PATH="${HOME}/bin:$PATH"' >> ~/.bash_profile

Setup pyenv and pyenv-virtualenv

This is required for managing the version of Python and the installation environment for the Python modules so that they can be installed in the user space.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

# Add the .bash_profile to your .bashrc file
echo 'source ~/.bash_profile"' >> ~/.bashrc

git clone https://github.com/pyenv/pyenv-virtualenv.git ${PYENV_ROOT}/plugins/pyenv-virtualenv

pyenv install 2.7.12
pyenv virtualenv 2.7.12 C-HiC

# Python 3 environment required by iNPS
pyenv install 3.5.3
ln -s ${HOME}/.pyenv/versions/3.5.3/bin/python ${HOME}/bin/py3

Installation Process

bedtools and libspatialindex-dev

1
2
sudo apt-get install bedtools
sudo apt-get install libspatialindex-dev

Bowtie2 Aligner

1
2
3
cd ${HOME}/lib
wget --max-redirect 1 https://downloads.sourceforge.net/project/bowtie-bio/bowtie2/2.3.4/bowtie2-2.3.4-linux-x86_64.zip
unzip bowtie2-2.3.4-linux-x86_64.zip

HiCUP

1
2
3
4
5
 cd ${HOME}/lib
 wget https://www.bioinformatics.babraham.ac.uk/projects/hicup/hicup_v0.6.1.tar.gz
 tar -xzf hicup_v0.6.1.tar.gz
 cd hicup_v0.6.1
 chmod a+x *

BWA Sequence Aligner

1
2
3
4
cd ${HOME}/lib
git clone https://github.com/lh3/bwa.git
cd bwa
make

SAMtools

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
cd ${HOME}/lib
git clone https://github.com/samtools/htslib.git
cd htslib
autoheader
autoconf
./configure --prefix=${HOME}/lib/htslib
make
make install

cd ${HOME}/lib
git clone https://github.com/samtools/samtools.git
cd samtools
autoheader
autoconf -Wno-syntax
./configure --prefix=${HOME}/lib/samtools
make
make install

Install CHiCAGO

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update -qq
sudo apt-get install r-base-core
sudo apt-get install python-rpy2


cd ${HOME}/lib
sudo apt-get install libtbb-dev
sudo apt-get install libssl-dev
cd ${HOME}/C-HiC/
echo "R_LIB=${HOME}/R" > ${HOME}/.Renviron
echo "options(repos = c(CRAN = 'http://mirrors.ebi.ac.uk/CRAN/'))" > ${HOME}/.Rprofile
echo ".libPaths('~/R')" >> ${HOME}/.Rprofile
echo 'message("Using library:", .libPaths()[1])' >> ${HOME}/.Rprofile
sudo Rscript sudo Rscript CHiC/tool/scripts/install_packages.R

cd ${HOME}/C-HiC/CHiC/tool/scripts/
wget https://bitbucket.org/chicagoTeam/chicago/raw/e288015f75d36c5367d1595e0ac8099f2ce82aa1/chicagoTools/runChicago.R
wget https://bitbucket.org/chicagoTeam/chicago/raw/e288015f75d36c5367d1595e0ac8099f2ce82aa1/chicagoTools/bam2chicago.sh
wget https://bitbucket.org/chicagoTeam/chicago/raw/e288015f75d36c5367d1595e0ac8099f2ce82aa1/chicagoTools/makeDesignFiles.py
chmod +x bam2chicago.sh

Prepare the Python Environment

Install APIs and Pipelines

Checkout the code for the DM API and the C-HiC pipelines:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cd ${HOME}/code
pyenv activate C-HiC
pip install git+https://github.com/Multiscale-Genomics/mg-dm-api.git
pip install git+https://github.com/Multiscale-Genomics/mg-tool-api.git
pip install git+https://github.com/Multiscale-Genomics/mg-process-fastq.git


git clone https://github.com/pabloacera/C-HiC.git
cd C-HiC
pip install -e .
pip install -r requirements.txt
pip install dill