About Total HED-all

What is HED?

HLA Evolutionary Divergence (HED) quantifies how different an individual's two alleles are at a given HLA locus. A higher HED means the two alleles can together present a broader range of pathogen-derived peptides to the immune system — the divergent allele advantage. HED is calculated as the mean Grantham amino acid distance across the relevant positions of the two allele sequences.

Algorithm

For each locus, HED is computed as:

HED = Σ Grantham(aa1ᵢ, aa2ᵢ) / n_valid_positions

where the sum runs over all positions in the aligned pair of allele sequences, and n_valid_positions is the count of sites where both alleles carry a standard amino acid (non-standard characters are excluded from both numerator and denominator). This mirrors the algorithm of the Lenz CalculateIndividualDivergence.pl script exactly.

Sequence sources and methods by locus
Locus Class Full mode ABS-only mode Source (full) Full alleles ABS-only alleles
HLA-A Class I Exon 2+3 (181 AA) ABS only (32 AA) Lenz CWD + IMGT 3.64.0 5820 228
HLA-B Class I Exon 2+3 (181 AA) ABS only (32 AA) Lenz CWD + IMGT 3.64.0 6978 345
HLA-C Class I Exon 2+3 (181 AA) ABS only (32 AA) Lenz CWD + IMGT 3.64.0 5554 129
HLA-DPA1 Class II α Full exon 2 (90 AA) ABS only (9 AA) IMGT 3.64.0 458 458
HLA-DPB1 Class II β Full exon 2 (84 AA) ABS only (17 AA) IMGT 3.64.0 1918 1918
HLA-DQA1 Class II α Full exon 2 (90 AA) ABS only (10 AA) IMGT 3.64.0 535 535
HLA-DQB1 Class II β Full exon 2 (89 AA) ABS only (24 AA) Lenz CWD + IMGT 3.64.0 1939 26
HLA-DRB1 Class II β Full exon 2 (89 AA) ABS only (24 AA) Lenz CWD + IMGT 3.64.0 2717 211
Allele coverage

In full mode, the Lenz CWD catalogue (Mack et al. 2013) is used as the primary source for A, B, C, DRB1, and DQB1. Alleles absent from the CWD catalogue are resolved via an IMGT/HLA 3.64.0 fallback, giving complete coverage of all characterised alleles for these loci. DPB1, DQA1, and DPA1 are sourced directly from IMGT/HLA 3.64.0 (no Lenz FASTA exists for these loci). Where both sources exist, Lenz CWD sequences always take priority over IMGT to preserve exact compatibility with published HED values (HLA-HED, cHED).

In ABS-only mode, A, B, C, DRB1, and DQB1 are strictly limited to the Lenz CWD catalogue — no IMGT fallback is applied. This matches the original Pierini & Lenz 2018 / Chowell 2019 methodology exactly. DPB1 (17 positions), DPA1 (9 positions) and DQA1 (10 positions) use antigen-binding site positions derived from crystal structures (see below).

Notes on DPB1 and DPA1

No published Lenz-style ABSonly FASTA exists for HLA-DPB1. The antigen-binding site (ABS) positions used in the Original Lenz methodology mode are derived from two crystal structures of the HLA-DP peptide-binding groove:

  • Dai et al. 2010 (HLA-DP2 / DPB1*02:01, PDB: 3LQZ) — identifies residues lining the p1, p4, p6, and p9 binding pockets from the first HLA-DP crystal structure.
  • Klobuch et al. 2022 (HLA-DP1 / DPB1*01:01, PDB: 7T6I) — high-resolution structure of a reverse-binding CMV peptide; provides precise atomic contacts for the P1, P6, and P9 pockets.

17 sequential DPB1 positions are used (positions 9, 13, 24, 26, 28, 31, 52, 55, 59, 66, 68, 69, 72, 76, 79, 80, 83 in DPB1 sequential numbering, corresponding to IMGT structural positions β16, β20, β31, β33, β35, β38, β59, β62, β66, β73, β75, β76, β79, β83, β86, β87, β90). Position 84 (IMGT β91, the Asp/Arg residue forming a salt bridge with P1-Lys in both structures) is excluded because it is Arg in 98.9% of the 1,924 IMGT DPB1 alleles — effectively invariant and contributing negligible information to HED.

