Metadata-Version: 2.4
Name: fennomix-mhc
Version: 0.0.1.dev0
Summary: FennOmix-MHC
Author-email: Wen-Feng Zeng <zengwenfeng@westlake.edu.cn>, Jin-Tao Cheng <1274873858@qq.com>
Maintainer-email: Wen-Feng Zeng <zengwenfeng@westlake.edu.cn>, Jin-Tao Cheng <1274873858@qq.com>
Project-URL: Homepage, https://fennomix.lab.westlake.edu.cn
Project-URL: Documentation, https://readthedocs.org
Project-URL: Repository, https://github.com/FennOmix/fennomix.mhc.git
Project-URL: Bug Tracker, https://github.com/FennOmix/fennomix.mhc/issues
Project-URL: Changelog, https://github.com/FennOmix/fennomix.mhc/blob/main/CHANGELOG.md
Keywords: contrastive learning,protein language model,immunopeptidomics,mass spectrometry,HLA,MHC,peptide-MHC binding prediction
Classifier: Development Status :: 1 - Planning
Classifier: Programming Language :: Python
Requires-Python: <3.12,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: alphabase
Requires-Dist: peptdeep
Requires-Dist: pydivsufsort
Requires-Dist: fair-esm
Requires-Dist: matplotlib
Requires-Dist: pre-commit
Requires-Dist: click
Requires-Dist: faiss-cpu
Requires-Dist: logomaker
Requires-Dist: plotly
Requires-Dist: umap-learn
Provides-Extra: stable
Provides-Extra: tests
Requires-Dist: coverage; extra == "tests"
Requires-Dist: coverage-badge; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: neptune; extra == "tests"
Provides-Extra: docs
Provides-Extra: development
Requires-Dist: jupyter; extra == "development"
Requires-Dist: jupyter_contrib_nbextensions; extra == "development"
Requires-Dist: bump-my-version; extra == "development"
Requires-Dist: pipdeptree; extra == "development"
Requires-Dist: ipykernel; extra == "development"
Requires-Dist: pre-commit==3.7.0; extra == "development"
Requires-Dist: neptune; extra == "development"
Requires-Dist: coverage; extra == "development"
Requires-Dist: coverage-badge; extra == "development"
Requires-Dist: pytest; extra == "development"
Requires-Dist: neptune; extra == "development"
Dynamic: license-file

# FennOmix-MHC

Foundation model for MHC class I peptide binding prediction built on deep contrastive learning.

See the [online documentation](https://fennomix.mhc.readthedocs.io/en/latest) for
full API details and tutorials.

## Installation

Install the latest release from PyPI:

```bash
pip install fennomix-mhc
```

Or install the development version directly from GitHub:

```bash
pip install git+https://github.com/FennOmix/FennOmix.MHC.git
```

## Command line interface

After installation the `fennomix-mhc` command exposes several sub-commands.  The examples below assume your peptide or protein sequences are stored in FASTA or tabular files.

### Embed MHC proteins

```bash
fennomix-mhc embed-proteins --fasta my_hla.fasta --out-folder ./output
```

### Embed peptides

```bash
fennomix-mhc embed-peptides --peptide-file peptides.tsv --out-folder ./output
```

### Predict epitopes for MHC alleles

```bash
fennomix-mhc predict-epitopes-for-mhc --peptide-file peptides.tsv \
    --alleles A02_01,B07_02 --out-folder ./output
```

### Predict MHC binders for given epitopes

```bash
fennomix-mhc predict-mhc-binders-for-epitopes --peptide-file peptides.tsv \
    --out-folder ./output
```

Additional commands `deconvolute-peptides` and `deconvolute-and-predict-peptides` are also available.

## Pipeline API

All functionality of the command line interface is available through the `fennomix_mhc.pipeline_api` module:

```python
from fennomix_mhc.pipeline_api import (
    embed_proteins,
    embed_peptides_from_file,
    predict_epitopes_for_mhc,
    predict_mhc_binders_for_epitopes,
)

# compute and save embeddings
embed_proteins("my_hla.fasta", "./output")
embed_peptides_from_file("peptides.tsv", "./output")

# run predictions using the saved files
predict_epitopes_for_mhc(
    "peptides.tsv",
    ["A02_01"],
    "./output",
)
```
