, ,

I am working heavily with PacBio data recently, so it will be nice to have PacBio’s blasr (https://github.com/PacificBiosciences/blasr) installed on our local server.

First, make sure the library glibc, glibc-devel and glibc-static have been pre-installed on the system. I got errors when compiling blasr without glibc-devl and glibc-static libraries.

Second, we need to install the hdf5 library. It is a bit tricky with regard to this. I firstly installed the latest version hdf5-1.8.15-patch1 but I got errors when compiling blasr with this version. I did a bit  research online and found out this is due to an API change of the hdf5 library happened since the version hdf5-1.8.12. So I removed the hdf5-1.8.15-patch1 and installed hdf5-1.8.11 instead. Here I recorded the commands that I used for installing the hdf501.8.11 library and blasr as follows.


# download and install hdf5-1.8.11
wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.11/src/hdf5-1.8.11.tar.gz
tar -xvzf hdf5-1.8.11.tar.gz
cd hdf5-1.8.11
./configure --enable-cxx --prefix=/home/yjx/local/lib/libhdf5 --with-zlib=/home/yjx/local/lib/libhdf5
# I don't have the root permission so I installed this library locally under my home directory (/home/yjx). 
# You can use "--prefix=/usr/local/lib/libhdf5 --with-zlib=/usr/local/lib/libhdf5" instead if you have root permission.

make check > check.out
# Please check the content of the check.out file generated here to make sure everything is OK
make install > install.log
cd ..

# download and install blasr
wget https://github.com/PacificBiosciences/blasr/archive/smrtanalysis-2.2.tar.gz
tar -xvzf smrtanalysis-2.2.tar.gz
cd blasr-smrtanalysis-2.2
# edit the common.mk file to set the path to your hdf library like this:
HDF5INCLUDEDIR ?= /home/yjx/local/lib/libhdf5/include
HDF5LIBDIR     ?= /home/yjx/local/lib/libhdf5/lib

# Now we are ready to compile blasr. Just type "make":
# We probably want to put the executable files that we compiled into a dedicated directory.
make install ASSEMBLY_HOME=/home/yjx/Programs/smrtanalysis/analysis 
# Now you should see all the executable files were copied to the following directory:
# Then, add this path to your .bashrc or .bash_profile file.
export PATH
# also add the following line:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yjx/local/lib/libhdf5/lib
# now restart a login session and type "blasr -h" to test. You should see the help information for 
# blasr correctly displayed.

 blasr -h
   Options for blasr 
   Basic usage: 'blasr reads.{fasta,bas.h5} genome.fasta [-options] 
 option    Description (default_value).

 Input Files.
   reads.fasta is a multi-fasta file of reads.  While any fasta file is valid input, 
               it is preferable to use pls.h5 or bas.h5 files because they contain
               more rich quality value information.

   reads.bas.h5|reads.pls.h5 Is the native output format in Hierarchical Data Format of 
               SMRT reads. This is the preferred input to blasr because rich quality
               value (insertion,deletion, and substitution quality values) information is 
               maintained.  The extra quality information improves variant detection and mapping