In full sequence mode, the complete exon 2 (84 real AA, IMGT positions 1–90) is used for DPB1, consistent with published DPB1 HED analyses (e.g. Crivello et al. 2015).

The same two structures also identify the α-chain contacts, so HLA-DPA1 uses 9 antigen-binding site positions in ABS-only mode: 11, 31, 52, 53, 54, 62, 65, 66 and 76 (mature-protein numbering, i.e. counting from the first residue after the 31-residue signal peptide). All nine residues were confirmed to reproduce at their published positions in the two alleles the structures were solved with (DPA1*01:03 in Dai et al.; DPA1*02:01 in Klobuch et al.). Five of the nine are more than 97% conserved across IMGT DPA1 alleles; they are retained deliberately, since the Lenz 24-position DRB1/DQB1 list likewise contains many invariant positions and filtering by polymorphism would break consistency with the methodology being reproduced. Because DPA1 is only weakly polymorphic, many genotypes will legitimately score HED = 0 at this locus.

Combined heterodimer scores (exploratory)

Class II molecules are αβ heterodimers: the peptide-binding groove is formed jointly by both chains, so the biologically meaningful unit is arguably the molecule rather than the individual gene. Two optional columns, HED DQ and HED DP, are reported alongside the per-locus values. They are computed by concatenating the α and β sequences of each of the individual's two molecules and taking the Grantham mean across the combined string, which weights each chain by its own length automatically — in ABS-only mode DQ is weighted 10:24 and DP 9:17, reflecting the β chain's larger share of the groove. In full mode the chain lengths are nearly equal (90:89 and 90:84), so the combined value is close to a plain average of the two loci.

Phasing is not required. Standard HLA genotyping is unphased, so it is not known which α allele sits on the same chromosome as which β allele. This does not matter here: comparing the two heterodimers always pits α1 against α2 at the α positions and β1 against β2 at the β positions, whichever way the alleles are phased, and Grantham distance is symmetric — so both phasings give an identical result. What would require phasing is the diversity of the full four-molecule repertoire including trans-paired heterodimers, which is a different quantity that HED does not measure.

Caveats. These scores are excluded from mean class II, which continues to average the five per-locus values only, so that each chain is not counted twice. No published precedent exists for combined DQ/DP HED, so the values are not comparable with any literature figure and should be treated as exploratory. There is no combined HLA-DR score: DRA is essentially monomorphic, so a collapsed DR value would be DRB1 rescaled by a constant — no additional information, and no longer comparable with published DRB1 HED.

Validation

Every reconstructed sequence set is checked against known-correct reference values when the application starts. The checks cover both sources: Lenz CWD FASTA entries (DRB1, DQB1) and IMGT-parsed entries (DPB1, DQA1, DPA1). The latter are the antigen-binding site strings of the exact alleles the crystal structures were solved with — DPB1*01:01 and DPA1*02:01 (Klobuch et al.), DPB1*02:01 and DPA1*01:03 (Dai et al.), and DQA1*05:01 (Kim et al., Nguyen et al.) — so they can be verified against the published papers rather than against this tool's own earlier output. If any check fails, calculations for the affected mode are disabled and an error is displayed, rather than returning values that may be silently incorrect.

Notes on DQA1

DQA1 antigen-binding site positions are derived from two crystal structures of the HLA-DQ2 peptide-binding groove:

  • Kim et al. 2004 (HLA-DQ2 / DQA1*05:01·DQB1*02:01, PDB: 1S9V) — lists the hydrogen bonds between the αI-gliadin epitope and DQ2, naming Arg-α52, Asn-α62, Asn-α11, Asn-α69, Tyr-α9, Tyr-α22, Arg-α76 and the α53 backbone carbonyl.
  • Nguyen et al. 2017 (HLA-DQ2.5·CLIP, PDB: 5KSU / 5KSV) — describes the α9–α22–α24–α31–β86–β90 hydrogen bond network spanning the P1 to P4 pockets, adding α24 and α31.

Ten positions are used: α9, α11, α22, α24, α31, α52, α53, α62, α69 and α76. All ten were verified to read exactly as published in DQA1*05:01, the allele both structures were solved with. α51 is excluded because Nguyen et al. describe it as an HLA-DM contact that enters the P1 pocket only on DM binding, not a peptide contact in the loaded molecule.

