Skip to content
Snippets Groups Projects
intro.rst 2.35 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
Tim O'Donnell's avatar
Tim O'Donnell committed
aims to provide 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 mass spec-identified MHC I
ligands and peptide/MHC affinity measurements deposited in IEDB (plus a few other
sources) or train a MHCflurry predictor on your own data.

Starting in version 1.6.0, the default MHCflurry binding affinity predictors
are "pan-allele" models that support most sequenced MHC I alleles across humans
and a few other species (about 14,000 alleles in total). This version also
introduces two experimental predictors, an "antigen processing" predictor
that attempts to model MHC allele-independent effects such as proteosomal
cleavage and a "presentation" predictor that integrates processing predictions
with binding affinity predictions to give a composite "presentation score." Both
models are trained on mass spec-identified MHC ligands.

MHCflurry supports Python 3.4+. It uses the `keras <https://keras.io>`__
Tim O'Donnell's avatar
Tim O'Donnell committed
neural network library via either the Tensorflow or Theano backends. GPUs may
Tim O'Donnell's avatar
Tim O'Donnell committed
optionally be used for a modest speed improvement.

If you find MHCflurry useful in your research please cite:

Tim O'Donnell's avatar
Tim O'Donnell committed
    T. J. O’Donnell, et al., "MHCflurry: Open-Source Class I MHC Binding Affinity
    Prediction," *Cell Systems*, 2018.
    https://www.cell.com/cell-systems/fulltext/S2405-4712(18)30232-1.

If you have questions or encounter problems, please file an issue at the
MHCflurry github repo: https://github.com/openvax/mhcflurry


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<2.0.0'
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