Skip to main content

Parameters

name
str
required
Unique identifier for this State.
chains
List[Chain]
required
List of single monomeric Chains in this State.
energy_terms
List[EnergyTerm]
required
Collection of EnergyTerms that define the State.

Methods

oracles_list

total_sequence

energy

Total weighted energy of state. Raises ValueError if no energy terms defined.

energy_term_values

Unweighted energy term values. Raises ValueError if no energy terms defined.

total_residues

remove_residue_from_all_energy_terms

Remove the residue from the energy terms associated to it in the current state. Parameters
chain_ID
str
required
residue_index
int
required

add_residue_to_all_energy_terms

You look within the same chain and the same state and you add the residue to the same energy terms the neighbours are part of. You actually look left and right, and randomly decide between the two. If the residue is at the beginning or at the end of the chain, you just look at one of them. You do it for all terms that are inheritable. Parameters
chain_ID
str
required
ID of the chain where the residue was added
residue_index
int
required
Index of the newly added residue
parent_residue_index
int | None
default:"None"
If provided, use this as the parent residue index (deterministic path). If None, randomly choose between left and right neighbor (usual, default, inference path).
Returns
return
int | None
Index of the parent residue None if the chain is not found in this state

Example

import bagel as bg

residues = [bg.Residue(name='A', chain_ID='A', index=i, mutable=True) for i in range(5)]
chain = bg.Chain(residues)
state = bg.State(name='state_A', chains=[chain], energy_terms=[])