Skip to main content

Peptide-based HLA typing from immunopeptidomics data

Project description

immunotype logo

Peptide-based HLA typing from immunopeptidomics data

CI PyPI version Python versions License: MIT

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

# 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

@software{immunotype,
  title={immunotype: Peptide-based HLA typing from immunopeptidomics data},
  author={Pilz, Matteo and Scheid, Jonas},
  url={https://github.com/AG-Walz/immunotype},
  year={2026}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

immunotype-1.0.2.tar.gz (30.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

immunotype-1.0.2-py3-none-any.whl (30.7 MB view details)

Uploaded Python 3

File details

Details for the file immunotype-1.0.2.tar.gz.

File metadata

  • Download URL: immunotype-1.0.2.tar.gz
  • Upload date:
  • Size: 30.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for immunotype-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a7412f9d343c4a8b386ecbd698176e1056f930701e61d98986ad76ecbf0cb407
MD5 601df5f4e6cabd631cbd7d358848341f
BLAKE2b-256 1a756c54949b368ba258a8d010b8abf6c631021bb6bc133d7b994340a121debe

See more details on using hashes here.

Provenance

The following attestation bundles were made for immunotype-1.0.2.tar.gz:

Publisher: release.yml on AG-Walz/immunotype

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file immunotype-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: immunotype-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 30.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for immunotype-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d37aaaf54076baa45774c68f4e75217c621558a7676e8a5f0ea7e8b7402f759
MD5 6a0f53371391ca3414ad4411c0733b48
BLAKE2b-256 3feeb0209e9a39769b7c06c5d145328bff1e6a9b3970814362b7a90a6f44ef72

See more details on using hashes here.

Provenance

The following attestation bundles were made for immunotype-1.0.2-py3-none-any.whl:

Publisher: release.yml on AG-Walz/immunotype

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page