[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EDXD3BZ6R2ZEWD7HX36JEN":3,"skill-same:01M7EDXD3BZ6R2ZEWD7HX36JEN":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EDXD3BZ6R2ZEWD7HX36JEN","bio-immunoinformatics-mhc-binding-prediction",null,"Predict peptide-MHC class I binding and natural presentation with MHCflurry, NetMHCpan-4.1, and MixMHCpred to nominate candidate CD8 T-cell epitopes. Covers the binding-affinity (BA) vs eluted-ligand (EL\u002Fpresentation) distinction, why %Rank beats raw nM for cross-allele work, the MS abundance bias that misranks low-expression neoantigens, allele-coverage inequity, and length bias. Use when scanning a protein or peptide set for class I epitopes, scoring neoantigen candidates, or choosing a binding predictor. For CD4\u002FHLA class II see mhc-class-ii-prediction.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-immunoinformatics-mhc-binding-prediction\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-immunoinformatics-mhc-binding-prediction\ndescription: Predict peptide-MHC class I binding and natural presentation with MHCflurry, NetMHCpan-4.1, and MixMHCpred to nominate candidate CD8 T-cell epitopes. Covers the binding-affinity (BA) vs eluted-ligand (EL\u002Fpresentation) distinction, why %Rank beats raw nM for cross-allele work, the MS abundance bias that misranks low-expression neoantigens, allele-coverage inequity, and length bias. Use when scanning a protein or peptide set for class I epitopes, scoring neoantigen candidates, or choosing a binding predictor. For CD4\u002FHLA class II see mhc-class-ii-prediction.\ntool_type: python\nprimary_tool: mhcflurry\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"immunoinformatics\u002Fmhc-binding-prediction\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: MHCflurry 2.1+, pandas 2.2+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\nNotes specific to this skill: MHCflurry 2.2.0+ switched its backend from TensorFlow to PyTorch (Python 3.10+) — confirm `mhcflurry-downloads fetch` succeeded and the backend imports before scoring. NetMHCpan-4.1 and MixMHCpred are standalone academic binaries, not pip-installable; the IEDB REST API wraps NetMHCpan if a local install is unavailable. Tool versions move fast — re-verify supported-allele lists and default %Rank thresholds against current docs.\n\n# MHC Binding Prediction\n\n**\"Predict which peptides bind\u002Fare presented by MHC class I\"** -> Score peptide-HLA class I binding affinity and natural-presentation likelihood to nominate candidate CD8 epitopes.\n- Python: `mhcflurry.Class1PresentationPredictor.load().predict()` (pip-installable, forgiving allele parser)\n- CLI: `netMHCpan` (field default; EL score by default, `-BA` adds affinity) or `MixMHCpred` (MS-deconvolution, EL-only)\n\n## The Single Most Important Modern Insight -- a strong predicted binder is a candidate for the next experiment, not an epitope\n\nBinding to MHC is necessary but nowhere near sufficient for immunogenicity. The real path is a funnel: expression -> proteasomal processing -> TAP transport and loading -> stable surface display -> a cognate T cell that survived thymic selection and activates. Binding prediction addresses essentially one stage. Each downstream stage discards a large fraction of binders, so the precision of \"predicted binder -> validated epitope\" is low even when the binding model itself is excellent. Two operational corollaries follow. First, never report a presentation score to a collaborator as an \"immunogenicity\" or \"epitope\" probability — that is a different, far weaker prediction (immunoinformatics\u002Fimmunogenicity-scoring). Second, the modern EL\u002FMS models that now define the field learned natural presentation from mass-spec immunopeptidomes, which over-represent peptides from highly expressed proteins; the model therefore partly learns \"comes from an abundant protein\" as a proxy for \"is presented.\" That bias is exactly backwards for neoantigen discovery, where the targets are mutated and often lowly expressed, living in the under-detected tail the model systematically under-ranks.\n\n## Tool Taxonomy (Class I)\n\n| Tool | Citation | Score type | Form | Use when |\n|------|----------|-----------|------|----------|\n| NetMHCpan-4.1 | Reynisson 2020 | EL (default) + BA (`-BA`) | standalone\u002Fweb\u002FIEDB | Field default; broadest allele coverage; presentation discovery |\n| MHCflurry 2.0 | O'Donnell 2020 | BA + processing + presentation | pip Python | Scripting, messy allele strings, integrated presentation score |\n| MixMHCpred 3.0 | Tadros 2025 | EL only (MS motifs) | standalone | MS-grounded presentation; cross-allele\u002Fspecies extrapolation study |\n| NetMHC-4.0 | Andreatta 2016 | BA only | standalone\u002Fweb | Legacy reproducibility; allele-specific, data-rich common alleles |\n| MHCnuggets | Shao 2020 | BA (IC50) | pip Python | High-throughput TCGA-scale screens; rare-allele transfer learning |\n\n## BA vs EL -- the conceptual axis that determines which score to read\n\nBA (binding affinity) models train on in-vitro competitive-binding IC50 assays and measure only whether the groove can hold the peptide thermodynamically. EL (eluted-ligand \u002F presentation) models train on mass-spec immunopeptidomics — peptides actually eluted from MHC on real cells — so the label implicitly folds in processing, transport, editing, and surface stability. Read BA for \"could this bind the groove if delivered there\"; read EL\u002Fpresentation for \"is this likely naturally presented,\" which is the default and recommended output of NetMHCpan-4.1, MHCflurry's presentation predictor, and MixMHCpred. IEDB codifies the split: `netmhcpan_ba` = recommended-binding, `netmhcpan_el` = recommended-epitope. Pick by intent.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|----------|-------------|-----|\n| Quick scriptable scan, messy allele names | MHCflurry presentation predictor | pip-installable, normalizes `A*02:01`\u002F`A0201`\u002F`HLA-A0201` |\n| Maximal accuracy \u002F broadest alleles | NetMHCpan-4.1 EL | Field default; concurrent MS motif deconvolution |\n| Neoantigen candidate scoring | EL\u002Fpresentation + expression check | EL under-ranks low-expression mutants (abundance bias) |\n| \"Can it physically bind\" (engineered\u002Fdelivered peptide) | BA mode (`-BA`, MHCflurry affinity) | Question is thermodynamic, not presentation |\n| Rare \u002F non-European allele | NetMHCpan-4.1, but verify training support | Pan-models extrapolate; confidence drops off the manifold |\n| Cross-allele ranking in a multi-HLA patient | %Rank, never raw nM | nM scales differ per allele; nM cutoffs are allele-biased |\n\n## Predict Presentation with MHCflurry\n\n**Goal:** Score peptides against a patient genotype and report the best-presenting allele per peptide.\n\n**Approach:** Load the presentation predictor; pass `alleles` as a sample->genotype dict so the model reports `best_allele`, `affinity` (nM), `affinity_percentile` (%Rank), and `presentation_score` (0-1, higher = more likely presented). Supply real `n_flanks`\u002F`c_flanks` only if the genomic context is known.\n\n```python\nfrom mhcflurry import Class1PresentationPredictor\n\npredictor = Class1PresentationPredictor.load()\ndf = predictor.predict(\n    peptides=['SIINFEKL', 'GILGFVFTL', 'NLVPMVATV'],\n    alleles={'patient1': ['HLA-A*02:01', 'HLA-A*24:02', 'HLA-B*07:02']},\n    include_affinity_percentile=True,   # required: %Rank column is off by default\n    verbose=0,\n)\n# columns: peptide, sample_name, affinity, best_allele, processing_score,\n#          presentation_score, and affinity_percentile (only with the flag above)\n# affinity nM: LOWER is stronger. presentation_score: HIGHER is more likely presented.\n```\n\n## Interpret with %Rank, Not Raw nM\n\n**Goal:** Classify binding strength in a way that is comparable across alleles.\n\n**Approach:** Threshold on %Rank (percentile of the score against random peptides for that same allele), not on absolute IC50. The 500 nM convention is allele-biased — it over-calls permissive alleles and under-calls restrictive ones, skewing a multi-HLA patient's epitope list toward a subset of the genotype.\n\n```python\ndef classify_by_percentile(affinity_percentile):\n    '''Class I %Rank cutoffs (NetMHCpan convention). LOWER percentile = stronger.\n    Strong binder \u003C= 0.5%; weak binder \u003C= 2.0%. Use %Rank for any cross-allele\n    comparison; raw nM is only meaningful within a single allele.'''\n    if affinity_percentile \u003C= 0.5:\n        return 'strong'\n    elif affinity_percentile \u003C= 2.0:\n        return 'weak'\n    return 'non-binder'\n```\n\n## Scan a Protein for Class I Epitopes\n\n**Goal:** Enumerate candidate epitopes across a protein for a patient genotype.\n\n**Approach:** Tile 8-11mers (9mers dominate real ligands), score all windows in one batched call, keep windows under the 2% weak-binder cutoff. See examples\u002Fmhc_binding.py for the full tiling-and-rank script.\n\n```python\ndef scan_protein(protein_seq, genotype, lengths=(8, 9, 10, 11)):\n    from mhcflurry import Class1PresentationPredictor\n    predictor = Class1PresentationPredictor.load()\n    peptides = [protein_seq[i:i + k] for k in lengths for i in range(len(protein_seq) - k + 1)]\n    df = predictor.predict(peptides=peptides, alleles={'patient': list(genotype)},\n                           include_affinity_percentile=True, verbose=0)\n    return df[df['affinity_percentile'] \u003C= 2.0].sort_values('affinity_percentile')\n```\n\n## Per-Method Failure Modes\n\n### Pan-model extrapolation on rare alleles\n**Trigger:** scoring an allele with little\u002Fno training support (much of HLA-C, many non-European alleles). **Mechanism:** pan-models emit a confident %Rank for any allele sequence — there is no built-in \"I don't know.\" **Symptom:** a flat\u002Fmushy predicted motif; calls that don't validate. **Fix:** check the allele is in the trained\u002Fsupported list and that close pseudosequence neighbors had real ligands; downgrade confidence when extrapolating.\n\n### EL abundance bias misranks neoantigens\n**Trigger:** ranking mutated, low-expression peptides by EL\u002Fpresentation score alone. **Mechanism:** MS immunopeptidomes over-represent abundant proteins; EL partly learns expression as a presentation proxy. **Symptom:** housekeeping-gene peptides float to the top; real low-expression neoantigens sink. **Fix:** combine EL with measured expression (TPM) and judge within-target, not against the proteome.\n\n### Placeholder flanks corrupt the processing score\n**Trigger:** passing dummy `n_flanks`\u002F`c_flanks` to get a presentation\u002Fprocessing number. **Mechanism:** the processing model reads flanking context; wrong flanks inject noise. **Symptom:** processing_score that tracks nothing biological. **Fix:** supply the true genomic flanks, or omit flanks and read affinity\u002FEL only.\n\n### Allele in the list != well-trained on that allele\n**Trigger:** trusting a number because the allele appears in `-listMHC`\u002F`supported_alleles`. **Mechanism:** coverage is not training support. **Fix:** treat coverage and data depth as separate questions.\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| Class I strong binder \u003C= 0.5% Rank | NetMHCpan-4.1 default (`-rth 0.5`) | Percentile normalizes per-allele score scales |\n| Class I weak binder \u003C= 2.0% Rank | NetMHCpan-4.1 default (`-rlt 2.0`) | Standard recall\u002Fprecision balance for candidate lists |\n| Peptide length 8-11mers (9 dominant) | Immunopeptidome composition | 9mers dominate training; non-9mers thinner evidence |\n| IC50 \u003C= 500 nM \"strong\" (legacy) | Pre-pan-allele convention | Allele-biased; AVOID for cross-allele work, use %Rank |\n| 2-field (4-digit) HLA resolution | IMGT\u002FHLA, groove determinants | Higher fields are synonymous\u002Fintronic; serotype is insufficient |\n| Evaluate by PPV@top-N, not bare AUC | Zhao & Sher 2018; imbalance | True ligands ~1 in 10,000+; AUC is computed on an unreal balance |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Epitope list skewed to one HLA in a patient | Thresholded on nM not %Rank | Use affinity_percentile \u002F %Rank |\n| MHCflurry import\u002Fbackend error | TF->PyTorch backend change (2.2.0+) | Use Python 3.10+; re-run `mhcflurry-downloads fetch` |\n| Confident number on an untrained allele | Pan-model extrapolation | Verify supported allele + training depth |\n| Low-expression neoantigen under-ranked | EL\u002FMS abundance bias | Integrate expression; rank within-target |\n| Reporting presentation as \"immunogenicity\" | Conflating funnel stages | Defer to immunogenicity-scoring; caveat the report |\n| Class II call trusted like class I | Different maturity regime | Use mhc-class-ii-prediction; treat II as hypothesis |\n\n## References\n\n- 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.\n- O'Donnell TJ, 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.\n- Tadros DM, Racle J, Gfeller D, et al. 2025. Predicting MHC-I ligands across alleles and species: how far can we go? *Genome Medicine* 17:25.\n- Andreatta M, Nielsen M. 2016. Gapped sequence alignment using artificial neural networks: application to the MHC class I system (NetMHC-4.0). *Bioinformatics* 32(4):511-517.\n- 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.\n- Zhao W, Sher X. 2018. Systematically benchmarking peptide-MHC binding predictors: from synthetic to naturally processed epitopes. *PLOS Computational Biology* 14(11):e1006457.\n- Trolle T, Metushi IG, Greenbaum JA, et al. 2015. Automated benchmarking of peptide-MHC class I binding predictions. *Bioinformatics* 31(13):2174-2181.\n\n## Related Skills\n\n- immunoinformatics\u002Fmhc-class-ii-prediction - CD4\u002FHLA class II binding (the harder, less-reliable regime; open groove, register, DQ pairing)\n- immunoinformatics\u002Fneoantigen-prediction - applies class I binding to tumor mutations; where the EL abundance bias bites\n- immunoinformatics\u002Fimmunogenicity-scoring - the separate, weaker prediction of T-cell response (binding != immunogenicity)\n- immunoinformatics\u002Fepitope-prediction - T-cell epitope mapping reduces to MHC presentation; B-cell epitopes are a different problem\n- clinical-databases\u002Fhla-typing - determine the patient genotype that conditions every prediction\n","## Version Compatibility\n\nReference examples tested with: MHCflurry 2.1+, pandas 2.2+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\nNotes specific to this skill: MHCflurry 2.2.0+ switched its backend from TensorFlow to PyTorch (Python 3.10+) — confirm `mhcflurry-downloads fetch` succeeded and the backend imports before scoring. NetMHCpan-4.1 and MixMHCpred are standalone academic binaries, not pip-installable; the IEDB REST API wraps NetMHCpan if a local install is unavailable. Tool versions move fast — re-verify supported-allele lists and default %Rank thresholds against current docs.\n\n# MHC Binding Prediction\n\n**\"Predict which peptides bind\u002Fare presented by MHC class I\"** -> Score peptide-HLA class I binding affinity and natural-presentation likelihood to nominate candidate CD8 epitopes.\n- Python: `mhcflurry.Class1PresentationPredictor.load().predict()` (pip-installable, forgiving allele parser)\n- CLI: `netMHCpan` (field default; EL score by default, `-BA` adds affinity) or `MixMHCpred` (MS-deconvolution, EL-only)\n\n## The Single Most Important Modern Insight -- a strong predicted binder is a candidate for the next experiment, not an epitope\n\nBinding to MHC is necessary but nowhere near sufficient for immunogenicity. The real path is a funnel: expression -> proteasomal processing -> TAP transport and loading -> stable surface display -> a cognate T cell that survived thymic selection and activates. Binding prediction addresses essentially one stage. Each downstream stage discards a large fraction of binders, so the precision of \"predicted binder -> validated epitope\" is low even when the binding model itself is excellent. Two operational corollaries follow. First, never report a presentation score to a collaborator as an \"immunogenicity\" or \"epitope\" probability — that is a different, far weaker prediction (immunoinformatics\u002Fimmunogenicity-scoring). Second, the modern EL\u002FMS models that now define the field learned natural presentation from mass-spec immunopeptidomes, which over-represent peptides from highly expressed proteins; the model therefore partly learns \"comes from an abundant protein\" as a proxy for \"is presented.\" That bias is exactly backwards for neoantigen discovery, where the targets are mutated and often lowly expressed, living in the under-detected tail the model systematically under-ranks.\n\n## Tool Taxonomy (Class I)\n\n| Tool | Citation | Score type | Form | Use when |\n|------|----------|-----------|------|----------|\n| NetMHCpan-4.1 | Reynisson 2020 | EL (default) + BA (`-BA`) | standalone\u002Fweb\u002FIEDB | Field default; broadest allele coverage; presentation discovery |\n| MHCflurry 2.0 | O'Donnell 2020 | BA + processing + presentation | pip Python | Scripting, messy allele strings, integrated presentation score |\n| MixMHCpred 3.0 | Tadros 2025 | EL only (MS motifs) | standalone | MS-grounded presentation; cross-allele\u002Fspecies extrapolation study |\n| NetMHC-4.0 | Andreatta 2016 | BA only | standalone\u002Fweb | Legacy reproducibility; allele-specific, data-rich common alleles |\n| MHCnuggets | Shao 2020 | BA (IC50) | pip Python | High-throughput TCGA-scale screens; rare-allele transfer learning |\n\n## BA vs EL -- the conceptual axis that determines which score to read\n\nBA (binding affinity) models train on in-vitro competitive-binding IC50 assays and measure only whether the groove can hold the peptide thermodynamically. EL (eluted-ligand \u002F presentation) models train on mass-spec immunopeptidomics — peptides actually eluted from MHC on real cells — so the label implicitly folds in processing, transport, editing, and surface stability. Read BA for \"could this bind the groove if delivered there\"; read EL\u002Fpresentation for \"is this likely naturally presented,\" which is the default and recommended output of NetMHCpan-4.1, MHCflurry's presentation predictor, and MixMHCpred. IEDB codifies the split: `netmhcpan_ba` = recommended-binding, `netmhcpan_el` = recommended-epitope. Pick by intent.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|----------|-------------|-----|\n| Quick scriptable scan, messy allele names | MHCflurry presentation predictor | pip-installable, normalizes `A*02:01`\u002F`A0201`\u002F`HLA-A0201` |\n| Maximal accuracy \u002F broadest alleles | NetMHCpan-4.1 EL | Field default; concurrent MS motif deconvolution |\n| Neoantigen candidate scoring | EL\u002Fpresentation + expression check | EL under-ranks low-expression mutants (abundance bias) |\n| \"Can it physically bind\" (engineered\u002Fdelivered peptide) | BA mode (`-BA`, MHCflurry affinity) | Question is thermodynamic, not presentation |\n| Rare \u002F non-European allele | NetMHCpan-4.1, but verify training support | Pan-models extrapolate; confidence drops off the manifold |\n| Cross-allele ranking in a multi-HLA patient | %Rank, never raw nM | nM scales differ per allele; nM cutoffs are allele-biased |\n\n## Predict Presentation with MHCflurry\n\n**Goal:** Score peptides against a patient genotype and report the best-presenting allele per peptide.\n\n**Approach:** Load the presentation predictor; pass `alleles` as a sample->genotype dict so the model reports `best_allele`, `affinity` (nM), `affinity_percentile` (%Rank), and `presentation_score` (0-1, higher = more likely presented). Supply real `n_flanks`\u002F`c_flanks` only if the genomic context is known.\n\n```python\nfrom mhcflurry import Class1PresentationPredictor\n\npredictor = Class1PresentationPredictor.load()\ndf = predictor.predict(\n    peptides=['SIINFEKL', 'GILGFVFTL', 'NLVPMVATV'],\n    alleles={'patient1': ['HLA-A*02:01', 'HLA-A*24:02', 'HLA-B*07:02']},\n    include_affinity_percentile=True,   # required: %Rank column is off by default\n    verbose=0,\n)\n# columns: peptide, sample_name, affinity, best_allele, processing_score,\n#          presentation_score, and affinity_percentile (only with the flag above)\n# affinity nM: LOWER is stronger. presentation_score: HIGHER is more likely presented.\n```\n\n## Interpret with %Rank, Not Raw nM\n\n**Goal:** Classify binding strength in a way that is comparable across alleles.\n\n**Approach:** Threshold on %Rank (percentile of the score against random peptides for that same allele), not on absolute IC50. The 500 nM convention is allele-biased — it over-calls permissive alleles and under-calls restrictive ones, skewing a multi-HLA patient's epitope list toward a subset of the genotype.\n\n```python\ndef classify_by_percentile(affinity_percentile):\n    '''Class I %Rank cutoffs (NetMHCpan convention). LOWER percentile = stronger.\n    Strong binder \u003C= 0.5%; weak binder \u003C= 2.0%. Use %Rank for any cross-allele\n    comparison; raw nM is only meaningful within a single allele.'''\n    if affinity_percentile \u003C= 0.5:\n        return 'strong'\n    elif affinity_percentile \u003C= 2.0:\n        return 'weak'\n    return 'non-binder'\n```\n\n## Scan a Protein for Class I Epitopes\n\n**Goal:** Enumerate candidate epitopes across a protein for a patient genotype.\n\n**Approach:** Tile 8-11mers (9mers dominate real ligands), score all windows in one batched call, keep windows under the 2% weak-binder cutoff. See examples\u002Fmhc_binding.py for the full tiling-and-rank script.\n\n```python\ndef scan_protein(protein_seq, genotype, lengths=(8, 9, 10, 11)):\n    from mhcflurry import Class1PresentationPredictor\n    predictor = Class1PresentationPredictor.load()\n    peptides = [protein_seq[i:i + k] for k in lengths for i in range(len(protein_seq) - k + 1)]\n    df = predictor.predict(peptides=peptides, alleles={'patient': list(genotype)},\n                           include_affinity_percentile=True, verbose=0)\n    return df[df['affinity_percentile'] \u003C= 2.0].sort_values('affinity_percentile')\n```\n\n## Per-Method Failure Modes\n\n### Pan-model extrapolation on rare alleles\n**Trigger:** scoring an allele with little\u002Fno training support (much of HLA-C, many non-European alleles). **Mechanism:** pan-models emit a confident %Rank for any allele sequence — there is no built-in \"I don't know.\" **Symptom:** a flat\u002Fmushy predicted motif; calls that don't validate. **Fix:** check the allele is in the trained\u002Fsupported list and that close pseudosequence neighbors had real ligands; downgrade confidence when extrapolating.\n\n### EL abundance bias misranks neoantigens\n**Trigger:** ranking mutated, low-expression peptides by EL\u002Fpresentation score alone. **Mechanism:** MS immunopeptidomes over-represent abundant proteins; EL partly learns expression as a presentation proxy. **Symptom:** housekeeping-gene peptides float to the top; real low-expression neoantigens sink. **Fix:** combine EL with measured expression (TPM) and judge within-target, not against the proteome.\n\n### Placeholder flanks corrupt the processing score\n**Trigger:** passing dummy `n_flanks`\u002F`c_flanks` to get a presentation\u002Fprocessing number. **Mechanism:** the processing model reads flanking context; wrong flanks inject noise. **Symptom:** processing_score that tracks nothing biological. **Fix:** supply the true genomic flanks, or omit flanks and read affinity\u002FEL only.\n\n### Allele in the list != well-trained on that allele\n**Trigger:** trusting a number because the allele appears in `-listMHC`\u002F`supported_alleles`. **Mechanism:** coverage is not training support. **Fix:** treat coverage and data depth as separate questions.\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| Class I strong binder \u003C= 0.5% Rank | NetMHCpan-4.1 default (`-rth 0.5`) | Percentile normalizes per-allele score scales |\n| Class I weak binder \u003C= 2.0% Rank | NetMHCpan-4.1 default (`-rlt 2.0`) | Standard recall\u002Fprecision balance for candidate lists |\n| Peptide length 8-11mers (9 dominant) | Immunopeptidome composition | 9mers dominate training; non-9mers thinner evidence |\n| IC50 \u003C= 500 nM \"strong\" (legacy) | Pre-pan-allele convention | Allele-biased; AVOID for cross-allele work, use %Rank |\n| 2-field (4-digit) HLA resolution | IMGT\u002FHLA, groove determinants | Higher fields are synonymous\u002Fintronic; serotype is insufficient |\n| Evaluate by PPV@top-N, not bare AUC | Zhao & Sher 2018; imbalance | True ligands ~1 in 10,000+; AUC is computed on an unreal balance |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Epitope list skewed to one HLA in a patient | Thresholded on nM not %Rank | Use affinity_percentile \u002F %Rank |\n| MHCflurry import\u002Fbackend error | TF->PyTorch backend change (2.2.0+) | Use Python 3.10+; re-run `mhcflurry-downloads fetch` |\n| Confident number on an untrained allele | Pan-model extrapolation | Verify supported allele + training depth |\n| Low-expression neoantigen under-ranked | EL\u002FMS abundance bias | Integrate expression; rank within-target |\n| Reporting presentation as \"immunogenicity\" | Conflating funnel stages | Defer to immunogenicity-scoring; caveat the report |\n| Class II call trusted like class I | Different maturity regime | Use mhc-class-ii-prediction; treat II as hypothesis |\n\n## References\n\n- 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.\n- O'Donnell TJ, 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.\n- Tadros DM, Racle J, Gfeller D, et al. 2025. Predicting MHC-I ligands across alleles and species: how far can we go? *Genome Medicine* 17:25.\n- Andreatta M, Nielsen M. 2016. Gapped sequence alignment using artificial neural networks: application to the MHC class I system (NetMHC-4.0). *Bioinformatics* 32(4):511-517.\n- 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.\n- Zhao W, Sher X. 2018. Systematically benchmarking peptide-MHC binding predictors: from synthetic to naturally processed epitopes. *PLOS Computational Biology* 14(11):e1006457.\n- Trolle T, Metushi IG, Greenbaum JA, et al. 2015. Automated benchmarking of peptide-MHC class I binding predictions. *Bioinformatics* 31(13):2174-2181.\n\n## Related Skills\n\n- immunoinformatics\u002Fmhc-class-ii-prediction - CD4\u002FHLA class II binding (the harder, less-reliable regime; open groove, register, DQ pairing)\n- immunoinformatics\u002Fneoantigen-prediction - applies class I binding to tumor mutations; where the EL abundance bias bites\n- immunoinformatics\u002Fimmunogenicity-scoring - the separate, weaker prediction of T-cell response (binding != immunogenicity)\n- immunoinformatics\u002Fepitope-prediction - T-cell epitope mapping reduces to MHC presentation; B-cell epitopes are a different problem\n- clinical-databases\u002Fhla-typing - determine the patient genotype that conditions every prediction\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","immunoinformatics\u002Fmhc-binding-prediction\u002FSKILL.md","mhcflurry","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-immunoinformatics-mhc-binding-prediction","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-immunoinformatics-mhc-binding-prediction",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-immunoinformatics-mhc-binding-prediction",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-immunoinformatics-mhc-binding-prediction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-immunoinformatics-mhc-binding-prediction\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fmhc_binding.py","SCRIPT","脚本",3846,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-immunoinformatics-mhc-binding-prediction\u002Fexamples\u002Fmhc_binding.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",3480,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-immunoinformatics-mhc-binding-prediction\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]