Metadata-Version: 2.4
Name: mhctools
Version: 3.46.6
Summary: Python interface to MHC binding, presentation, immunogenicity, and antigen processing predictors
Author-email: Alex Rubinsteyn <alex@openvax.org>, Julia Kodysh <julia@openvax.org>, Tim O'Donnell <tim@openvax.org>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/openvax/mhctools
Project-URL: Documentation, https://openvax.github.io/mhctools/
Project-URL: Source, https://github.com/openvax/mhctools
Project-URL: Issues, https://github.com/openvax/mhctools/issues
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<2.0.0,>=1.26.0; python_version < "3.10"
Requires-Dist: numpy<3.0.0,>=2.0.0; python_version >= "3.10"
Requires-Dist: pandas>=0.13.1
Requires-Dist: pyensembl<3.0.0,>=2.3.0
Requires-Dist: sercol>=0.0.2
Requires-Dist: mhcflurry>=2.0.0
Requires-Dist: mhcgnomes>=3.4.0
Requires-Dist: platformdirs>=3.0.0
Provides-Extra: pepsickle
Requires-Dist: pepsickle; extra == "pepsickle"
Provides-Extra: mixmhcpred
Requires-Dist: pandas<3; extra == "mixmhcpred"
Requires-Dist: scipy; extra == "mixmhcpred"
Requires-Dist: logomaker; extra == "mixmhcpred"
Requires-Dist: matplotlib; extra == "mixmhcpred"
Provides-Extra: nettcr
Requires-Dist: ai-edge-litert; extra == "nettcr"
Provides-Extra: caphla
Requires-Dist: torch>=1.12; extra == "caphla"
Provides-Extra: mixtcrpred
Requires-Dist: torch>=1.12; extra == "mixtcrpred"
Requires-Dist: torchvision; extra == "mixtcrpred"
Requires-Dist: pytorch-lightning>=1.6; extra == "mixtcrpred"
Requires-Dist: scipy; extra == "mixtcrpred"
Requires-Dist: scikit-learn; extra == "mixtcrpred"
Provides-Extra: vaccine-report
Requires-Dist: matplotlib; extra == "vaccine-report"
Provides-Extra: docs
Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: ruff<0.17,>=0.15.21; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Dynamic: license-file

[![Tests](https://github.com/openvax/mhctools/actions/workflows/tests.yml/badge.svg)](https://github.com/openvax/mhctools/actions/workflows/tests.yml)
[![PyPI](https://img.shields.io/pypi/v/mhctools.svg?maxAge=1000)](https://pypi.org/project/mhctools/)
[![Python versions](https://img.shields.io/pypi/pyversions/mhctools.svg)](https://pypi.org/project/mhctools/)
[![License](https://img.shields.io/pypi/l/mhctools.svg)](https://github.com/openvax/mhctools/blob/master/LICENSE)
[![Docs](https://img.shields.io/badge/docs-openvax.github.io%2Fmhctools-blue)](https://openvax.github.io/mhctools/)

# 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](https://openvax.github.io/mhctools/predictors/binding/#netmhcpan) and [MHCflurry](https://openvax.github.io/mhctools/predictors/binding/#mhcflurry), with results you can inspect
in Python or export as a pandas DataFrame.

Read the [getting started guide](https://openvax.github.io/mhctools/getting-started/)
or browse the [documentation](https://openvax.github.io/mhctools/).

## Install and predict

```sh
pip install mhctools
mhctools fetch mhcflurry
```

```python
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](https://openvax.github.io/mhctools/results/).

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](https://openvax.github.io/mhctools/artifacts/) explains
downloads, optional backends, and licensing.

## Guides

- [Choosing a predictor](https://openvax.github.io/mhctools/choosing/) and
  [known limits](https://openvax.github.io/mhctools/limitations/)
- [Predictor matrix](https://openvax.github.io/mhctools/predictor-matrix/): Python classes, CLI names, inputs, and installation routes
- [Recipes](https://openvax.github.io/mhctools/recipes/): protein scans, multiple samples, and table annotation
- [Command line](https://openvax.github.io/mhctools/cli/)
- [Peptidase activity](https://openvax.github.io/mhctools/cleavage/),
  [vaccine reports](https://openvax.github.io/mhctools/vaccine-reports/), and
  [benchmarks](https://openvax.github.io/mhctools/benchmarks/)

## Development

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

See the [testing guide](https://openvax.github.io/mhctools/testing/) and
[release instructions](RELEASING.md).
