mikessh commited on
Commit
f437d55
·
1 Parent(s): 9bbf915

immunogenicity: the MHC class-II corpus the shipped class-II model is fitted on

Browse files

Built from the same staged IEDB export as the class-I arm, by the same rules, so
the two are comparable by construction. 1,096,034 rows over 643,744 peptides,
77,943 immunogenic; human 603,781 peptides / 65,486 positive, mouse 50,258 /
12,457.

Restriction is parsed rather than imputed -- 50.8% of rows resolve, the rest are
kept as an explicit `unresolved` group rather than assigned a guessed allele.
That is why class II has one arm where class I has two: an HLA-matched variant
needs a resolved allele on both sides. The complementarity fit reads only peptide
and label, so the unresolved rows still carry their weight.

Deposited with the generator's run log; the build is deterministic and every count
was reproduced exactly from a clean checkout on 2026-08-19.

immunogenicity/SOURCES.md CHANGED
@@ -319,3 +319,51 @@ Regenerate (needs `~/hf/pmhc_data/dump`, which is gitignored — the raw zips ar
319
  ```zsh
320
  python immunogenicity/staged/fetch.py
321
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  ```zsh
320
  python immunogenicity/staged/fetch.py
321
  ```
322
+
323
+ ## `corpus_iedb_mhc2.parquet` — the MHC class-II arm (2026-08-19)
324
+
325
+ **Derived/computed**, from `staged/iedb_tcell.parquet` and `staged/iedb_ligand.parquet` — the same
326
+ IEDB build 2026-08-11 export the class-I corpus is built from, by the same rules, so the two arms are
327
+ comparable by construction rather than by assertion. This is what the shipped class-II
328
+ complementarity model (`mhcmatch.complement`, `cls="mhc2"`, v0.16.0) is fitted on.
329
+
330
+ | field | value |
331
+ |---|--:|
332
+ | rows (peptide, allele group, host) | 1,096,034 |
333
+ | distinct peptides | 643,744 |
334
+ | immunogenic peptides | 77,943 |
335
+ | human rows | 1,036,041 |
336
+ | human positives | 65,486 |
337
+ | human distinct peptides | 603,781 |
338
+ | human allele groups | 121 |
339
+ | mouse rows | 59,993 |
340
+ | mouse positives | 12,457 |
341
+ | mouse distinct peptides | 50,258 |
342
+ | mouse allele groups | 40 |
343
+ | peptide length | 11–25, median 15 |
344
+
345
+ Three rules differ from the class-I arm and nothing else does:
346
+
347
+ - **Length** is 11–25 rather than 8–11.
348
+ - **Restriction is parsed, never imputed.** Class-II restriction is written a dozen ways across IEDB
349
+ (`HLA-DRB1*15:01`, `HLA-DPA1*01:03/DPB1*04:01`, `HLA-DR15`, serotypes, `H2-IAb`), so the corpus
350
+ carries a parser and keeps whatever it cannot resolve as an explicit `unresolved` group rather than
351
+ guessing an allele. It parses **1,003,554 / 1,974,413 rows (50.8 %)**; the remainder are retained,
352
+ not dropped, because the complementarity fit reads only peptide and label. There is therefore **one
353
+ class-II arm where class I has two** — no HLA-matched variant is built, since matching needs a
354
+ resolved allele on both sides.
355
+ - **Rule 8** (pathogen epitopes) is applied by parsing the source organism rather than by set-match.
356
+
357
+ `evidence` records why each row is what it is: `eluted_but_positive_elsewhere=5,305`,
358
+ `eluted_foreign=103,351`, `eluted_self=1,156,574`, `eluted_unknown=440,458`, `tcell_negative=110,312`,
359
+ `tcell_positive=158,413`.
360
+
361
+ `corpus_iedb_mhc2.log` is the generator's own run record, deposited beside it; the counts in the table
362
+ above are read from it. The build is deterministic — regenerated 2026-08-19 from a clean checkout, every
363
+ count reproduced exactly.
364
+
365
+ Regenerate (needs this mirror at `$MHCMATCH_PMHC_DIR`, and the benchmark repo):
366
+
367
+ ```zsh
368
+ python bench/neoag/corpus_iedb.py --cls mhc2
369
+ ```
immunogenicity/corpus_iedb_mhc2.log ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # tcell: 570,434 staged rows
2
+ # class II: 247,456
3
+ # host human or mouse: 239,196
4
+ # 11-25mer, canonical: 221,787
5
+ # after artefact exclusions: 221,787 (115,263 peptides)
6
+ # ligand: 5,773,495 staged rows
7
+ # class II: 1,966,913
8
+ # host human or mouse: 1,905,785
9
+ # 11-25mer, canonical: 1,752,626
10
+ # after artefact exclusions: 1,752,626 (538,321 peptides)
11
+ # T-cell assayed (peptide, host) pairs: 119,615
12
+ # positive: 39,818 | measured negative: 79,797
13
+ # peptides positive in any host: 38,320
14
+ # elution pool by origin: foreign=145,186, self=1,165,489, unknown=441,951
15
+ # rows entering allele resolution: 1,974,413 (1,324,898 distinct peptide/host/restriction)
16
+ # class-II restriction parsed on 1,003,554/1,974,413 rows (50.8%); the rest are kept as `unresolved`
17
+ # top groups: unresolved=970,859, HLA-DRB1*15=174,134, HLA-DRB1*13=163,275, HLA-DRB1*01=105,737, HLA-DRB1*03=83,487, HLA-DRB1*04=52,007, HLA-DRB1*07=39,065, HLA-DPA1*01/DPB1*04=37,066
18
+ # evidence: eluted_but_positive_elsewhere=5,305, eluted_foreign=103,351, eluted_self=1,156,574, eluted_unknown=440,458, tcell_negative=110,312, tcell_positive=158,413
19
+ # out: 1,096,034 (peptide, allele group, host) rows over 643,744 peptides, 77,943 immunogenic
20
+ # human: 1,036,041 rows, 65,486 positive, 121 allele groups, 603,781 peptides
21
+ # length 11-25, median 15
22
+ # mouse: 59,993 rows, 12,457 positive, 40 allele groups, 50,258 peptides
23
+ # length 11-25, median 15
24
+ # -> /Users/mikesh/vcs/projects/2026-mhcmatch-benchmark/bench/neoag/corpus_iedb_mhc2.parquet (3s)
immunogenicity/corpus_iedb_mhc2.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63fe69c10d635f5c17bebae135bd390dc475ee7cffbde59e04c2dcdfca639708
3
+ size 8509426