本文へ移動
cccskills
無料GitHub で公開

bio-immunoinformatics-mhc-class-ii-prediction

Predict peptide-MHC class II (HLA-DR/DQ/DP) binding and presentation for CD4 T-cell epitopes with NetMHCIIpan-4.3 and MixMHC2pred-2.0. Covers why class II is far less reliable than class I (open binding groove, 9-mer register ambiguity, sparse noisy training data, DR>DP>DQ accuracy asymmetry), the DQ/DP heterodimer alpha/beta pairing trap, and the looser 1%/5% %Rank thresholds. Use when predicting CD4 epitopes for vaccine help, mapping class II neoantigens, or scoring long peptides against DR/DQ/DP. For CD8/class I see mhc-binding-prediction.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md11.1 KB
  • examples/class_ii_pairing.py2.5 KB
  • examples/run_class_ii.sh1.3 KB
  • usage-guide.md3.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Version Compatibility

Reference examples tested with: NetMHCIIpan 4.3+, MixMHC2pred 2.0+, pandas 2.2+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • CLI: <tool> --version then <tool> --help to confirm flags

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Notes specific to this skill: NetMHCIIpan and MixMHC2pred are standalone academic binaries (not pip-installable); the IEDB MHC-II REST API wraps NetMHCIIpan if a local install is unavailable. Allele nomenclature differs sharply between tools and between isotypes (DR single-chain vs DQ/DP heterodimer) — confirm the exact string format against the installed tool before scoring. Class II %Rank thresholds (1%/5%) are LOOSER than class I (0.5%/2.0%); do not copy class I cutoffs.

MHC Class II Prediction

"Predict which long peptides bind/are presented by HLA class II" -> Score peptide-HLA class II (DR/DQ/DP) presentation to nominate candidate CD4 T-cell epitopes, inferring the 9-mer binding core within each long peptide.

  • CLI: NetMHCIIpan (field default; EL score by default, -BA adds affinity; pan-DR/DQ/DP)
  • CLI: MixMHC2pred (MS-deconvolution motifs; models the reverse DP binding mode)

The Single Most Important Modern Insight -- class II is basically broken, and that must be stated plainly