A note on alignment. DQA1 carries a polymorphic single-residue deletion at α53, present in 43% of IMGT alleles and absent from the rest (Kim et al. 2004, supporting Fig. 4). DQA1 and DPA1 sequences are therefore stored and compared in gapped alignment coordinates rather than as degapped residue strings: any column where either allele carries a gap is excluded from both the numerator and the denominator of the HED average. Comparing degapped sequences would place allele pairs of differing indel state out of register and inflate HED severely — for example DQA1*03:01 versus DQA1*02:01 reads 33.91 when degapped but 2.43 when correctly aligned. DRB1, DQB1 and DPB1 are unaffected, as their only alignment gaps are shared by every allele.

Key references
  1. Grantham R. Amino acid difference formula to help explain protein evolution. Science. 1974;185(4154):862–4. doi:10.1126/science.185.4154.862
  2. Bjorkman PJ, Saper MA, Samraoui B, Bennett WS, Strominger JL, Wiley DC. Structure of the human class I histocompatibility antigen, HLA-A2. Nature. 1987;329(6139):506–12. doi:10.1038/329506a0
    Companion paper defining the antigen-binding site and T-cell recognition regions: same authors, Nature. 1987;329(6139):512–18, doi:10.1038/329512a0. Together these define the 32 class I ABS positions.
  3. Brown JH, Jardetzky T, Saper MA, Samraoui B, Bjorkman PJ, Wiley DC. A hypothetical model of the foreign antigen binding site of class II histocompatibility molecules. Nature. 1988;332(6167):845–50. doi:10.1038/332845a0
    This is the modelling paper from which the 24 class II ABS positions used by Lenz derive. The experimental HLA-DR1 structure appeared five years later: Brown JH et al. Three-dimensional structure of the human class II histocompatibility antigen HLA-DR1. Nature. 1993;364(6432):33–9, doi:10.1038/364033a0.
  4. Pierini F, Lenz TL. Divergent allele advantage at human MHC genes: signatures of past and ongoing selection. Mol Biol Evol. 2018;35(9):2145–58. doi:10.1093/molbev/msy116
  5. Chowell D et al. Evolutionary divergence of HLA class I genotype impacts efficacy of cancer immunotherapy. Nat Med. 2019;25(11):1715–20. doi:10.1038/s41591-019-0639-4
  6. Dai S, Murphy GA, Crawford F, Mack DG, Falta MT, Marrack P, Kappler JW, Fontenot AP. Crystal structure of HLA-DP2 and implications for chronic beryllium disease. Proc Natl Acad Sci USA. 2010;107(16):7425–7430. doi:10.1073/pnas.1001772107
  7. Klobuch S, Lim JJ, van Balen P, et al. Human T cells recognize HLA-DP–bound peptides in two orientations. Proc Natl Acad Sci USA. 2022;119(49):e2214331119. doi:10.1073/pnas.2214331119
  8. Kim CY, Quarsten H, Bergseng E, Khosla C, Sollid LM. Structural basis for HLA-DQ2-mediated presentation of gluten epitopes in celiac disease. Proc Natl Acad Sci USA. 2004;101(12):4175–4179. doi:10.1073/pnas.0306885101
  9. Nguyen T-B, Jayaraman P, Bergseng E, Madhusudhan MS, Kim C-Y, Sollid LM. Unraveling the structural basis for the unusually rich association of human leukocyte antigen DQ2.5 with class-II-associated invariant chain peptides. J Biol Chem. 2017;292(22):9218–9228. doi:10.1074/jbc.M117.785139
  10. Crivello P et al. The impact of HLA-DPB1 mismatching on outcomes of unrelated donor hematopoietic stem cell transplantation depends on functional distance. Biol Blood Marrow Transplant. 2015;22(5):883–9.
  11. Mack SJ et al. Common and well-documented HLA alleles: 2012 update to the CWD catalogue. Tissue Antigens. 2013;81(4):194–203. doi:10.1111/tan.12093
  12. IPD-IMGT/HLA Database, release 3.64.0. https://github.com/ANHIG/IMGTHLA