Whitepaper: Pan-Vertebrate MHC Class I Generalization and Exploratory Pan-Class Transfer in MHCflurry 2.5
Companion PDF: Download Publication-Ready PDF (16 standalone vector figures, tables & references)
Software & Data:
mhcflurry 2.5.x· frozen2.3.0PyTorch weights (models_class1_presentation) ·mhcseqs2.9–2.14·mhcgnomes3.79–3.96·hitlist(Nov 2026 bundles), IEDB Class I & II, ProteomeXchangePXD008151· Date: November 2026
Abstract & Key Findings
MHCflurry’s pan-allele models predict peptide binding from a compact pseudosequence — the 39 amino-acid positions of an MHC class I protein that line its peptide-binding pocket and contact the peptide. Because MHCflurry 2.5 integrates the optional mhcseqs sequence database and structural aligner alongside mhcgnomes allele-name parsing, complete Class I coverage expands nearly five-fold — from 47 vertebrate species (20,205 alleles; 10 trained species / 308 trained alleles in 2.3.0) to 223–231 vertebrate species (26,156–26,549 complete binding-groove sequences across 14 vertebrate clades) — without retraining or altering existing 2.3.0 model weights.
This whitepaper synthesizes all three 2.5.x validation campaigns into one empirical evaluation with rigorous negative controls (50-allele mismatched real-allele null distributions, 30-groove column-permuted pseudosequences, and within-peptide residue-scrambled positive controls): (1) zero-shot Class I binding affinity and antigen presentation on newly added species and engineered pocket mutants, (2) a mandatory training-overlap audit and unseen-peptide evaluation on cattle (BoLA-I) and dog (DLA-88) mass-spectrometry datasets, and (3) an exploratory test of whether frozen Class I weights can predict Class II binding.
Broad zero-shot Class I transfer verified against proper null distributions: Across
15hitlistunseen-species and binding-pocket mutant cohorts (0training rows), frozen2.3.0weights achieve0.77–0.98AUROC across carnivores (cat0.977, giant panda0.883), horses (0.967), birds (mallard duck0.893–0.938), marsupials (brushtail possum0.869, Tasmanian devil0.806with flanks), and single-residue pocket mutants (pigR156A0.951,p = 0.020,50/50null alleles beaten; catW167S0.976). Holding amino-acid composition strictly constant via within-peptide scrambled ligands confirms genuine positional anchor recognition (+0.20to+0.29AUROC over mismatched alleles on cat, duckAnpl-UAA*76, possum, cynomolgus, and pigR156A), while honestly exposing composition-dominated or indel-limited cohorts (rabbitRLA-A*01, frogXela-UAAg, batPtal-N*01:01).Human-trained antigen processing transfers across species: On Tasmanian devil (Sarcophilus harrisii,
~160 Myrdiverged from placental mammals), MHCflurry’s human-trained processing model alone achieves0.750AUROC using real Tasmanian devil source-protein flanking sequences, lifting combined Presentation from0.749 → 0.806AUROC (+0.057,+30%relative PPV@N; Affinity beats50/50size-matched 11-allele mismatched null draws,0.749vs0.695 [0.674, 0.718]).Mandatory three-table overlap audit on Cattle
BoLA-I& DogDLA-88: Checking all three training tables bundled inside2.3.0(811,134affinity +399,392processing rows) catches100%in-sample overlap onhitlistDogDLA-88and small IEDB CattleBoLA-Icohorts, while isolating21,332strictly unseen flanked CattleBoLA-IMS ligands (PXD008151) reaching0.902–0.960Presentation (+F) AUROC (0.833–0.922on real vs. residue-scrambled ligands vs.0.604–0.731null) and confirming strong ultra-few-shot transfer (4–12training rows).Clean negative result on zero-shot Class I → Class II transfer: Mapping
36 / 39structurally equivalent Class IIDR/DQ/DPcontact positions onto frozen Class I weights yields0.551AUROC (9-mer core scanning) — indistinguishable from a 30-allele mismatched Class I null (0.549), below column-permuted pseudosequences (0.571), and far belowNetMHCIIpan-4.3 BA(0.923). On within-peptide scrambled Class II binders, frozen Class I collapses to0.502(exact coin flip) whileNetMHCIIpan-4.3 BAmaintains0.725(+0.223). Pan-class prediction requires joint pan-class training.Bit-identical training parity: Locking existing trained alleles via
--lock-existingreproduces legacyclustalopan-allele training bit-for-bit (Max |Δ| = 0.0,Pearson r = 1.000000across all308trained alleles).
Companion Packages & Key Terms
Term / Package |
Plain-English Meaning |
|---|---|
Optional companion library providing curated MHC protein sequences across >220 vertebrate species and a structural aligner that maps any MHC protein onto standard IMGT numbering. |
|
Companion MHC allele-name parser used by MHCflurry to normalize naming conventions across species (e.g., |
|
Open benchmark corpus of curated MHC peptide-binding and mass-spectrometry elution datasets paired with matched species reference proteomes. |
|
39-aa pseudosequence |
The 39 amino-acid positions of an MHC class I heavy chain that line its peptide-binding pocket (groove) and directly contact the bound peptide. |
Flanking sequences ( |
The source-protein amino acids immediately upstream ( |
AUROC & PPV@N |
Ranking metrics against length-matched background decoys ( |
Mismatched real-allele null ( |
Scoring the identical test peptides using 50 diverse, unrelated real Class I alleles (excluding the target species; size-matched |
Column-permuted pseudosequences ( |
Synthetic 39-aa grooves created by independently shuffling each of the 39 positions across real Class I alleles, keeping per-position amino-acid distributions in-distribution while breaking pocket identity. |
Within-peptide scrambled positives |
Scoring real positive ligands against |
Closed vs. open binding groove |
MHC class I holds peptides in a closed pocket that pins both peptide ends (favoring 8–11mers); MHC class II has an open groove where a 9-mer core binds internally while both ends of a longer peptide (typically 15+ aa) overhang freely. |
Groove insertion |
Extra amino acids inserted into the peptide-binding region of some non-model species (e.g., a 3-aa insertion in bat |
1. Pan-Vertebrate Architecture in MHCflurry 2.5
In MHCflurry 2.0–2.3, building the 39-residue pseudosequence table required downloading bulk FASTA databases and running external clustalo multiple-sequence alignments. That workflow covered 47 species (20,205 alleles; training measurements concentrated in only 10 species and 308 alleles) and could not register novel heavy chains, uncurated UniProt proteins, or engineered pocket mutants at runtime.
MHCflurry 2.5 adds four capabilities without altering any released 2.3.0 weights (see Predicting on new species and MHC mutants for installation and usage examples):
Direct structural pseudosequence extraction via
mhcseqs: Signal-peptide trimming, binding-domain extraction, and mature-numbered 39-residue extraction are delegated tomhcseqs’s structural aligner (add_allele_from_sequence,extend_alleles_from_mhcseqs, andmhcflurry pseudosequences).Automatic insertion warnings: Whenever a sequence contains extra inserted amino acids inside its peptide-binding region (which a fixed 39-position pseudosequence must omit), MHCflurry logs a warning and exposes the full
GrooveAlignmentobject so callers know before trusting a prediction.Sequence-backed naming for non-model species: Through
mhcgnomes(AccessionedAllelesupport inmhcflurry >= 2.5.9), uncurated vertebrate sequences with UniProt accessions (such as sharkTriakisScyllium-UAA*uniprot:O46817or Tasmanian devilSaha-classI*uniprot:G3V1L5) flow cleanly throughnormalize_allele_nameandClass1AffinityPredictor(26,156alleles across223canonical vertebrate species,2,884accessioned alleles,0unparsed rows).Zero-regression parity gate: Across
19,886overlapping non-Xalleles in2.3.0,mhcseqsachieves99.45%exact 39/39 match (19,777 / 19,886) and99.98%per-residue identity (775,385 / 775,554).downloads-generation/allele_sequences/GENERATE.shuses--lock-existingplusverify_trained_allele_parity.pyto enforce0character differences across all308trained alleles.
Complete Class I coverage expands from 47 species in 2.3.0 to 227 species in mhcseqs 2.12 (231 union, 26,549 complete grooves, +184 net new vertebrate species across 14 clades): bony fish 2→53, birds 1→42, other mammals 0→28, reptiles 0→17, amphibians 0→17, rodents 2→15, marsupials 0→7, sharks & rays 0→4, bats 0→4, and cetaceans 0→2 (Figure 1). Experimental validation cohorts across these clades in hitlist span cellular MS elutions, direct ligands, positive/negative binding assays, and binding-pocket mutants (Figure 2).
Figure 1. Taxonomic expansion of complete MHC class I binding grooves across 14 vertebrate clades. Distinct vertebrate species with complete 39-aa pseudosequences increase from 47 in MHCflurry 2.3.0 (10 trained) to 227 in mhcseqs 2.12 (231 union; +184 net new vertebrate species), led by bony fish (+51), birds (+41), other mammals (+28), reptiles (+17), and amphibians (+17).
Figure 2. hitlist Class I validation data availability by species and experimental modality. Log-scaled peptide counts across four assay types (proteome-flanked cellular MS elutions, direct/unflanked ligands, experimental +/- binding assays, and engineered pocket mutants) for 10 unseen vertebrate species, 2 unseen allele/mutant cohorts in trained species, and 2 trained MS reference controls (below dashed line).
2. Zero-Shot Class I Affinity & Antigen Presentation Across Unseen Clades
2.1 Zero-Shot Presentation (+ Real Proteome Flanks) on Cellular MS Elutions
MHCflurry’s presentation model combines pan-allele binding affinity with a human-trained antigen-processing network that examines each peptide and its neighboring source-protein flanking residues. To test whether this human-trained processing model generalizes to distant vertebrates, we took cellular mass-spectrometry (MS) datasets in hitlist with matched host proteomes (Sarcophilus harrisii, Canis lupus, Macaca mulatta), paired eluted ligands with 10:1 length-matched decoys carrying real flanking sequences from the same host proteome, and compared frozen 2.3.0 weights against a size-matched mismatched real-allele null distribution (50 random 11-allele draws for Tasmanian devil Saha, single-allele null for monoallelic Dog and Rhesus controls; Figures 3 and 4).
Figure 3. Zero-shot Presentation (+ real species proteome flanks) versus Affinity and mismatched-allele null AUROC on hitlist MS elutions. AUROC (95% bootstrap CI) against 10:1 same-proteome length-matched decoys for zero-shot Tasmanian devil (Sarcophilus harrisii, 0 training rows, 11 UniProt grooves, 15,301 mapped ligands) alongside trained Dog (DLA-88) and Rhesus macaque (Mamu-B) reference controls. Gray bars show the size-matched mismatched real-allele Affinity null (median and 5th–95th percentile range). Even across ~160 Myr to marsupials, human-trained processing alone reaches 0.750 AUROC and lifts Presentation from 0.749 to 0.806 (+0.057).
Figure 4. Top-N enrichment gain (PPV@N) from human-trained antigen processing on hitlist MS elutions. Precision among the top N ranked peptides (dashed line = 0.091 random baseline at 10:1 decoy ratio). Adding human-trained processing and real S. harrisii flanks lifts Tasmanian devil PPV@N from 0.273 to 0.356 (+30% relative enrichment).
Dataset ( |
Status |
Mapped Pos (Eval / Total) |
Affinity AUROC |
Mismatched Null (5–95%) |
Processing (+F) |
Pres (noF) |
Pres (+F) |
PPV@N (Aff → +F) |
|---|---|---|---|---|---|---|---|---|
Tasmanian devil |
0-shot Marsupialia |
2,500 / 15,301 |
0.749 |
|
0.750 |
0.791 |
0.806 ( |
0.273 → 0.356 (+30%) |
Dog |
Trained ref* |
1,301 / 1,301 |
0.933 |
|
0.837 |
0.942 |
0.947 ( |
0.711 → 0.746 |
Dog |
Trained ref |
355 / 355 |
0.959 |
|
0.875 |
0.966 |
0.970 ( |
0.752 → 0.780 |
Rhesus |
Trained ref |
874 / 874 |
0.968 |
|
0.866 |
0.976 |
0.979 ( |
0.852 → 0.874 |
*As shown in Section 4, IEDB DLA-88*501:01 overlaps 2.3.0’s bundled affinity training table; these rows serve strictly as trained positive-control ceilings.
2.2 Experimental +/- Binding Assays & 15-Cohort Zero-Shot Ranking
In-vitro binding assays (refolding, purified-MHC fluorescence screens, and synthetic peptide panels) bypass cellular antigen processing and rarely map to a host proteome (19 / 448 = 4.2% in hitlist/binding.parquet; 0% for the 5,607 synthetic random-library Trvu-UB*01:01 peptides). For these datasets, Affinity is the primary metric — evaluated both on measured positive-versus-negative binders with no synthetic decoys (Figure 5) and on 10:1 background ligand ranking (Figure 6), benchmarked against a 50-allele mismatched real-allele null distribution (stratified across HLA-A, HLA-B, HLA-C, and non-human Class I alleles, excluding the target species) rather than a single arbitrary human allele.
Figure 5. Zero-shot performance on experimental positive-versus-negative binding assays (no synthetic decoys) versus 50-allele mismatched null. AUROC (95% bootstrap CI) on measured binders vs. measured non-binders from hitlist/binding.parquet, colored by clade, alongside the 50-allele mismatched real-allele null (black diamond = median; horizontal bar = 5th–95th percentile range). Cynomolgus Mafa-A1*063:01 achieves 0.889 vs. 0.185 [0.032, 0.750] null (p = 0.020), and Brushtail possum Trvu-UB*01:01 reaches 0.655 vs. 0.534 null, while tiny single-mutant negative panels (3+/13- cat, 6+/10- horse) have wide intervals.
Figure 6. Zero-shot Affinity and no-flank Presentation ligand ranking across 15 hitlist unseen-species and pocket-mutant cohorts. Solid bars show zero-shot Affinity AUROC (95% CI); hatched bars show no-flank Presentation AUROC; black diamonds and horizontal whiskers mark the 50-allele mismatched real-allele null (median and 5th–95th percentile range; size-matched 11-allele draws for Tasmanian devil Saha). Asterisks (*) indicate alleles carrying internal groove insertions or deletions flagged by mhcseqs.
Unseen Species / Allele (Clade) |
Validation Data |
Aff / Pres (noF) |
50-Allele Null Med |
Col-Perm Null |
Real vs. Scrambled (Null) |
Exp. |
|---|---|---|---|---|---|---|
Cat |
24 direct/bind |
0.977 / 0.966 |
|
0.662 |
0.957 (0.703) |
0.308 (3+/13-) |
Cat |
12 mut. ligands |
0.976 / 0.981 |
|
0.677 |
0.957 (0.664) |
— |
Horse |
6+ / 10− bind |
0.967 / 0.956 |
|
0.876 |
0.919 (0.821) |
0.217 (6+/10-) |
Pig |
141 mut. ligands |
0.951 / 0.946 |
|
0.807 |
0.890 (0.688) |
— |
Mallard duck |
31 binding+ |
0.938 / 0.920 |
|
0.900 |
0.876 (0.804) |
— |
Pig |
60 mut. ligands |
0.898 / 0.892 |
|
0.740 |
0.852 (0.706) |
— |
Mallard duck |
30 direct ligands |
0.893 / 0.856 |
|
0.637 |
0.848 (0.620) |
— |
Giant panda |
21 direct/bind |
0.883 / 0.906 |
|
0.869 |
0.866 (0.769) |
— |
Brushtail possum |
5,607 + 31 |
0.869 / 0.849 |
|
0.725 |
0.754 (0.542) |
0.655 (14+/17-) |
Cynomolgus |
56 |
0.868 / 0.830 |
|
0.645 |
0.763 (0.536) |
0.889 (p=0.020) |
African clawed frog |
26 + 19 |
0.826 / 0.828 |
|
0.832 |
0.812 (0.769) |
0.357 (14+/5-) |
Rabbit |
27 |
0.787 / 0.792 |
|
0.905 |
0.734 (0.819) |
0.562 (11+/16-) |
Tasmanian devil |
23,973 MS ( |
0.772 / 0.803 |
|
0.732 |
0.676 (0.668) |
— |
Norway rat |
5 binding+ |
0.720 / 0.940 |
|
0.522 |
0.752 (0.548) |
0.286 (7+/1-) |
Black flying fox |
86 |
0.593 / 0.717 |
|
0.597 |
0.540 (0.529) |
0.606 (37+/43-) |
(In addition, IEDB feline MS cohorts FLA-E*003:01 (n=1,612) and FLA-K*007:01 (n=491) achieve 0.830 and 0.880 AUROC zero-shot and recover empirical P2-Pro / P9-Arg/Lys anchor motifs; see Figure 9.)
3. Groove Specificity, Positional Anchor Controls, Motifs & Training Parity
3.1 Mismatched-Allele Nulls & Within-Peptide Scrambled Controls
Using a single fixed negative-control allele (such as HLA-A*02:01) has a known pitfall: if a rare species allele happens to share HLA-A*02:01’s hydrophobic P2/P9 anchor preference, the control looks artificially high; if its motif is anti-correlated with HLA-A*02:01, the control drops below 0.50 and inflates the apparent lift.
Evaluating every unseen cohort against two complementary null controls gives a much cleaner picture (Figures 7 and 8):
Mismatched real-allele & column-permuted groove nulls (
Figure 7): Fourteen of fifteen cohorts exceed the 50-allele mismatched median, and five large/clean cohorts achieve empiricalp ≤ 0.05(49–50 / 50unrelated real alleles beaten): PigSLA-1*04:01 R156A(p = 0.020), DuckAnpl-UAA*01(p = 0.020), Tasmanian devilSaha(p = 0.020against size-matched 11-allele draws), Brushtail possumTrvu-UB*01:01(p = 0.039), and PigSLA-1*13:01 F99Y(p = 0.039), with CynomolgusMafa-A1*063:01at48/50(p = 0.059, andp = 0.020on experimental+/-binding). Column-permuted synthetic pseudosequences (N = 30, open squares) track the real-allele null closely, confirming that the target groove’s advantage is not an out-of-distribution artifact.Within-peptide residue-scrambled positive controls (
Figure 8): Scoring real ligands against10×residue-shuffled copies of those exact same ligands holds amino-acid composition and peptide length strictly identical. Genuine zero-shot anchor decoders separate real ligands from their own scrambled copies far better than mismatched alleles — led by CatFLA-E*018:01 W167S(0.957vs0.664,+0.293), CatFLA-E*018:01(0.957vs0.703,+0.254), DuckAnpl-UAA*76(0.848vs0.620,+0.228), CynomolgusMafa-A1*063:01(0.763vs0.536,+0.227), Brushtail possumTrvu-UB*01:01(0.754vs0.542,+0.212), and PigSLA-1*04:01 R156A(0.890vs0.688,+0.202).Honest caveats clarified by proper controls: Three cohorts show little or no groove-specific lift over the null distribution: Rabbit
RLA-A*01sits below the 50-allele null (0.787vs0.876,8/50, scrambled0.734vs0.819), African clawed frogXela-UAAg(~350 Myr, 2 groove indels) sits inside the null (0.826vs0.808,p = 0.294,col-perm = 0.832), and BatPtal-N*01:01(3-aaMDLA-pocket insertion) collapses to0.540vs0.529null on scrambled peptides.
Figure 7. Groove-specific zero-shot transfer versus 50-allele mismatched real-allele and 30 column-permuted pseudosequence nulls. Colored circles show target-allele zero-shot AUROC; gray bars and black diamonds mark the 50-allele mismatched real-allele null (5th–95th percentile range and median); open squares mark the median of 30 column-permuted pseudosequences. Labels report target AUROC, margin over null median, and alleles beaten out of 50 (* denotes empirical p ≤ 0.05).
Figure 8. Positional anchor specificity: real ligands versus 10× within-peptide residue-scrambled copies. Holding peptide length and exact amino-acid composition constant eliminates generic hydrophobicity bias. Colored bars show target-groove AUROC (95% bootstrap CI); black diamonds show the mismatched real-allele median on the identical real-vs-scrambled task, sorted by lift Δ. Strong positive lifts (+0.20 to +0.29) confirm true positional anchor decoding in feline, avian, marsupial, primate, and mutant porcine grooves, whereas Bat Ptal-N*01:01 (0.54 vs 0.53) and Rabbit RLA-A*01 (0.73 vs 0.82) show no groove-specific positional lift.
3.2 Empirical vs Zero-Shot Sequence Logos & Insertion Failure Mode
Comparing experimentally observed 9-mer ligands against the top 1% of 30,000 random 9-mers scored zero-shot (Figure 9) explains both why pan-allele transfer succeeds and where fixed 39-aa pseudosequences reach their physical limit:
Feline & marsupial anchor recovery: With zero feline training data,
FLA-E*003:01recovers both its empirical position-2 proline (P2-Pro) and position-9 basic (P9-Arg/Lys) preferences; brushtail possumTrvu-UB*01:01and Tasmanian devilSaharecover their aromatic/hydrophobic C-terminal (P9) anchors across~160 Myr.Single-residue pocket mutants: Extracting mature-numbered point mutations via
mhcseqsimproves discrimination over the corresponding wild-type allele on mutant-specific ligands for both PigSLA-1*04:01 R156A(ΔAUROC = +0.010, 95% CI[+0.007, +0.013]) and CatFLA-E*018:01 W167S(ΔAUROC = +0.006, 95% CI[+0.000, +0.015]).Honest failure mode — Bat
Ptal-N*01:01(3-aaMDLinsertion): This bat allele carries three extra amino acids (MDL) inserted at position 51 inside the N-terminal binding pocket (the A-pocket), reshaping its preference towardP1-AspandP9-Pro. Because a fixed 39-position pseudosequence must skip those three inserted residues, predicted affinities flatten to~26–30 µM(1.1×separation;0.540on real vs. scrambled ligands).mhcseqs >= 2.9automatically flags such groove insertions with a warning.
Figure 9. Empirical versus zero-shot predicted 9-mer sequence logos. Observed 9-mer ligands (top row) compared against the top 1% zero-shot predicted 9-mers from 30,000 random background peptides (bottom row) for Brushtail possum Trvu-UB*01:01, Cat FLA-E*003:01, Tasmanian devil Saha, and the Bat Ptal-N*01:01 3-aa insertion failure mode.
3.3 Controlled A/B Pan-Allele Training Parity
In a controlled A/B pan-allele training run ([1024, 1024] architecture, 30,760 train / 7,690 held-out test across all 307 trained alleles, seed 42), --lock-existing reproduces legacy clustalo training bit-for-bit while adding all +184 net new vertebrate species (Figure 10).
Figure 10. Controlled A/B pan-allele training parity across all 307 trained 2.3.0 alleles. Locking existing alleles verbatim (Arm B: mhcseqs + --lock-existing) reproduces legacy clustalo training (Arm A) bit-for-bit (Max |Δ| = 0.0, log10 r = 1.000000, AUROC = 0.80169) while expanding the table by +184 vertebrate species.
| Arm | Pseudosequence Table | Held-out AUROC (all) | Chicken Gaga AUROC | Max |Δ| vs Arm A | log10 r vs Arm A |
| :— | :— | —: | —: | —: | —: |
| Arm A | Legacy 2.3.0 clustalo | 0.80169 | 0.57025 | 0.0 | 1.000000 |
| Arm B | mhcseqs + --lock-existing | 0.80169 | 0.57025 | 0.0 | 1.000000 |
| Arm C | mhcseqs (prefer_existing=True, unlocking 7 Gaga-BF) | 0.83151 | 0.52342 | non-zero | 0.920 |
4. Audited Livestock & Companion-Animal Validation: Cattle BoLA-I & Dog DLA-88
Checking only curated_training_data.affinity.csv.bz2 misses mass-spectrometry ligands that were folded into the training tables shipped inside models_class1_presentation/models/. Auditing all three bundled 2.3.0 training tables (affinity_predictor_train_data.csv.bz2: 811,134 rows; processing_predictor_with_flanks_train_data.csv.bz2: 399,392 rows; processing_predictor_no_flank_train_data.csv.bz2: 399,392 rows) cleanly separates in-sample training data from genuinely unseen peptides (Figure 11), confirms strong Presentation (+F) ranking on 21,332 strictly unseen Cattle BoLA-I ligands against size-matched mismatched-allele nulls and within-peptide scrambled controls (Figure 12), and quantifies ultra-few-shot transfer down to 4–12 training rows (Figure 13).
Figure 11. Mandatory three-table 2.3.0 training-overlap audit for Cattle BoLA-I and Dog DLA-88. Every hitlist Dog DLA-88 MS peptide and small IEDB Cattle BoLA-I cohort (PMID 36423003) is 100% in-sample in affinity_predictor_train_data.csv.bz2 and excluded from held-out claims, whereas 79.5%–87.3% (21,606 unique; 21,332 flanked) of PXD008151 Cattle BoLA-I ligands have zero overlap with any of the three bundled 2.3.0 training tables.
Figure 12. Strictly unseen PXD008151 Cattle BoLA-I ligand ranking (+ real Bos taurus flanks). Evaluated on 2,500 strictly unseen flanked ligands per cohort against 25,000 (10×) unseen bovine proteome decoys with symmetric real 5-aa flanks. All three cohorts reach 0.902–0.960 Presentation (+F) AUROC, far above their size-matched mismatched real-allele null distributions (0.691–0.752, gray bars with 5th–95th percentile whiskers) and achieving 0.833–0.922 AUROC on real vs. residue-scrambled bovine ligands (vs. 0.604–0.731 null).
Figure 13. Ultra-few-shot Cattle BoLA-I allele ablation (4–12 training rows). Adding BoLA-3*002:01 (only 12 training rows in 2.3.0) lifts the 2-allele haplotype by +0.029 Presentation (+F) AUROC (+0.041 Affinity) and captures 42.8% of unseen bovine ligands as top binder; BoLA-4*024:01 (6 training rows) reaches 0.904 Presentation (+F) AUROC alone, and BoLA-2*025:01 (4 training rows) reaches 0.850.
Cohort (Source) |
2.3.0 Bundled Train Rows |
Strictly Unseen (%) |
Aff AUROC |
Pres (noF) |
Pres (+F) |
Size-Matched Null |
Real vs. Scrambled (Null) |
PPV@N ( |
|---|---|---|---|---|---|---|---|---|
Cattle |
|
5,873 (87.3%) |
0.950 |
0.957 |
0.960 |
|
0.922 (0.721) |
0.726 → 0.725 |
Cattle |
|
8,304 (80.8%) |
0.871 |
0.896 |
0.902 |
|
0.833 (0.731) |
0.538 → 0.560 |
Cattle |
|
7,429 (79.5%) |
0.892 |
0.915 |
0.918 |
|
0.857 (0.604) |
0.570 → 0.594 |
Cattle |
|
0 (0.0%) |
— |
— |
Excluded ( |
— |
— |
— |
Dog |
|
0 (0.0%) |
— |
— |
Excluded ( |
— |
— |
— |
Dog |
|
0 (0.0%) |
— |
— |
Excluded ( |
— |
— |
— |
5. Exploratory Boundary Study: Zero-Shot Class I → Class II Transfer
MHC class I (one heavy chain forming both halves of the binding groove) and MHC class II (separate α and β chains each contributing one half) share the same overall 3D protein fold. Using mhcseqs’s structural IMGT alignment, we mapped MHCflurry’s 39 Class I contact positions directly onto their structurally equivalent positions in Class II HLA-DR, HLA-DQ, and HLA-DP heterodimers (36 / 39 positions directly populated; 3 Class I-only positions padded with X).
We tested whether these aligned 39-aa Class II pseudosequences allow frozen Class I MHCflurry 2.3.0 weights to predict quantitative Class II 15-mer binding affinity zero-shot across 15 HLA-DR/DQ/DP alleles (500 unique 15-mers per allele; 7,500 total IC50 nM pairs from hitlist; binder threshold IC50 ≤ 500 nM), benchmarked against NetMHCIIpan-4.3 (BA & EL), a 30-allele mismatched real Class I null distribution, 20 column-permuted pseudosequences, and within-peptide residue-scrambled Class II binders (Figures 14–16).
Figure 14. Exploratory zero-shot Class I → Class II AUROC versus 30-allele mismatched Class I null across 15 HLA-DR, DQ, and DP alleles. Binary binder classification AUROC (IC50 ≤ 500 nM, 500 15-mers per allele). Frozen Class I MHCflurry 2.3.0 with pan-class 9-mer core scanning averages 0.551 AUROC — statistically indistinguishable from the 30-allele mismatched Class I null (0.549, gray bars with 5th–95th percentile whiskers) and far below native NetMHCIIpan-4.3 BA (0.923). Direct 15-mer scoring drops to 0.235–0.255 on HLA-DP.
Figure 15. Quantitative Class II 15-mer IC50 rank correlation (Spearman ρ) versus 30-allele mismatched Class I null across 15 alleles. Continuous rank correlation against experimental -log10(IC50). Native NetMHCIIpan-4.3 BA achieves mean ρ = +0.801, whereas frozen Class I 9-mer core scanning achieves +0.115 (matching the 30-allele mismatched Class I null at +0.100, below 20 column-permuted grooves at +0.146) and direct 15-mer scoring is systematically anti-correlated (ρ = -0.224, down to -0.521 on DPA1*01:03/DPB1*04:01).
Figure 16. 15 × 15 Class I → Class II cross-allele specificity matrix. Row-centered AUROC (AUROC − row mean) when scoring each true Class II allele test set (rows) with each pan-class Class II pseudosequence (columns) using frozen Class I weights. Strong vertical column stripes rather than a bright diagonal (mean diag 0.551 vs mean off-diag 0.556, Δ = -0.005) confirm zero Class II groove specificity.
Method |
Scoring mode |
Mean AUROC ( |
Mean Spearman |
Real vs. Scrambled Binders AUROC |
Interpretation |
|---|---|---|---|---|---|
|
Native Class II BA |
0.923 |
+0.801 |
0.725 |
True Class II positional motif recognition |
|
Native Class II EL |
0.763 |
+0.493 |
— |
Eluted-ligand score on binding-affinity assay |
|
9-mer core ( |
|
|
— |
Synthetic column-shuffled grooves beat pan-class Class II |
Frozen Class I MHCflurry |
Pan-class 9-mer core |
|
|
|
Matches mismatched Class I null; coin flip on scrambled binders |
|
9-mer core ( |
|
|
|
Shared hydrophobic-core composition baseline |
|
Direct 15-mer |
|
|
— |
Closed-groove N/C terminus mismatch |
Frozen Class I MHCflurry |
Pan-class direct 15-mer |
|
|
— |
Anti-correlated (down to |
(See Experiment 2026-11-25: Speculative pan-class Class I → Class II transfer via mhcseqs IMGT alignments for the complete 15-allele breakdown.)
Why Zero-Shot Class I → Class II Fails
Within-peptide scrambled binders prove 9-mer core scanning is pure hydrophobicity bias (
0.502vs0.725): Scanning 9-mer cores lifts AUROC from0.394to0.551only because Class II binders tend to contain hydrophobic internal 9-mer cores that any Class I groove prefers (30-allele mismatched Class I null =0.549;20column-permuted grooves =0.571). When amino-acid composition is held constant by comparing real Class II binders (IC50 ≤ 500 nM) against3×residue-scrambled copies of those exact 15-mers, frozen Class I collapses to0.502(coin flip across all 15 alleles), while nativeNetMHCIIpan-4.3 BAachieves0.725(+0.223).Closed-groove vs. open-groove geometry causes strong anti-correlation on HLA-DP (
0.235–0.255,ρ = -0.40 to -0.52): MHC class I binds 15-mers in a closed pocket by pinning both peptide ends and bulging the middle out, whereas MHC class II binds an open groove where the 9-mer core sits anywhere inside the peptide with polar/charged ends overhanging freely.Zero diagonal specificity proves joint training is required: In
Figure 16, matching the right Class II pseudosequence (0.551) performs slightly worse than mismatched Class II alleles (0.556,Δ = -0.005). Whilemhcseqsprovides a clean shared structural alignment across both MHC classes, predicting Class II accurately requires training a future architecture jointly on both Class I and Class II data.
6. Practical Guidance & Reproducibility
Checklist for Predicting on New Vertebrate Species
Watch for insertion warnings: Use
extract_class1_pseudosequence_with_alignment()(or checkmhcflurrylogs). Canonical grooves and small deletions transfer reliably across mammals and birds; multi-residue pocket insertions (like batPtal-N*01:01) degrade fixed-39-aa accuracy.Use mismatched-allele null distributions and within-peptide scrambled controls: Rather than comparing against a single arbitrary human allele (which can accidentally share or oppose the target motif), benchmark new non-model datasets against a diverse panel of unrelated real alleles (size-matched
k-allele sets for multi-allelic data) and residue-scrambled copies of the positive ligands.Supply real flanking sequences for MS/cellular tasks: Real species proteome flanks consistently improve Presentation AUROC and PPV@N even in marsupials (
+0.057AUROC on Tasmanian devil) and cattle (+4%PPV@N).Audit all three bundled training tables before claiming held-out accuracy: Check
affinity_predictor_train_data.csv.bz2and bothprocessing_predictor_*_train_data.csv.bz2files insidemodels_class1_presentation/models/.Do not apply frozen Class I weights to Class II alleles: Use dedicated Class II predictors (such as
NetMHCIIpan-4.3) until a jointly trained pan-class MHCflurry model is released.
Reproducible Scripts & Companion Pages
How-to user guide: Predicting on new species and MHC mutants
Individual dated experiment logs: Experiment 2026-11-25: Cross-species hitlist validation & mhcseqs training parity, Experiment: Audited Cattle BoLA-I & Dog DLA hitlist Validation (2.5.x), Experiment 2026-11-25: Speculative pan-class Class I → Class II transfer via mhcseqs IMGT alignments, DLA evidence and canine evaluation.
Reproducible benchmark scripts:
scripts/experiments/release_2_5_0/.Rebuild the companion PDF:
python docs/build_whitepaper_pdf.py(requiresrsvg-convertandxelatex).
7. References
O’Donnell, T. J., Rubinsteyn, A., & Laserson, U. (2020). MHCflurry 2.0: Improved pan-allele prediction of MHC class I-presented peptides by incorporating antigen processing. Cell Systems, 11(1), 42–48.e7. https://doi.org/10.1016/j.cels.2020.06.010
O’Donnell, T. J., Rubinsteyn, A., Bonsack, M., Riemer, A. B., Laserson, U., & Hammerbacher, J. (2018). MHCflurry: Open-source Class I MHC binding affinity prediction. Cell Systems, 7(1), 129–132.e4. https://doi.org/10.1016/j.cels.2018.05.014
Nielsen, M., Connelley, T., & Ternette, N. (2018). Improved prediction of bovine leucocyte antigens (BoLA) presented ligands by use of mass-spectrometry-determined ligand and in vitro binding data (
PXD008151, PMID 29115832). Journal of Proteome Research, 17(1), 559–567.Nilsson, J. B., Kaabinejadian, S., Yari, H., et al. (2023). Accurate prediction of HLA class II antigen presentation across all loci using tailored data acquisition and refined machine learning (
NetMHCIIpan-4.3). Science Advances, 9(47), eadj6367.Lefranc, M.-P., Pommié, C., Kaas, Q., et al. (2005). IMGT unique numbering for immunoglobulin and T cell receptor constant domains and Ig superfamily C-like domains (and G-DOMAINs). Developmental & Comparative Immunology, 29(3), 185–203.
Caldwell, A., Coleby, R., Tovar, C., et al. (2018). The newly-arisen Devil facial tumour disease 2 (DFT2) reveals a mechanism for the emergence of a contagious cancer (Sarcophilus harrisii immunopeptidome). eLife, 7, e35314.
Wynne, J. W., Weyer, J. L., Shiell, B. J., et al. (2016). Characterization of the MHC class I peptide repertoire of the black flying fox (Pteropus alecto,
Ptal-N*01:01). Journal of Immunology, 196(11), 4445–4454.OpenVax / PIRL-UNC immunogenomics ecosystem:
mhcseqs,mhcgnomes, andhitlist.