> ## 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.

# AutoDock Vina Affinity

> Dock a configured ligand into each proposal's structure and score Vina's best-pose affinity.

![AutoDock Vina Affinity](https://proto-bio.github.io/proto-assets/images/constraint/vina-affinity/hero.png)

> [!NOTE]
>
> **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details.

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

[![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/social.png)](https://proto.evodesign.org/docs/tools/inverse-folding/fampnn.md)

[![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/social.png)](https://proto.evodesign.org/docs/tools/inverse-folding/ligandmpnn.md)

[![](https://proto-bio.github.io/proto-assets/images/tool/vina/social.png)](https://proto.evodesign.org/docs/tools/molecular-docking/vina.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_structure/vina_affinity_constraint.py#L136)

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)
Dock the configured ligand into each proposal's prepared structure with AutoDock Vina.

## API Reference

ConfigVinaAffinityConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/constraint/protein_structure/vina_affinity_constraint.py#L62)

Configuration for the AutoDock Vina docking-affinity constraint.

**ligand** `string` *required*

Ligand SMILES, or a path to a .smi/.sdf file holding one molecule (read into its SMILES).

**search\_box** `VinaSearchBox | VinaReferenceLigandBox` *required*

Explicit box or reference-ligand box, in the prepared structures' frame.

**target\_affinity** `number` (default: -10.0)

Best-pose Vina affinity (kcal/mol) at or below which the score is 0.

**affinity\_tolerance** `number` (default: 10.0)

kcal/mol above target\_affinity at which the score reaches 1.0.

**vina\_config** `VinaDockingConfig`

AutoDock Vina tool configuration.

**structure\_preparation** `StructurePreparationConfig`

How to obtain each proposal's receptor; must share the search box's frame.

ReturnsConstraintOutput

One per proposal. `score` is
`(affinity - target_affinity) / affinity_tolerance` clipped to `[0, 1]`, where
`affinity` is the best pose's Vina score. `metadata` carries `affinity`,
`pose_affinities` (all returned poses, best first), `best_pose_sdf` and
`vina_seed`.

## Usage

```python python icon="python" theme={null}
>>> from proto_language.core import Sequence
>>> receptor = Structure.from_file("example_receptor_1iep.pdb")  # proto-tools Vina fixture
>>> box = VinaSearchBox(center=(15.19, 53.9, 16.92), size=(20.0, 20.0, 20.0))
>>> config = VinaAffinityConfig(ligand="c1ccccc1O", search_box=box)
>>> out = vina_affinity_constraint([(Sequence("MKT", "protein", structure=receptor),)], config)
>>> out[0].metadata["affinity"]  # best-pose Vina affinity in kcal/mol
```

## Metadata

| Property | Value |
| - | - |
| Key | `vina-affinity` |
| Function | `vina_affinity_constraint` |
| Category | `protein_structure` |
| Mode | `discrete` |
| Uses GPU | `False` |
| Supported Types | `protein` |


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