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

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

Development

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

See the testing guide and release instructions.

Metadata

Release files for mhctools 4.1.0

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.1.0
File Size Uploaded Provenance
mhctools-4.1.0.tar.gz 1.1 MB Without provenance Details

Built distribution (wheel)

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

Total release size: 2.0 MB

Release files / mhctools-4.1.0.tar.gz

Download URL mhctools-4.1.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
49ab0a286563f6f6a24ca6a2c2c8d0bd58e68d5644393d16c0bc2f1e8d1f6d36
BLAKE2b-256 checksum
How to use checksums
e65c0c5b72e14eb63b1d4cecee36f3bd0454ae61505af07fb7bee2c4915c3944
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

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

Download URL mhctools-4.1.0-py3-none-any.whl
Size 888.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8aafa603932db4f90ac79b31a4f32350ee2e37b1d48c342d0fc7664478c753f
BLAKE2b-256 checksum
How to use checksums
569a1f5440b0cb5cb15be407113983394c3fa7db5391e895ea282912fe9f8a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Security for mhctools 4.1.0

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.

Release history Release notifications | RSS feed

This release

4.1.0 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