Definition
The secondary structure energy is the fraction of selected residues whose assigned secondary structure does not match the target.
ESS=NG1α∈G∑I[SSα=SStarget]
- I is the indicator function (1 if the condition is true, 0 otherwise)
- SSα is the secondary structure assignment for residue α
- SStarget is the target secondary structure (alpha-helix, beta-sheet, or coil)
- NG is the number of residues in the group G
Parameters
The oracle to use for the energy term.
Which residues to include in the calculation.
target_secondary_structure
Which secondary structure type to drive towards. Options are ‘alpha-helix’, ‘beta-sheet’, or ‘coil’.
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.
The weight of the energy term.
Optional name to append to the energy term name.
Methods
compute
Parameters
oracles_result
OraclesResultDict
required
Example
import numpy as np
import bagel as bg
# Create a 190-residue chain
sequence = np.random.choice(list(bg.constants.aa_dict.keys()), size=190)
residues = [bg.Residue(name=aa, chain_ID="A", index=i, mutable=True) for i, aa in enumerate(sequence)]
# Create the folding oracle
esmfold = bg.oracles.ESMFold()
# Define groups of residues that should form beta-sheets
groups = [residues[(i * 50) + 5 : (i * 50) + 35] for i in range(4)]
secondary_structure = bg.energies.SecondaryStructureEnergy(
oracle=esmfold,
residues=groups,
target_secondary_structure="beta-sheet",
weight=1.0,
)
# Add to a state
state = bg.State(
chains=[bg.Chain(residues)],
energy_terms=[secondary_structure],
name="my_state",
)