For class I, modern pan-allele EL predictors recover most true ligands at high precision and the field has hit diminishing returns. The same architectures, on the same conceptual pipeline, produce dramatically weaker class II predictions. The honest one-line summary to give a collaborator is: "trust a class I strong-binder call; treat a class II call as a ranked hypothesis, not a fact." Four compounding reasons, not one, cause this. The groove is open at both ends, so a 12-25mer can sit in multiple registers and the model must infer which latent 9-residue core is the true binding frame — an error-prone latent-variable problem class I (closed groove, defined termini) never faces. The training data are smaller and noisier: in-vitro class II binding assays are notoriously irreproducible, and class II immunopeptidomics yields fewer, longer, more heterogeneous peptides. The three isotypes are unequally tractable — historically DR >> DP > DQ, because DR was studied first and most while DQ was data-starved (NetMHCIIpan-4.3's headline 2023 contribution was finally closing this gap with tailored data acquisition, a sign of how recent and data-driven the fix is). And DP/DQ are obligate alpha/beta heterodimers whose chains are independently polymorphic, so the effective number of distinct molecules is the combinatorial product of alpha and beta alleles.

The DQ/DP heterodimer pairing trap

A donor's DQA1 and DQB1 alleles pair both in cis (same haplotype) and in trans (across haplotypes), so a heterozygous individual can express up to four DQ heterodimers — and some trans-pairs are non-functional or rare. Mechanically feeding all DQA1 x DQB1 combinations to NetMHCIIpan generates molecules that do not biologically exist; taking only cis pairs may miss real trans-dimers. There is no fully automated, universally agreed resolution. The expert move is to be explicit about the pairing assumption, prefer documented haplotype pairings, and flag DQ (and to a lesser extent DP) epitope calls as lower-confidence than DR. DR is single-chain (the alpha is effectively invariant), so it carries none of this combinatorial burden and is the most trustworthy isotype.

Tool Taxonomy (Class II)

ToolCitationScore typeLociUse when
NetMHCIIpan-4.3Nilsson 2023EL (default) + BA (-BA)DR, DQ, DP (+ mouse H-2, BoLA)Field default; broadest coverage; closes DQ gap; reverse-mode binders
MixMHC2pred-2.0Racle 2023EL only (MS motifs)DR, DQ, DPMS-grounded motifs; models reverse (C->N) DP binding mode
MHCnuggetsShao 2020BA (IC50)class I + IIHigh-throughput screens; rare-allele transfer learning
NetMHCIIpan-4.0Reynisson 2020EL + BADR, DQ, DPReproducing 2020-era results; superseded by 4.3

Decision Tree by Scenario

ScenarioRecommendedWhy
Default CD4 epitope screenNetMHCIIpan-4.3 ELBroadest, pan-allele, current accuracy
DR-restricted, want highest confidenceNetMHCIIpan-4.3 (DRB1_*)DR is the most reliable isotype (single-chain)
DQ or DP restrictionNetMHCIIpan-4.3 + explicit pairingHeterodimer combinatorics; flag as lower-confidence
MS-grounded motif / DP reverse bindersMixMHC2pred-2.0Built from deconvolved immunopeptidomes; models reverse mode
Class II neoantigens (CD4 help)NetMHCIIpan-4.3 EL + expressionCD4 help boosts vaccine efficacy; EL still abundance-biased
No local installIEDB MHC-II REST APIWraps NetMHCIIpan, always-current versions

Running the Predictions (the fragile commands - run as written)

NetMHCIIpan reads a peptide list or FASTA and scores against one or more alleles. EL %Rank is the default output; -BA adds an affinity prediction. The model reports the inferred 9-mer core and its offset.

# DR (single-chain: beta allele names the molecule)
netMHCIIpan -f peptides.txt -inptype 1 -a DRB1_0101 -BA -xls -xlsfile out.tsv

# DQ heterodimer (BOTH chains, hyphen-joined) and DP
netMHCIIpan -f antigen.fasta -a HLA-DQA10501-DQB10201,HLA-DPA10103-DPB10401 -length 15

Key flags: -a allele(s, comma-separated), -f input, -inptype (0=FASTA, 1=peptide list), -length peptide length(s) to consider, -BA add affinity, -xls/-xlsfile tab output, -list dump supported alleles.

MixMHC2pred uses chain-underscore allele names with a DOUBLE underscore between heterodimer chains, and alleles are space-separated:

MixMHC2pred -i peptides.txt -o out.txt -a DRB1_15_01 DRB5_01_01 DPA1_02_01__DPB1_01_01

Per-Method Failure Modes

Register ambiguity in the open groove

Trigger: any class II prediction on a long peptide. Mechanism: the 9-mer binding core can sit in several frames; the model infers the latent core. Symptom: the reported core shifts with small input changes; unstable rankings. Fix: treat the call as a hypothesis; corroborate with MixMHC2pred and check core consistency; never over-interpret a single offset.

DQ/DP heterodimer mis-pairing

Trigger: expanding a genotype to all DQA1 x DQB1 (or DPA1 x DPB1) combinations. Mechanism: not all alpha/beta pairs form stable functional dimers; trans-pairs may be rare. Symptom: epitope calls against molecules that do not exist in the donor. Fix: restrict to documented/cis pairings, state the assumption, flag DQ/DP as lower-confidence than DR.

Copying class I thresholds

Trigger: applying 0.5%/2.0% %Rank to class II. Mechanism: class II distributions and recommended cutoffs differ. Symptom: over-stringent filtering, missed real binders. Fix: use class II cutoffs (strong <= 1%, weak <= 5%).

EL abundance bias (shared with class I)

Trigger: ranking class II neoantigens by EL alone. Mechanism: MS immunopeptidomes over-represent abundant proteins. Symptom: low-expression CD4 neoantigens under-ranked. Fix: integrate expression; judge within-target.

Quantitative Thresholds

ThresholdSourceRationale
Class II strong binder <= 1% RankNetMHCIIpan-4.x defaultLooser than class I; reflects class II score distributions
Class II weak binder <= 5% RankNetMHCIIpan-4.x defaultStandard recall/precision balance for class II
Peptide length 12-25mers (core = 9)Open-groove biologyClass II ligands are long with ragged termini; core always 9
MixMHC2pred input 12-21mersRacle 2023Outside this range or non-standard residues -> NA
2-field (4-digit) typing for both chainsIMGT/HLABoth alpha and beta needed for DQ/DP heterodimers
Isotype confidence DR > DP > DQNilsson 2023Reflects historical training-data depth per isotype

Common Errors

Error / symptomCauseSolution
Allele not recognizedWrong nomenclature for the toolNetMHCIIpan DRB1_0101/HLA-DQA10501-DQB10201; MixMHC2pred DRB1_15_01/DPA1_02_01__DPB1_01_01
Calls against non-existent moleculesNaive DQ/DP combinatorial expansionUse cis/documented pairings; flag DQ/DP
Over-stringent, few bindersClass I cutoffs appliedUse 1%/5% class II thresholds
Unstable core/offsetRegister ambiguityCorroborate across tools; treat as hypothesis
NA scores from MixMHC2predPeptide outside 12-21mer / non-standard residueFilter input length and alphabet first
Class II trusted like class IDifferent maturity regimeReport as ranked hypotheses, not facts

References

  • Nilsson JB, 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.
  • Racle J, Guillaume P, Schmidt J, et al. 2023. Machine learning predictions of MHC-II specificities reveal alternative binding mode of class II epitopes (MixMHC2pred-2.0). Immunity 56(6):1359-1375.e13.
  • Racle J, Michaux J, Rockinger GA, et al. 2019. Robust prediction of HLA class II epitopes by deep motif deconvolution of immunopeptidomes (MixMHC2pred-1.0). Nature Biotechnology 37:1283-1286.
  • Reynisson B, Alvarez B, Paul S, Peters B, Nielsen M. 2020. NetMHCpan-4.1 and NetMHCIIpan-4.0: improved predictions of MHC antigen presentation by concurrent motif deconvolution and integration of MS MHC eluted ligand data. Nucleic Acids Research 48(W1):W449-W454.
  • Shao XM, Bhattacharya R, Huang J, et al. 2020. High-throughput prediction of MHC class I and II neoantigens with MHCnuggets. Cancer Immunology Research 8(3):396-408.

Related Skills

  • immunoinformatics/mhc-binding-prediction - CD8/HLA class I binding (the solved regime; closed groove, 0.5%/2.0% cutoffs)
  • immunoinformatics/neoantigen-prediction - class II neoantigens for CD4 help; pVACseq runs both classes
  • immunoinformatics/immunogenicity-scoring - CD4 immunogenicity is even less solved than CD8
  • immunoinformatics/epitope-prediction - T-cell epitope prediction reduces to MHC presentation
  • clinical-databases/hla-typing - resolve DR/DQ/DP alleles for both chains

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Predicts ADMET properties using ADMETlab 3.0 (119 platform features, including 77 prediction models with modeled-endpoint uncertainty), ADMET-AI, DeepChem MolNet, and chemprop D-MPNN with explicit handling of OECD QSAR principles, applicability domain assessment, calibration, hERG/CYP/AMES endpoints, and PAINS / Lipinski / Ro5 / Veber / BBB druglikeness filters. Use when filtering compounds for drug-likeness, prioritizing leads by predicted safety, or building an in-house ADMET QSAR model.

日本語の概要は準備中です。原文の説明を表示しています。

GPTomics/bioSkills1,2192026年8月15日 更新

Trim PCR primers from aligned reads in amplicon-panel BAMs using samtools ampliconclip. Use when processing SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, or any amplicon assay where primer-derived bases would falsely confirm reference at primer footprints.

日本語の概要は準備中です。原文の説明を表示しています。

GPTomics/bioSkills1,2192026年8月15日 更新

Filter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.

日本語の概要は準備中です。原文の説明を表示しています。

GPTomics/bioSkills1,2192026年8月15日 更新

Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam. Use when enabling random access to alignment files or fetching specific genomic regions.

日本語の概要は準備中です。原文の説明を表示しています。

GPTomics/bioSkills1,2192026年8月15日 更新

Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.

日本語の概要は準備中です。原文の説明を表示しています。

GPTomics/bioSkills1,2192026年8月15日 更新

Parse and analyze multiple sequence alignments using Biopython. Extract sequences, identify conserved regions, analyze gaps, work with annotations, and manipulate alignment data for downstream analysis. Use when parsing or manipulating multiple sequence alignments.

日本語の概要は準備中です。原文の説明を表示しています。

GPTomics/bioSkills1,2192026年8月15日 更新

GPTomics のスキルをすべて見る

このスキルの問題を報告する