Design Mutator
One of the AbstractMutator
types made available by the ProtoSyn.Peptides module is the DesignMutator
, whose objective is to select one or more random Residue
instances (optionally, in a selection) for design, changing the aminoacid nature (and, consequentially, the sidechain Atom
instances).
ProtoSyn.Peptides.Mutators.DesignMutator
— TypeDesignMutator(p_mut::AbstractFloat, grammar::LGrammar, selection::Opt{AbstractSelection}; [searchable_aminoacids::Dict{Char, Bool} = Peptides.available_aminoacids])
Return a DesignMutator
instance. This AbstractMutator
is a functor, called with the following signature:
(design_mutator::DesignMutator)(pose::Pose)
The DesignMutator
AbstractMutator
loops through all Atom
instances in the given Pose
and applies a mutation (using the mutate!
method) if a random number (rand()
) is bellow a given probability of mutation p_mut
. A different mutation is attempted for each Atom
instance looped over (therefore, for a single attempt at a mutation per Residue
, unique Atom
names should be selected, as an"CA"
, for example). If an AbstractSelection
selection
is provided, only Atom
instances marked as true
in this selection are considered for mutation. The applied mutation is sampled from the given searchable_aminoacids
dictionary (only for entries marked as true
), and uses the given LGrammar
grammar
to perform the mutation. If no searchable_aminoacids
dictionary is provided, will use the default Peptides.available_aminoacids
dictionary (contains all aminoacids set as true
). Note that the DesignMutator
syncs any pending cartesian to internal coordinate conversion (using the c2i!
method). Requests internal to cartesian coordinates conversion (using the request_i2c!
method). Does not sync!
the given Pose
afterwards.
The DesignMutator
AbstractMutator
can also be optionally called using the following signature, in which case only the provided list of Atom
instances will be considered for the application of this AbstractMutator
.
(design_mutator::DesignMutator)(pose::Pose, atoms::Vector{Atom})
Fields
p_mut::AbtractFloat
- Compared against arand()
call, applies this Mutator toAtom
instances whererand() < p_mut
;grammar::LGrammar
- TheLGrammar
instance with the aminoacid templates;selection::Opt{AbstractSelection}
- If given, this Mutator will only loop over the selectedAtom
instances;searchable_aminoacids::Dict{Char, Bool}
- The dictionary of available aminoacids, where each entry sets the availability of that aminoacid type to be the result of the mutation.
See also
Examples
julia> dm = ProtoSyn.Peptides.Mutators.DesignMutator(1.0, res_lib, an"CA")
⚯ Design Mutator:
+----------------------------------------------------------------------+
| Index | Field | Value |
+----------------------------------------------------------------------+
| 1 | grammar | Set ✓ |
| 2 | p_mut | 1.000 |
+----------------------------------------------------------------------+
● Searchable aminoacids: M 🗹 | K 🗹 | P 🗹 | N 🗹 | I 🗹 | H 🗹 | E 🗹 | W 🗹 | S 🗹 | T 🗹 | C 🗹 | D 🗹 | A 🗹 | L 🗹 | Y 🗹 | V 🗹 | R 🗹 | G 🗹 | Q 🗹 | F 🗹
● Selection: Set
└── FieldSelection › Atom.name = CA
Figure 1 | Schematic description of the DesignMutator
.
Figure 2 | Example of the application of DesignMutator
to simulateously mutate of all Residue
instances.