Skip to content

Installation

Roberto Vera Alvarez edited this page Apr 29, 2019 · 8 revisions

Requirements

samtools

http://www.htslib.org/

libBigWig

Clone the libBigWig repository from GitHub: https://github.com/dpryan79/libBigWig

git clone https://github.com/dpryan79/libBigWig.git

Compile it and set the environment variables for BAMscale

cd libBigWig/
make
export LIBBIGWIG_DIR=`pwd`
export CPPFLAGS="-I${LIBBIGWIG_DIR}"
export LDFLAGS="-L${LIBBIGWIG_DIR}"

Installation

After compiling the libBigWig library and samtools (if not already installed) clone the BAMscale from GitHub

git clone https://github.com/ncbi/BAMscale.git

and go to the BAMscale folder to compile the program:

cd BAMscale/
make

A bin folder will be created with the BAMscale executable.

Detailed installation for Linux-based OS

Installing samtools

If samtools (htslib) is not installed on the system, clone it from github and install it.

This part is based on the htslib manual!

git clone https://github.com/samtools/htslib.git
cd htslib/
autoheader     # If using configure, generate the header template...
autoconf       # ...and configure script (or use autoreconf to do both)
./configure    # Optional but recommended, for choosing extra functionality
make

Once htslib is compiled, export path infos:

export HTSLIB_DIR=`pwd`
export CPPFLAGS="-I${HTSLIB_DIR}"
export LDFLAGS="-L${HTSLIB_DIR} -Wl,-rpath,${HTSLIB_DIR}"
cd ..

Alternatively, samtools can be installed directly from the app repository on most linux-based machines. In this case, no environmental variable has to be set.

sudo apt-get install samtools

Installing libBigWig

Next, we need libBigWig from GitHub: https://github.com/dpryan79/libBigWig

git clone https://github.com/dpryan79/libBigWig.git

Compile it and set the environment variables for BAMscale

cd libBigWig/
make
export LIBBIGWIG_DIR=`pwd`
export CPPFLAGS="-I$LIBBIGWIG_DIR $CPPFLAGS"
export LDFLAGS="-L $LIBBIGWIG_DIR -Wl,-rpath,$LIBBIGWIG_DIR $LDFLAGS"
cd ..

If possible, it is better to install libBigWig so the library is easily available for the program. If libBigWig was already complied with make, you can install it by typing in the libBigWig folder:

make install

Like this, each time you start the command line, you do not have to specify the path to libBigWig before running BAMscale.

Installing BAMscale

Finally, we clone BAMscale:

git clone https://github.com/ncbi/BAMscale.git

and go to the BAMscale folder to compile the program:

cd BAMscale/
make

The bin folder will be created with the BAMscale executable.

Detailed installation for MAC OS with Conda

Follow the instructions to install Conda from: https://docs.anaconda.com/anaconda/install/mac-os/

After that, you should add bioconda channels:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

Installing libbigwig

conda install libbigwig

Installing htslib

conda install htslib

Set Conda path

At this step, remember to change the path to the CONDA_DIR variable from "/your-conda/path" in the first line.

export CONDA_DIR="/your-conda/path"
export CPPFLAGS="-I $CONDA_DIR/include"
export LDFLAGS="-L $CONDA_DIR/lib -Wl,-rpath,$CONDA_DIR/lib"

BAMscale compilation

make clean
make

Detailed installation for MAC OS with Homebrew

For this installation, a requirement is to have Homebrew installed.

brew install samtools

Next we install the libBigWig:

git clone https://github.com/dpryan79/libBigWig.git
cd libBigWig/
make
make install
export LIBBIGWIG_DIR=`pwd`
export CPPFLAGS="-I$LIBBIGWIG_DIR $CPPFLAGS"
export LDFLAGS="-L $LIBBIGWIG_DIR -Wl,-rpath,$LIBBIGWIG_DIR $LDFLAGS"
export DYLD_LIBRARY_PATH=$LIBBIGWIG_DIR
cd ..

Finally, we clone BAMscale:

git clone https://github.com/ncbi/BAMscale.git

and go to the BAMscale folder to compile the program:

cd BAMscale/
make

The bin folder will be created with the BAMscale executable.