Skip to main content
immunotype logo

Peptide-based HLA typing from immunopeptidomics data

CI PyPI version Python versions License: MIT Hugging Face Space

immunotype predicts HLA class I alleles directly from immunopeptidomics data — no separate HLA typing experiment needed. immunotype combines a graph neural network with a curated mono-allelic lookup table in an ensemble model, achieving 87.2% accuracy at protein-level resolution across diverse human tissues.

🚀 Quick Start

Installation

# Core CLI functionality
pip install immunotype

Command Line Interface

 Usage: immunotype [OPTIONS] PEPTIDE_INPUT TYPING_OUTPUT

 Predict HLA typing from immunopeptide sequences.
 This tool uses graph neural networks and lookup tables to predict HLA allele typing from immunopeptidomics data. Provide a peptide input file and optionally customize the HLA alleles to consider.

╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  PEPTIDE_INPUT       PATH                   TSV input file. Either a single column of peptides or two columns with sample IDs and peptides. [required]                │
│ *  TYPING_OUTPUT       PATH                   Path to save the typing output. [required]                                                                                │
│    --prob-output       PATH                   Save detailed HLA probabilities to specified TSV file.                                                                    │
│    --hla-input         PATH                   Path to the HLA input file containing alleles to consider. [default: <immunotype-package-path>/data/selected_alleles.csv] │
│    --max-n-peptides    INTEGER                Maximum number of peptides to predict at once. [default: 50000]                                                           │
│    --batch-size        INTEGER                How many samples should be predicted simultaneously. [default: 1]                                                         │
│    --prediction-model  [ensemble|gnn|lookup]  Select which model to use. [default: ensemble]                                                                            │
│    --use-gpu                                  Run prediction on GPU instead of CPU.                                                                                     │
│    --version                                  Show the version and exit.                                                                                                │
│    --help                                     Show this message and exit.                                                                                               │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
# Basic prediction
immunotype src/immunotype/examples/single_sample_input.tsv test_single_sample_typing.tsv

# With probability details
immunotype src/immunotype/examples/single_sample_input.tsv test_single_sample_typing.tsv --prob-output test_single_sample_probabilities.tsv

# Custom settings
immunotype src/immunotype/examples/single_sample_input.tsv test_single_sample_typing.tsv --batch-size 100 --prediction-model gnn

# Explore all CLI options
immunotype --help

App Interface

Try it online without installing — the hosted app on Hugging Face Spaces. Or run it locally:

# Install with app dependencies
pip install immunotype[app]

# Run the Gradio app
immunotype-app

Python API

import pandas as pd
from immunotype import predict

# Prepare data
peptides = pd.DataFrame({
    'peptide': ['ALDGRETD', 'ASDSGKYL'],
    'sample': ['sample1', 'sample1']
})

alleles = pd.DataFrame({
    'allele': ['HLA-A*02:01', 'HLA-B*07:02', 'HLA-C*07:02']
})

# Make predictions
predictions, typing = predict(
    peptide_df=peptides,
    allele_df=alleles
)

📥 Input Formats

Single-column peptides:

ALDGRETD
ASDSGKYL
AVDPTSGQ

Multi-sample format:

sample	peptide
1	ALDGRETD
1	ASDSGKYL
2	AVDPTSGQ

📤 Output

Typing (default): Top 2 alleles per locus (A, B, C) per sample.

sample	typing
sample_0	HLA-A*32:01;HLA-A*68:01;HLA-B*15:01;HLA-B*44:02;HLA-C*03:03;HLA-C*07:04

Probabilities (--prob-output): Per-allele scores from each prediction mode.

sample	locus	allele	probability_gnn	probability_lookup	probability
sample_0	A	HLA-A*01:01	0.0005	0.0000	0.0003
sample_0	A	HLA-A*02:01	0.0000	0.1945	0.0584

📝 Authors

  • Matteo Pilz
  • Jonas Scheid

📚 Citation

If you use immunotype in your research, please cite our preprint:

Pilz M, Scheid J, Bauer A, Lemke S, Sachsenberg T, Bauer J, Nelde A, Stadelmaier J, Walter A, Rammensee H-G, Nahnsen S, Kohlbacher O, Walz JS. Deep learning enables direct HLA typing from immunopeptidomics data. bioRxiv (2026). doi:10.64898/2026.04.08.717021

@article{immunotype,
  title   = {Deep learning enables direct HLA typing from immunopeptidomics data},
  author  = {Pilz, Matteo and Scheid, Jonas and Bauer, Alina and Lemke, Steffen and Sachsenberg, Timo and Bauer, Jens and Nelde, Annika and Stadelmaier, Josua and Walter, Axel and Rammensee, Hans-Georg and Nahnsen, Sven and Kohlbacher, Oliver and Walz, Juliane Sarah},
  journal = {bioRxiv},
  year    = {2026},
  doi     = {10.64898/2026.04.08.717021},
  url     = {https://doi.org/10.64898/2026.04.08.717021}
}

Metadata

Release files for immunotype 1.0.5

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

Source distribution (sdist)

Source distribution for immunotype 1.0.5
File Size Uploaded Provenance Actions
immunotype-1.0.5.tar.gz 30.6 MB With provenance Details for immunotype-1.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 61.3 MB

Release files / immunotype-1.0.5.tar.gz

Download URL immunotype-1.0.5.tar.gz
Size 30.6 MB
Tags Source
SHA-256 checksum
How to use checksums
edffd020379ca3891563239882a6879c57df159fdf1cb2d62d61473c7fab20d1
BLAKE2b-256 checksum
How to use checksums
96de3f7d106ece785e72a856bd49be427aa9ef57603e7da6c2e2c7387957549b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / immunotype-1.0.5-py3-none-any.whl

Download URL immunotype-1.0.5-py3-none-any.whl
Size 30.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b237d6bfd5364d86be5cdf4dbe5059ad19015f0beb7217fef05ce836189e14f6
BLAKE2b-256 checksum
How to use checksums
3b6ef77138c46c58316a48145c7d837a20122999ee189fbd3e7d21fe256f0aa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Security for immunotype 1.0.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for immunotype-1.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

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.

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