mhctools
mhctools is a Python library for running MHC binding, presentation, immunogenicity, and antigen-processing predictors. It provides a common interface to tools such as NetMHCpan and MHCflurry, with results you can inspect in Python or export as a pandas DataFrame.
Read the getting started guide or browse the documentation.
Install and predict
pip install mhctools
mhctools fetch mhcflurry
from mhctools import MHCflurry
predictor = MHCflurry(alleles=["HLA-A*02:01", "HLA-B*07:02"])
results = predictor.predict(["SIINFEKL", "GILGFVFTL"])
for result in results:
affinity = result.affinity
if affinity is not None:
print(result.peptide, affinity.allele, affinity.value)
Each result corresponds to one input peptide. The affinity accessor selects
the strongest prediction across alleles, with IC50 in nM. Use
predict_dataframe() for a pandas table or predict_proteins() to scan protein
sequences. See results and DataFrames.
Most predictors need model weights or an external installation. Use
mhctools ls to locate models and mhctools predictors to check which can run.
The installation guide explains
downloads, optional backends, and licensing.
Guides
- Choosing a predictor and known limits
- Predictor matrix: Python classes, CLI names, inputs, and installation routes
- Recipes: protein scans, multiple samples, and table annotation
- Command line
- Peptidase activity, vaccine reports, and benchmarks
Development
./develop.sh
./lint.sh
./test.sh
See the testing guide and release instructions.
Metadata
Release files for mhctools 3.46.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mhctools-3.46.6.tar.gz | 538.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mhctools-3.46.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 851.3 kB
Release files / mhctools-3.46.6.tar.gz
| Download URL | mhctools-3.46.6.tar.gz |
|---|---|
| Size | 538.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ee2a56c0a5224e1cdeed25000520a6e65a4c2588d35bfc5302aefd627bd9491
|
|
BLAKE2b-256 checksum How to use checksums |
5ed3b5182d19184bfda79b3684056cc40bef92358218d4584ed429d16bf5c09c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|
Release files / mhctools-3.46.6-py3-none-any.whl
| Download URL | mhctools-3.46.6-py3-none-any.whl |
|---|---|
| Size | 312.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a32ae711aab7c80ebc117a12726613b8281c524370ba60f4b042f28570c99e10
|
|
BLAKE2b-256 checksum How to use checksums |
f1c1a1ece03aeae962e82ecdfab7427283f5552e5bb5a7380e91fec6386464be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|