> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# netMHCpan MHC-I Presentation

> Penalize proteins with predicted MHC class I ligands across a netMHCpan allele panel.

![netMHCpan MHC-I Presentation](https://proto-bio.github.io/proto-assets/images/constraint/netmhcpan-presentation/hero.png)

> [!NOTE]
>
> **License:** netMHCpan is licensed under Custom (DTU Health Tech Academic Software License) and has restrictions around commercial use and may require explicit attribution when utilized. Model weights are not publicly distributed and must be requested from the provider. Please refer to [the license](https://services.healthtech.dtu.dk/services/NetMHCpan-4.2/) for full terms.

This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.

***

&#x20;Tools Used Tools Used  Source Source  Cite Cite

![](https://proto-bio.github.io/proto-assets/images/tool/netmhcpan/social.png)

&#x20;Go to Tool Page

[Open](https://proto.evodesign.org/docs/tools/epitope-prediction/netmhcpan.md)

![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678)

evo-design/proto-language

&#x20;View source

[Open](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/constraint/protein_quality/netmhcpan_presentation_constraint.py#L69)

@articlenilsson2025netmhcpan\@articlenielsen2007netmhcpan

```bibtex theme={null}
@article{nilsson2025netmhcpan,
  title={NetMHCpan-4.2: improved prediction of CD8+ epitopes by use of transfer learning and structural features},
  author={Nilsson, Jonas Birkelund and Greenbaum, Jason and Peters, Bjoern and Nielsen, Morten},
  journal={Frontiers in Immunology},
  volume={16},
  pages={1616113},
  year={2025},
  publisher={Frontiers Media SA},
  doi={10.3389/fimmu.2025.1616113}
}

@article{nielsen2007netmhcpan,
  title={NetMHCpan, a Method for Quantitative Predictions of Peptide Binding to Any HLA-A and -B Locus Protein of Known Sequence},
  author={Nielsen, Morten and Lundegaard, Claus and Blicher, Thomas and Lamberth, Kasper and Harndahl, Mikkel and Justesen, Sune and R{\o}der, Gustav and Peters, Bjoern and Sette, Alessandro and Lund, Ole and Buus, S{\o}ren},
  journal={PLoS ONE},
  volume={2},
  number={8},
  pages={e796},
  year={2007},
  publisher={Public Library of Science},
  doi={10.1371/journal.pone.0000796}
}
```

&#x20;Copy citation

Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)
Score each protein by its predicted MHC class I presentation across the allele panel.

## API Reference

ConfigNetMHCpanPresentationConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/constraint/protein_quality/netmhcpan_presentation_constraint.py#L36)

Configuration for the netMHCpan MHC class I presentation constraint.

**metric** `enum` (default: binding\_propensity)

netMHCpan summary scored: smooth binding\_propensity or strong\_binder\_fraction.

Options: `binding_propensity`, `strong_binder_fraction`

**netmhcpan\_config** `NetMHCpanProteinConfig`

netMHCpan protein-scan settings: alleles, peptide lengths, %rank thresholds.

ReturnsConstraintOutput

One per proposal. `score` is the configured metric, 0.0 when
no window-allele pair is predicted to bind. `metadata` carries netMHCpan's
per-protein summary metrics plus `num_windows` and `strong_binders` (strong-binder
pairs with 1-indexed `position`, or `None`). A proposal with a non-standard
residue gets `MAX_ENERGY` and `netmhcpan_presentation_error` instead.

## Usage

```python python icon="python" theme={null}
>>> from proto_language.core import Sequence
>>> config = NetMHCpanPresentationConfig()
>>> out = netmhcpan_presentation_constraint([(Sequence("MKTIIALSYIFCLVFA", "protein"),)], config)
>>> out[0].metadata["strong_binder_count"]  # strong binders across the panel
```

## Metadata

| Property | Value |
| - | - |
| Key | `netmhcpan-presentation` |
| Function | `netmhcpan_presentation_constraint` |
| Category | `protein_quality` |
| Mode | `discrete` |
| Uses GPU | `False` |
| Supported Types | `protein` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.