Skip to main content

Parameters

n_mutations
int
default:"1"
Number of mutations to perform in each step.
mutation_bias
Dict[str, float]
default:"mutation_bias_no_cystein"
Bias for the substitution. The keys are the amino acids, the values are the probabilities.
move_probabilities
dict[str, float]
Probabilities for the different moves. The keys are ‘substitution’, ‘addition’, and ‘removal’, and the values are the probabilities of performing the corresponding move. These should be normalized to sum to 1.
exclude_self
bool
default:"True"

Methods

remove_random_residue

Parameters
chain
Chain
required
system
System
required

add_random_residue

Parameters
chain
Chain
required
system
System
required

one_step

Parameters
system
System
required

Example

import bagel as bg

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

mutator = bg.mutation.GrandCanonical(
    move_probabilities={'substitution': 0.5, 'addition': 0.25, 'removal': 0.25}
)
mutated_system, mutation_record = mutator.one_step(system)