This release is a pre-release and may not be stable for production use.
MHCflurry
MHCflurry predicts which peptides are likely to be displayed by MHC class I molecules. It provides pretrained models for three related tasks:
- Binding affinity: how strongly a peptide binds an MHC allele.
- Antigen processing: whether cellular processing favors the peptide.
- Presentation: a combined score using binding and processing predictions.
You can use the released models from the command line or Python, scan proteins for candidate epitopes, or train models on your own data.
Quick start
Install MHCflurry, including prereleases, and download the pretrained presentation models:
pip install --upgrade --pre mhcflurry
mhcflurry downloads fetch models_class1_presentation
Omit --pre to install the latest stable release.
Predict a few peptides:
mhcflurry predict \
--alleles HLA-A0201 HLA-A0301 \
--peptides SIINFEKL SIINFEKD SIINFEKQ \
--out predictions.csv
Or scan a protein sequence for candidate ligands:
mhcflurry predict-scan \
--sequences MFVFLVLLPLVSSQCVNLTTRTQLPPAYTNSFTRGVYYPDKVFRSSVLHS \
--alleles 'HLA-A*02:01' \
--out scan.csv
To try MHCflurry without installing anything, open the Colab notebook.
The historical mhcflurry-* command names remain supported for existing
scripts. See the 2.3.0 release notes for details.
Documentation
- Introduction and installation
- Command-line tutorial
- Python tutorial
- Training models
- Command reference
- API reference
Please file an issue if you have questions or encounter problems.
Citing MHCflurry
If you use MHCflurry in your research, please cite:
T. O'Donnell, A. Rubinsteyn, U. Laserson. "MHCflurry 2.0: Improved pan-allele prediction of MHC I-presented peptides by incorporating antigen processing," Cell Systems, 2020. https://doi.org/10.1016/j.cels.2020.06.010
T. O'Donnell, A. Rubinsteyn, M. Bonsack, A. B. Riemer, U. Laserson, and J. Hammerbacher, "MHCflurry: Open-Source Class I MHC Binding Affinity Prediction," Cell Systems, 2018. https://doi.org/10.1016/j.cels.2018.05.014
Development
Contributions are welcome. Start with CONTRIBUTING.md; the testing guide describes the fast local checks and full suite.
Docker
Run the latest image from Docker Hub:
docker run -p 9999:9999 --rm openvax/mhcflurry:latest
Then open http://localhost:9999 to use the included Jupyter environment. To
build the image from a checkout:
docker build -t mhcflurry:latest .
docker run -p 9999:9999 --rm mhcflurry:latest
More resources
Release files for mhcflurry 2.3.0rc20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mhcflurry-2.3.0rc20.tar.gz | 545.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mhcflurry-2.3.0rc20-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 987.8 kB
Release files / mhcflurry-2.3.0rc20.tar.gz
| Download URL | mhcflurry-2.3.0rc20.tar.gz |
|---|---|
| Size | 545.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
489fef04cbafec477dd88aa07c2980851d983e97a9dba49ddd559f2c02a6278d
|
|
BLAKE2b-256 checksum How to use checksums |
853ac90a16e94579742e20d5568a3b16d16654eb7b4bfa34326a6d5f7d752032
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logRelease files / mhcflurry-2.3.0rc20-py3-none-any.whl
| Download URL | mhcflurry-2.3.0rc20-py3-none-any.whl |
|---|---|
| Size | 442.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8423c8818a1214a34dd47dbb0c75223be3168a4b555ee087580c1c642c88bb6
|
|
BLAKE2b-256 checksum How to use checksums |
247e55573f3e69c517aaa3104eb6a7662f197c4f741fffd833f737bd98dd683b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency log