Installing and running khmer

You’ll need Python 2.7+ and internet access.

The khmer project currently works with Python 2.6 but we target Python 2.7+.

Build requirements

OS X

#) If you just what to use the khmer project tools and not develop them then skip to step 4).

  1. Install Xcode from the Mac App Store (requires root)
  2. Register as an Apple Developer.
  3. Install the Xcode command-line tools: Xcode -> preferences -> Downloads -> Command Line Tools (requires root)

#) From a terminal install virtualenv. You’ll need the URL of the latest virtualenv release.

curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.x.y.tar.gz
tar xzf virtualenv*
cd virtualenv-*; python virtualenv.py ../khmerEnv; cd ..
source khmerEnv/bin/activate

Linux

#) Install the python development environment, virtualenv, pip, and gcc.

On recent Debian and Ubuntu this can be done with:

sudo apt-get install python2.7-dev python-virtualenv python-pip gcc

For RHEL6:

sudo yum install -y python-devel python-pip git gcc gcc-c++ make
sudo pip install virtualenv
  1. Create a virtualenv and activate it:

    cd a/writeable/directory/
    virtualenv khmerEnv
    source khmerEnv/bin/activate

Linux users without root access can try step 4) from the OS X instructions above

Latest stable release

  1. Check your pip version:

    pip --version
    
  2. Use pip to download, build, and install khmer and its dependencies.

If you’re running version 1.5 or greater of pip::
pip install –allow-external argparse khmer
For pip version 1.4.1 and earlier::
pip install khmer
  1. The scripts are now in the env/bin directory and ready for your use. You can directly use them by name, see khmer’s command-line interface.
  1. When returning to khmer after installing it you will need to reactivate the virtualenv first:

    source khmerEnv/bin/activate

Latest development branch

Repeat the above but modify the pip install line.

If you’re running version 1.5 or greater of pip then:

pip install --allow-external argparse git+https://github.com/ged-lab/khmer.git@master#egg=khmer

For pip version 1.4.1 and earlier:

pip install git+https://github.com/ged-lab/khmer.git@master#egg=khmer

You can change master in the above command to the name of another branch.

Run the tests

If you’re running a version of pip less than 1.4 and you want to run the tests then you should upgrade pip:

pip install --user --upgrade pip

Repeat the appropriate installation procedure from above but add “–no-clean” to the pip invocation.

The source will be in the khmerEnv/build/khmer directory. Run make test there.

comments powered by Disqus

Table Of Contents

Previous topic

Introduction to khmer

Next topic

A few examples

This Page

Edit this document!

This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.

  1. Go to Installing and running khmer on GitHub.
  2. Edit files using GitHub's text editor in your web browser (see the 'Edit' tab on the top right of the file)
  3. Fill in the Commit message text box at the bottom of the page describing why you made the changes. Press the Propose file change button next to it when done.
  4. Then click Send a pull request.
  5. Your changes are now queued for review under the project's Pull requests tab on GitHub!

For an introduction to the documentation format please see the reST primer.