Installing libsequence and analysis tools on OSX

After being relegated to the margins of biology for almost a century, the field of population genetics is now moving closer the the center of mainstream biology in the era of next-generation sequencing (NGS). In addition to providing genome-wide DNA variation data to study classical questions in evolution that are motivated by population genetic theory, NGS now permits population-genetic based techniques like GWAS (genome-wide association studies) and eQTL (expression quantitative trait locus) analysis to allow biologists to identify and map functional regions across the genome.

Handling big data requires industrial strength bioinformatics tool-kits, which are increasingly available for many aspects of genome bioinformatics (e.g. the Kent source tree, SAMtools, BEDtools, etc.). However, for molecular population genetics at the command line, researchers have a more limited palette that can be used for genome-scale data, including: VariScan, the PERL PopGen modules, and the libsequence C++ library.

Motivated by a recent question on BioStar and a request from a colleague to generate a table of polymorphic sites across a bacterial genome, I’ve recently had a play with the last of these — Kevin Thornton’s libsequence and accompanying analysis toolkit — which includes a utility called compute which is a “mini-DNAsp for the Unix command-line.” As ever, getting this installed on OSX was more of a challenge than desired, with a couple of dependencies (including Boost and GSL), but in the end was do-able as follows:

$ wget
$ tar -xvzf boost_1_47_0.tar.gz
$ cd boost_1_47_0
$ ./
$ sudo ./b2 install
$ cd ..

$ wget
$ tar -xvzf libsequence-1.7.3.tar.gz
$ cd libsequence-1.7.3
$ ./configure
$ make
$ sudo make install
$ cd ..

$ wget
$ tar -xvzf gsl-1.15.tar.gz
$ cd gsl-1.15
$ ./configure --disable-shared --disable-dependency-tracking
$ make
$ sudo make install
$ cd ..

$ wget
$ tar -xvzf analysis-0.8.0.tar.gz
$ cd analysis-0.8.0
$ ./configure
$ make
$ sudo make install
$ cd ..

With this recipe, compute and friends should now be happily installed in /usr/local/bin/.

Notes: This protocol was developed on a MacBook Air Intel Core 2 Duo running OSX 10.6.8.

Enhanced by Zemanta


  1. timflutre

    Bio++ ( seems to be also an interesting library, although I never used it: “Bio++ is a set of C++ libraries for Bioinformatics, including sequence analysis, phylogenetics, molecular evolution and population genetics. Bio++ is fully Object Oriented and is designed to be both easy to use and computer efficient.” According to the documentation, there is no dependency, and the build system uses CMake.

  2. boudin

    hehe…doesn’t work

    $ compute
    compute: error while loading shared libraries: cannot open shared object file: No such file or directory

  3. caseybergman

    Hi @boudin – can you send the complete transcript or overview of your installation? Just having this last fragment doesn’t really help answer why you are having troubles.

  4. Hi Casey,

    Have you used Homebrew much? I’m finding it works much better than Macports etc (not that you used either of those here) and doing an update of the software is as easy as a ‘brew update && brew upgrade’.

    Doing a:

    brew install boost && brew install gsl

    followed by:

    wget -c && wget -c

    and associated extraction and compilation has things up and running in no time. Although this still requires manual steps for libsequence and analysis, the automated install of the earlier stages makes it much easier to keep the software up-to-date.



  5. caseybergman

    Thanks for this! I have tried homebrew for a few things, but still mostly using Fink because it has bioperl. I will be sure to give homebrew a proper test drive one day.

  6. I forgot to add, that you need to download either the ICU4C binary or source (which will need building and installing) before doing the boost install. Boost.Regex needs the ICU GCC components.

    Downloading the binaries and copying them to /usr/local worked fine for me 🙂

1 Trackbacks/Pingbacks

  1. Getting libsequence and Boost to Play Nice | Monkeyologist 03 04 13

Add Your Comment