Skip to content
Snippets Groups Projects
intro.rst 1.87 KiB
Newer Older
Introduction and setup
=======================

Tim O'Donnell's avatar
Tim O'Donnell committed
MHCflurry is an open source package for peptide/MHC I binding affinity prediction. It
provides competitive accuracy with a fast and documented implementation.
Tim O'Donnell's avatar
Tim O'Donnell committed
You can download pre-trained MHCflurry models fit to affinity measurements
Tim O'Donnell's avatar
Tim O'Donnell committed
deposited in IEDB (and a few other sources)
or train a MHCflurry predictor on your own data.

Currently only allele-specific prediction is implemented, in which separate models
are trained for each allele. The released models therefore support a fixed set of common
Tim O'Donnell's avatar
Tim O'Donnell committed
class I alleles for which sufficient published training data is available
(see :ref:`models_supported_alleles`\ ).
Tim O'Donnell's avatar
Tim O'Donnell committed
MHCflurry supports Python versions 2.7 and 3.4+. It uses the `keras <https://keras.io>`__
neural network library via either the Tensorflow or Theano backends. GPUs may
optionally be used for a generally modest speed improvement.

If you find MHCflurry useful in your research please cite:

    O'Donnell, T. et al., 2017. MHCflurry: open-source class I MHC
    binding affinity prediction. bioRxiv. Available at:
    http://www.biorxiv.org/content/early/2017/08/09/174243.


Installation (pip)
-------------------

Install the package:

Tim O'Donnell's avatar
Tim O'Donnell committed
.. code-block:: shell
Tim O'Donnell's avatar
Tim O'Donnell committed
    $ pip install mhcflurry

Then download our datasets and trained models:

Tim O'Donnell's avatar
Tim O'Donnell committed
.. code-block:: shell
Tim O'Donnell's avatar
Tim O'Donnell committed
    $ mhcflurry-downloads fetch

From a checkout you can run the unit tests with:

Tim O'Donnell's avatar
Tim O'Donnell committed
.. code-block:: shell
Tim O'Donnell's avatar
Tim O'Donnell committed
    $ pip install nose
    $ nosetests .


Using conda
-------------

You can alternatively get up and running with a `conda <https://conda.io/docs/>`__
environment as follows. Some users have reported that this can avoid problems installing
tensorflow.

Tim O'Donnell's avatar
Tim O'Donnell committed
.. code-block:: shell
Tim O'Donnell's avatar
Tim O'Donnell committed
    $ conda create -q -n mhcflurry-env python=3.6 tensorflow
Tim O'Donnell's avatar
Tim O'Donnell committed
    $ source activate mhcflurry-env

Then continue as above:

Tim O'Donnell's avatar
Tim O'Donnell committed
.. code-block:: shell
Tim O'Donnell's avatar
Tim O'Donnell committed
    $ pip install mhcflurry
    $ mhcflurry-downloads fetch