Skip to main content
EnergyTerms can be inheritable, which is only relevant for bagel.mutation.GrandCanonical. In that type of simulation when adding a new residues, the “inheritable” attribute decides whether or not the new residue will be added to the residues for which this term is calculated. In general, a new residue inherits all energy terms of one of its neighbours (chosen randomly to be the left or right neighbour), if these terms are inheritable.

Definition

The total energy of a state is the weighted sum of all its energy terms: ES=jNSwjsϵjs({C}S)E_{S} = \sum_{j}^{N_S} w_{js}\,\epsilon_{js}(\{C\}_S)
  • ESE_S is the energy of state SS
  • wjsw_{js} is the weight of energy term jj in state SS
  • ϵjs\epsilon_{js} is the unweighted energy of term jj
  • {C}S\{C\}_S is the set of chains in state SS

Parameters

name
str
required
The name of the energy term.
oracle
Oracle
required
The oracle to use for the energy term.
inheritable
bool
required
Whether the energy term is inheritable.
weight
float
default:"1.0"
The weight of the energy term.

Methods

compute

Calculates the EnergyTerm’s energy given information about the folded structure. The result is returned and stored as an internal attribute (.value). Parameters
oracles_result
OraclesResultDict
required
Dictionary mapping oracles to their results. This is used to get the relevant information for the energy term.
Returns
return
(unweighted_energy, weighted_energy) : tuple[float, float]
return
float
How well the structure satisfies the given criteria. Where possible, this number should be between 0 and 1.
return
float
The unweighted energy multiplied by the energy term’s weight.

shift_residues_indices_after_removal

Shifts internally stored res_indices on a given chain to reflect a residue has been removed from the chain. Parameters
chain_id
str
required
res_index
int
required

shift_residues_indices_before_addition

Shifts internally stored res_indices on a given chain to reflect a residue has been added. Parameters
chain_id
str
required
res_index
int
required

remove_residue

Remove residue from this energy term’s calculations. Parameters
chain_id
str
required
res_index
int
required

add_residue

Adds residue to this energy term’s calculations, in the same group as its parent residue. Parameters
chain_id
str
required
res_index
int
required
parent_res_index
int
required

get_residue_mask

Creates residue mask from residue group. Structure used to find unique residues in state Parameters
structure
AtomArray
required
residue_group_index
int
required

get_atom_mask

Creates atom mask from residue group. Structure used to find unique atoms in state Parameters
structure
AtomArray
required
residue_group_index
int
required