Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Python interface to libsequence.

Project description

This package provides Python bindings for the C++11 library libsequence.

The bindings are implemented using pybind11.

This package serves two roles:

  • It provides a means of using some of the more widely-used bits of libsequence within the Python language
  • The unit tests of this package also serve as unit tests for libsequence.

What this package does not (currently) do:

  • provide an interface for I/O operations. Python I/O and C++ I/O are fundamentally very different. Bridging the gap requires either adding features to pybind11 and/or adding modules to this package that depend on the boost Python interface, which would add an additional C++ dependency to this package.

Build status

Master branch:

Travis CI Build Status (master branch)

Development branch:

Travis CI Build Status (dev branch)

Requirements:

  • libsequence must be installed on your system. Currently, this package requires the dev branch of libsequence
  • TBB must be installed on your system.
  • Python 2 or Python 3
  • An up-to-date C++ compiler that is C++11 compatible via the flag -std=c++11. Roughly, this means GCC >= 4.8 and clang >= 3.5.

Note

If you installing from GitHub, then pybind11 is a dependency.

The recommended method for installing libsequence is bioconda. If you do not use that system, then you should install libsequence from source.

If you want to modify the package, you will need pybind11 installed via your favorite Python package manager.

The supported platforms are Linux and OS X.

Changelog (rough)

  • 0.2.0: The package has been completely refactored. We now use pybind11 to integrate C++ and Python. Previous versions of this project used Cython. The API now corrresponds to libsequence 1.9.2. Python >= 3.4 is required.
  • 0.1.9: Made memory management more robust: more unique_ptr instead of raw pointers. Cleanup __dealloc__ functions in extension types. Package now sets __version__. Class names are now “Pythonic” (and identical to the corresponding type names from libsequence) due to aliasing the C++ names from libsequence. Change from distutils to setuptools. Documentation fixes. Expose haplotype diversity and number of haplotype statistics. First (very alpha) release of pymsstats.
  • 0.1.8: made sure C++ objects/fxns are declared “nogil”. Raw pointers replaced with C++’s unique_ptr.
  • 0.1.7: improvements to build system. Add option to build from GitHub.
  • 0.1.6: update to libsequence 1.8.9. Add –use-cython option to setup.py

Installation:

The latest release of the package is available via PyPi, and can be installed with your favorite Python package manager:

$ pip install --upgrade pylibseq

Or, you may install from GitHub:

Note

The GitHub version does not contain the .cpp files generated by pybind11. You need to generate those!

$ git clone http://github.com/molpopgen/pylibseq
$ cd pylibseq
$ ./configure
$ sudo pip install .

Note

If you are using GCC on OS X (instead of clang), add –install-option=–gcc when installing.

You may also install from GitHub using pip:

$ pip install git+git://github.com/molpopgen/pylibseq

If you have libsequence in a “funny location” (e.g., something other that /usr/local):

$ CPPFLAGS=-I/path/to/libsequence/headers LDFLAGS=-L/path/to/libsequence/library sudo python setup.py install

For example, if libsequence is installed into /opt:

$ CPPFLAGS=-I/opt/include LDFLAGS=-L/opt/lib sudo python setup.py install

Unit testing:

$ ./configure
$ python setup.py build_ext -i
$ python -m unittest discover tests

Note

If using GCC on OS X (instead of clang), add –gcc to the setup.py command

Documentation:

Project details


Release history Release notifications

This version
History Node

0.2.0

History Node

0.2.0a0

History Node

0.1.9.post0

History Node

0.1.9

History Node

0.1.8

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4-1

History Node

0.1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pylibseq-0.2.0.tar.gz (99.2 kB) Copy SHA256 hash SHA256 Source None Oct 25, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page