> ## Documentation Index
> Fetch the complete documentation index at: https://bagel.softnanolab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PLDDTEnergy

> Predicted Local Distance Difference Test energy. This is the spread of the predicted separation between an atom and each of its nearest neighbours. This translates to how confident the model is that the sequence has a single lowest energy structure, as opposed to a disordered, constantly changing structure. This energy is averaged over the relevant atoms.

## Definition

The pLDDT energy is the negated mean pLDDT over the specified residue groups.

$$
E_{\mathrm{pLDDT}} = -\frac{1}{N_G} \sum_{\alpha \in G} \mathrm{pLDDT}_\alpha
$$

* $G$ is the set of residues in the specified groups
* $N_G$ is the number of residues in $G$
* $\mathrm{pLDDT}_\alpha$ is the predicted local distance difference test score for residue $\alpha$

## Parameters

<ResponseField name="oracle" type="FoldingOracle" required>
  The oracle to use for the energy term.
</ResponseField>

<ResponseField name="residues" type="list[Residue] | None" required>
  Which residues to include in the calculation.
</ResponseField>

<ResponseField name="inheritable" type="bool" default="True">
  If a new residue is added next to a residue included in this energy term, this dictates whether that new residue could then be added to this energy term.
</ResponseField>

<ResponseField name="weight" type="float" default="1.0">
  The weight of the energy term.
</ResponseField>

<ResponseField name="name" type="str | None" default="None">
  Optional name to append to the energy term name.
</ResponseField>

## Methods

### compute

**Parameters**

<ResponseField name="oracles_result" type="OraclesResultDict" required />

## Example

```python theme={null}
import bagel as bg

# Create the folding oracle
esmfold = bg.oracles.ESMFold()

# Maximize pLDDT confidence for a specific group of residues (e.g. a binder)
plddt_energy = bg.energies.PLDDTEnergy(
    oracle=esmfold,
    residues=residues_binder,
    weight=5.0,
)

# Add to a state alongside other energy terms
state = bg.State(
    chains=[binder_chain, target_chain],
    energy_terms=[plddt_energy],
    name="my_state",
)
```
