Compound Mutator
The Compound Mutator is an aggregating type of AbstractMutator
. The sole function of this mutator is to apply multiple inner AbstractMutator
instances in sequence. Optionally, if a selection is provided, all inner AbstractMutator
instance's selection is merged with this common selection.
ProtoSyn.Mutators.CompoundMutator
— TypeCompoundMutator(mutators::Vector{AbstractMutator}, selection::Union{AbstractSelection, Nothing})
Return a CompoundMutator
instance. This AbstractMutator
is a functor, called with the following signature:
(compound_mutator::CompoundMutator)(pose::Pose)
A CompoundMutator
loops over a list of one or more AbstractMutator
instances, applying them in the provided sequence to a Pose
instance. If an AbstractSelection
selection
is provided, the same selection will be used when applying each AbstractMutator
, merged with any possible inner selection specific for each mutator (using the & "and" operator). For example, a DihedralMutator
may have an an"CA"
selection attached. When called from a CompoundMutator
with a rid"1:10"
selection attached, only the CA
Atom
instances from the region between Residue
1 to Residue
10 will be considered for application of the DihedralMutator
. Note that, when applying each mutator, any required sync!
call and request for internal to cartesian coordinate conversion (or vice-versa) are handled by each AbstractMutator
independently.
The CompoundMutator
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
(i.e.: CompoundMutator
of a CompoundMutator
).
(compound_mutator::CompoundMutator)(pose::Pose, atoms::Vector{Atom})
This AbstractMutator
requires that the mutators provided in the list have a (compound_mutator::CompoundMutator)(pose::Pose, atoms::Vector{Atom})
signature. Check each AbstractMutator
documentation entry and Creating custom mutators section for details.
Fields
mutators::Vector{AbstractMutator}
- The list ofAbstractMutator
instances this mutator will loop over and apply sequentially;selection::Union{AbstractSelection, Nothing}
- If provided, all innerAbstractMutator
instances will be applied to each individual selection (if present) merged with this common selection.
See also
Examples
julia> m = ProtoSyn.Mutators.CompoundMutator([rrbm, trbm], an"CBZ")
⚯ Compound Mutator:
├── ● Inner Mutators (2 elements):
| ├── ⚯ Rotation Rigid Body Mutator:
| | +----------------------------------------------------------------------+
| | | Index | Field | Value |
| | +----------------------------------------------------------------------+
| | | 1 | axis_sampler | Function rand_vector_in_sphere |
| | | 2 | angle_sampler | Function randn |
| | | 3 | pivot_sampler | Function center_of_mass |
| | | 4 | step_size | 0.4000 |
| | +----------------------------------------------------------------------+
| | ● Selection: Set
| | └── BinarySelection ❯ & "and" (Atom)
| | ├── FieldSelection › Atom.name = CA
| | └── FieldSelection › Atom.name = CB
| |
| └── ⚯ Translation Rigid Body Mutator:
| +----------------------------------------------------------------------+
| | Index | Field | Value |
| +----------------------------------------------------------------------+
| | 1 | translation_vector_sampler | Function rand_vector_in_sphere |
| | 2 | step_size | 1.0000 |
| +----------------------------------------------------------------------+
| ○ Selection: Not Set
|
└── ● Selection: Set
└── FieldSelection › Atom.name = CBZ
Figure 1 | A diagram of an example CompoundMutator
instance. In this example, the CompoundMutator
.mutators
list is comprised of a RotationRigidBodyMutator
and a TranslationRigidBodyMutator
, both without any internal selections. The CompoundMutator
itself, however, has a RandomSelectionFromList
AbstractSelection
which will randomly select one of the two provided RangeSelection
instances and apply both the rotation and translation rigid body mutators.