Definition
The ring symmetry energy is the standard deviation of pairwise centroid distances between groups, penalizing asymmetric spacing.
Esym=std(dGi,Gj)
- dGi,Gj is the distance between the backbone centroids of groups Gi and Gj
- The standard deviation is taken over all unique group pairs (or only direct neighbours if
direct_neighbours_only=True)
Parameters
The oracle to use for the energy term.
symmetry_groups
list[list[Residue]]
required
A list of at least length 2, with each element containing a list of residues corresponding to a symmetry group.
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.
Whether to compare the spacing of each each group to its direct neighbour (compare group i to group i+1 only), or each group to all other groups. Defaults to the latter.
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 4 symmetry groups of 40 residues each (with 10-residue gaps)
symmetry_groups = [residues[i * 50 : (i * 50) + 40] for i in range(4)]
ring_symmetry = bg.energies.RingSymmetryEnergy(
oracle=esmfold,
symmetry_groups=symmetry_groups,
weight=1.0,
)
# Add to a state
state = bg.State(
chains=[bg.Chain(residues)],
energy_terms=[ring_symmetry],
name="my_state",
)