Skip to main content

Tests PyPI Python versions License Docs

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

Requires Python 3.11 or later and pandas 3.x.

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.

Command line

Run mhctools --help to see commands and prediction options, or mhctools --version to identify the installed release.

Enable Bash/zsh tab completion for this shell:

eval "$(register-python-argcomplete mhctools)"

Alternatively, run activate-global-python-argcomplete once and start a new shell to enable completion for all participating OpenVax tools. See the command-line guide for details.

Guides

Development

./develop.sh
./lint.sh
./test.sh

See the testing guide and release instructions.

Metadata

Release files for mhctools 4.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mhctools 4.8.1
File Size Uploaded Provenance Actions
mhctools-4.8.1.tar.gz 1.2 MB Without provenance Details for mhctools-4.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mhctools 4.8.1
File Interpreter ABI Platform Actions
mhctools-4.8.1-py3-none-any.whl Python 3 none any Details for mhctools-4.8.1-py3-none-any.whl

Total release size: 2.1 MB

Release files / mhctools-4.8.1.tar.gz

Download URL mhctools-4.8.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
5f976ec19a5bb8466eb53626136d223c31b1375466753402b711f0a19339d609
BLAKE2b-256 checksum
How to use checksums
bec37c61bfe06ad0e3c999e9e4eb83adac6576f1f1b112fa06d1bdfc136f4c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.10

Release files / mhctools-4.8.1-py3-none-any.whl

Download URL mhctools-4.8.1-py3-none-any.whl
Size 902.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ad43a9923dc066aa1dc8f29432ecde709ab759adcd5a2943cd8ea065b031592
BLAKE2b-256 checksum
How to use checksums
1aa1c40ab2cc7b2bcc60286db25cf2efd8c5d3af5294283fc43e301de80b3afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.10

Security for mhctools 4.8.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.8.1 This release

2 release files No provenance

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page