Installation

Bioconda

install with bioconda

Bioconda is a channel for the conda package manager with a focus on bioinformatics software. Once you have Bioconda installed, installing plastid is as easy as running:

$ conda create -n plastid plastid
$ source activate plastid

This will install all of the necesary dependencies for plastid in an isolated environment.

PyPi

Install package

Stable versions of plastid can be fetched from PyPi using Pip. Due to some quirks in Python packaging Cython, numpy , pysam must be installed first:

Simply type from the terminal:

$ sudo pip install numpy pysam cython
$ sudo pip install plastid

or, for a single-user install:

$ pip install --user numpy pysam cython
$ pip install --user plastid

Test your installation within Python:

>>> import plastid

If installation fails with a message that an object in numpy or pysam is the wrong size, the included C files may need to be regenerated.

To do so, first make sure all the dependencies are installed. Then type:

$ pip install --verbose --user --no-cache-dir --install-option="--recythonize" plastid

And then re-test the installation. If installation continues to fail, please see Installation fails in pip with no obvious error message for common errors or our issue tracker to report a new one.

Set PATH variable

Command-line scripts will be installed wherever system configuration dictates. On OSX and many varities of linux, the install path for a single-user install is ~/bin or ~/.local/bin. For system-wide installs, the path is typically /usr/local/bin. Make sure the appropriate location is in your PATH by adding to your .bashrc, .bash_profile, or .profile:

export PATH=~/bin:~/.local.bin:/usr/local/bin:$PATH

Also, type the line above in any open terminal (or login and out again) to apply the changes.

Inside a virtualenv

Often users or systems administrators need to install multiple versions of the same package for different scientific purposes. To do so they use sandboxes that insulate packages from each other.

The easiest way to install Plastid inside a sandbox is to use virtualenv:

# install virtualenv if you don't have it.
# use either "sudo" or "--user", not both.

# Use this line for a system-wide install
$ sudo pip install virtualenv

# or, use this line for single user install
$ pip install --user virtualenv

# With virtualenv installed, create & activate vanilla environment
# when prompted, do NOT give the virtualenv access to system packages

# create
$ virtualenv ~/some/path/to/venv

# activate
$ source ~/some/path/to/venv/bin/activate

# Fresh install of plastid.
# Note- no use of `sudo` here. It confuses the virtualenv
(venv) $ pip install numpy pysam cython
(venv) $ pip install --no-cache-dir plastid

# test
(venv) $ python -c "from plastid import *"

Development versions

To fetch the latest development versions, clone it from our github repository. From the terminal:

# get the source
$ git clone git://github.com/joshuagryphon/plastid.git

# Do to a quirk in Python setup scripts (fixed in new versions of pip),
# numpy, cython, and pysam must must be installed first:
$ pip install --user --upgrade numpy pysam

# Install in develop mode. Use `--recythonize` flag to regenerate
# C files if necessary (e.g. after upgrading pysam)
$ cd plastid
$ pip install --install-option='--recythonize' --user -e .

Non-Python Dependencies

Plastid has a number of non-Python dependencies:

  • A full build system for C compiling (e.g. GCC or clang)
  • zlib, including its headers

The following are not required for full functionality, but are required for specific functions or just plain useful:

Troubleshooting

plastid installs fairly easily in most Linux and Macintosh setups. If you run into issues running or installing, please see our FAQ section on installation and then our issue tracker to see if anybody else has encountered your issue, and if instructions already exist.

Frequently, problems can be solved by installing plastid in a clean environment. For instructions, see Inside a virtualenv, above.

For other troubleshooting, please see our FAQ section on installation.