HLA Typing, Part 2: Why HLA Typing Accuracy Is the First Bottleneck in Neoantigen Analysis

HLA typing · OptiType · HLA-HD · POLYSOLVER · neoantigen pipeline · MHC class I

HLA Typing Series · Part 2 of 2

Why HLA Typing Accuracy Is the First Bottleneck in Neoantigen Analysis

Every downstream neoantigen prediction depends on knowing the patient's HLA alleles at 4-digit resolution. A typing error at this step propagates through the entire pipeline — a wrong HLA allele means binding predictions are run against the wrong restriction element, and the final peptide list will be meaningless.

4-digit resolution distinguishes HLA-A*02:01 from HLA-A*02:06, which differ by a single amino acid in the peptide-binding groove and have substantially different peptide repertoires. 2-digit resolution (HLA-A*02) is not sufficient for neoantigen work.

Figure 1. Left: 4-digit accuracy and runtime comparison across HLA typing tools. Right: population frequency of common Class I alleles — note the substantial difference between global and East Asian frequencies for several alleles.

OptiType: Fast, Accurate, WES-Compatible

OptiType is the standard for WES-based HLA typing. It aligns reads to an HLA reference (IPD-IMGT/HLA database) and uses integer linear programming to find the allele pair that best explains the observed reads.

# Install: conda install -c bioconda optitype

# Step 1: Extract HLA-region reads (recommended for speed)
samtools view -b input.bam chr6:29,910,000-31,324,000 > hla_region.bam
samtools fastq hla_region.bam -1 hla_R1.fastq -2 hla_R2.fastq

# Step 2: Run OptiType
OptiTypePipeline.py \
    -i hla_R1.fastq hla_R2.fastq \
    --dna \                     # use --rna for RNA-seq input
    --outdir results/ \
    --prefix sample_01

# Output: results/sample_01_result.tsv
# HLA-A*02:01, HLA-A*24:02, HLA-B*07:02, HLA-B*35:01, HLA-C*07:01, HLA-C*04:01

HLA-HD: Higher Accuracy, Especially for Class II

HLA-HD uses a more exhaustive alignment strategy and consistently outperforms OptiType for HLA Class II (HLA-DR, DQ, DP). For personalized vaccine design where CD4+ T cell priming matters, HLA-HD is worth the longer runtime.

# Install: download from https://www.genome.med.kyoto-u.ac.jp/HLA-HD/
# Requires: bowtie2, samtools in PATH

hlahd.sh \
    -t 8 \                    # threads
    -m 100 \                  # minimum read length
    -f freq_data/ \           # allele frequency prior
    hla_R1.fastq \
    hla_R2.fastq \
    HLA_gene.split.3.32.0.txt \ # gene list
    dict/ \                   # IMGT/HLA reference
    sample_01 \               # sample name
    results/

# Output: results/sample_01/sample_01_final.result.txt
# Includes Class II: HLA-DRB1*04:01, DQA1*03:01, etc.

Choosing Between Tools

Use OptiType when: You only need Class I (for standard neoantigen peptide vaccine or checkpoint biomarker analysis), speed matters, and input is WES or RNA-seq.

Use HLA-HD when: You need Class II alleles (CD4+ neoantigen priming, personalized vaccine design), or when accuracy is more important than speed.

Use POLYSOLVER when: You want the caller most cancer-genomics papers standardised on. It is the Broad's standalone Bayesian HLA caller — not a GATK component, and it has no special tie to Mutect2 (HLA typing and somatic variant calling are separate steps). MHC-I only, slower and slightly less accurate than OptiType.

Validating Your HLA Calls

Always cross-check HLA calls between tumor and normal if both are available. Tumor copy number alterations (LOH of chr6p) can cause apparent HLA loss — this is a real biological phenomenon (HLA LOH as immune evasion) but can also appear as a typing discrepancy. Use LOHHLA to distinguish true LOH from typing noise.

# LOHHLA: HLA loss of heterozygosity detection
# Requires: HLA types + BAM files for tumor and matched normal

Rscript LOHHLA.R \
    --patientId sample_01 \
    --normalBAMfile normal.bam \
    --tumorBAMfile tumor.bam \
    --HLAexpressionFile optitype_result.tsv \
    --HLAfastaLoc hla_all_v2.fasta \
    --outputDir lohhla_results/ \
    --CopyNumLoc purity_ploidy.txt

Working with spatial transcriptomics and want to map immune infiltration patterns? See the companion blog SpatiaBio — Squidpy tutorials and spatial omics workflows.

댓글

이 블로그의 인기 게시물

What Is a Neoantigen? A Practical Guide for Experimental Researchers

NetMHCpan Explained: How MHC Binding Prediction Works and How to Read the Output

Tumor Mutational Burden (TMB): What It Measures, What It Doesn't, and How to Interpret It