Metadata-Version: 2.4
Name: fine-t-cell
Version: 1.0.1
Summary: Predict T-cell response for peptide sequences with the FINE-T model
Author-email: Josua Stadelmaier <josua.stadelmaier@gmail.com>
License-Expression: AGPL-3.0-only
Project-URL: Homepage, https://github.com/JosuaStadelmaier/T-cell-response-prediction
Project-URL: Paper, https://link.springer.com/article/10.1186/s12859-026-06492-2
Keywords: T-cell response,immunogenicity,epitope,peptide,MHC,transformer
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=1.10
Requires-Dist: pandas>=1.4
Requires-Dist: numpy>=1.21
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# FINE-T

Predict T-cell response for peptide sequences with FINE-T, the fine-tuned transformer model
of the paper
["Transfer learning for T-cell response prediction"](https://link.springer.com/article/10.1186/s12859-026-06492-2)
by Josua Stadelmaier, Brandon Malone, and Ralf Eggeling, published in BMC Bioinformatics.

FINE-T is fine-tuned per peptide source and MHC class, and this package provides the models
for human peptides of MHC class I and MHC class II. The models only take the peptide sequence
as input.

For training the model and for reproducing the domain-aware evaluation of the paper, use the
scripts of the [repository](https://github.com/JosuaStadelmaier/T-cell-response-prediction).

## Installation

```
pip install fine-t-cell
```

This provides the `fine-t-cell` command and the `finetcell` Python package.

For a faster installation, use PyTorch without CUDA support since the FINE-T models are
small enough to run on a CPU:

```
pip install --index-url https://download.pytorch.org/whl/cpu torch numpy
pip install fine-t-cell
```

## Usage

```
fine-t-cell --peptides peptides.csv --mhc I --source human
```

The file with the peptides is a CSV file with a peptide column (`Epitope Description` or
`peptide`), a CSV file with a single column, or a text file with one peptide per line.
The predictions are written next to it, or to the path given by `--predictions_file`.

`--source` currently only accepts `human`, since the models that are fine-tuned on other
peptide sources are not part of this package.

`--mhc` is either `I` or `II` and selects the model trained specifically for the respective
MHC class. So use as input the peptides of one MHC class at a time.

From Python:

```python
import finetcell

predictions = finetcell.predict(['GILGFVFTL', 'NLVPMVATV'], mhc='I', source='human')
```

`finetcell.predict` returns a DataFrame with the peptides and their predictions.

Peptides need to consist of the 20 standard amino acids and they can be at most 28 amino
acids long, which is the longest peptide that the positional encodings of the model support.
Peptides that contain other characters, such as `X`, and peptides that are longer are
printed with the reason for skipping them, and they are left out of the predictions.

## Tests

The tests check that the package reproduces the predictions of the repository scripts.
They are part of the source code, so run them from a clone of the repository:

```
pip install -e .[test]
pytest tests
```

## License

FINE-T is licensed under the GNU Affero General Public License v3.0, see `LICENSE`.

## Citation

Stadelmaier, J., Malone, B. & Eggeling, R. Transfer learning for T-cell response prediction.
*BMC Bioinformatics* **27**, 124 (2026). <https://link.springer.com/article/10.1186/s12859-026-06492-2>
