17 #ifndef INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_H
18 #define INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_H
28 namespace Molassembler {
31 struct RankingInformation;
32 class AngstromPositions;
35 namespace Stereopermutators {
44 namespace DistanceGeometry {
92 std::vector<unsigned>(
97 std::vector<std::vector<SiteIndex>> siteGroups
134 [[deprecated(
"Prefer constructor without graph argument")]]
166 const ThermalizationPredicate& thermalization = {},
167 const std::vector<std::vector<SiteIndex>>& siteGroups = {}
234 void assign(boost::optional<unsigned> assignment,
235 const std::vector<std::vector<SiteIndex>>& siteGroups = {});
279 boost::optional<ShapeMap>
fit(
282 const ThermalizationPredicate& thermalization = {}
300 boost::optional<ShapeMap>
fit(
303 const ThermalizationPredicate& thermalization = {}
306 [[deprecated(
"Prefer graph-less alternative parameters")]]
307 boost::optional<ShapeMap>
fit(
321 MASM_NO_EXPORT boost::optional<PropagatedState>
propagate(
323 boost::optional<Shapes::Shape> shapeOption,
325 const ThermalizationPredicate& thermalization = {}
348 const ThermalizationPredicate& thermalization = {},
349 const std::vector<std::vector<SiteIndex>>& siteGroups = {}
352 [[deprecated(
"Prefer graph-less alternative parameters")]]
356 const std::vector<std::vector<SiteIndex>>& siteGroups = {}
449 const std::vector<std::pair<AtomIndex, AtomIndex>>& substitutions = {}
563 std::unique_ptr<Impl> pImpl_;
Centralizes basic shape data in runtime types.
Strongly typed index permutations.
A wrapper class around Utils' PositionCollection to emphasize that the positions stored therein are i...
Definition: AngstromPositions.h:25
Definition: AtomStereopermutatorImpl.h:28
Handles the steric permutation of substituents of a non-terminal central atom.
Definition: AtomStereopermutator.h:79
const std::vector< unsigned > & getFeasible() const
Returns the feasible stereopermutation indices.
AtomStereopermutator(const AtomStereopermutator &other)
Construct an AtomStereopermutator.
void assign(boost::optional< unsigned > assignment, const std::vector< std::vector< SiteIndex >> &siteGroups={})
Changes the assignment of the stereopermutator.
boost::optional< unsigned > indexOfPermutation() const
Returns IOP within the set of symbolic ligand permutations.
AtomIndex placement() const
Returns the atom this permutator is placed on.
void assignRandom(Random::Engine &engine)
Assign the Stereopermutator randomly using relative statistical weights.
const ShapeMap & getShapePositionMap() const
Yields the mapping from site indices to shape positions.
std::tuple< RankingInformation, ShapeMap > PropagatedState
Old state dumped upon propagation.
Definition: AtomStereopermutator.h:102
std::vector< MinimalChiralConstraint > minimalChiralConstraints(bool enforce=false) const
Returns a minimal representation of chiral constraints.
std::string info() const
Returns an information string for diagnostic purposes.
boost::optional< unsigned > assigned() const
Returns the permutation index within the set of feasible permutations, if set.
Eigen::Matrix< double, 3, Eigen::Dynamic > SiteCentroids
Spatial positions of the centroids of sites.
Definition: AtomStereopermutator.h:85
static Shapes::Shape down(Shapes::Shape shape, Shapes::Vertex removedVertex)
Picks a shape retaining as much chiral state as possible on a shape size decrease.
std::function< bool(AtomIndex, Shapes::Shape, const RankingInformation &)> ThermalizationPredicate
Predicate to decide whether an atom stereopermutator is thermalized.
Definition: AtomStereopermutator.h:88
bool thermalized() const
Returns whether the stereopermutations are thermalized.
void thermalize(bool thermalization=true)
Unconditionally thermalize the stereopermutations.
AtomStereopermutator(AtomIndex centerAtom, Shapes::Shape shape, RankingInformation ranking, const FeasiblesGenerator &feasibility={}, const ThermalizationPredicate &thermalization={}, const std::vector< std::vector< SiteIndex >> &siteGroups={})
Construct an AtomStereopermutator.
std::string rankInfo() const
Returns an information string for ranking equality checking purposes.
~AtomStereopermutator()
Construct an AtomStereopermutator.
void setShape(Shapes::Shape shape, const FeasiblesGenerator &feasibility={}, const ThermalizationPredicate &thermalization={}, const std::vector< std::vector< SiteIndex >> &siteGroups={})
Change the underlying shape of the permutator.
boost::optional< ShapeMap > fit(const SiteCentroids ¢roids, const FeasiblesGenerator &feasibility={}, const ThermalizationPredicate &thermalization={})
Determine the shape and assignment realized in positions.
unsigned numStereopermutations() const
Returns the number of possible stereopermutations.
boost::optional< PropagatedState > propagate(RankingInformation newRanking, boost::optional< Shapes::Shape > shapeOption, const FeasiblesGenerator &feasibility={}, const ThermalizationPredicate &thermalization={})
Propagate the stereocenter state through a possible ranking change.
void propagateVertexRemoval(AtomIndex removedIndex)
Adapts atom indices in the internal state to the removal of an atom.
std::function< std::vector< unsigned >(const Stereopermutators::Abstract &abstract, Shapes::Shape shape, AtomIndex placement, const RankingInformation &ranking, std::vector< std::vector< SiteIndex > > siteGroups) > FeasiblesGenerator
Generator function to list spatially feasible permutation indices.
Definition: AtomStereopermutator.h:99
AtomStereopermutator(const Graph &graph, Shapes::Shape shape, AtomIndex centerAtom, RankingInformation ranking)
Construct an AtomStereopermutator.
std::vector< std::vector< SiteIndex > > siteGroups() const
Returns site indices grouped by rotational interconversion.
Shapes::Shape getShape() const
Returns the underlying shape.
AtomStereopermutator(AtomStereopermutator &&other) noexcept
Construct an AtomStereopermutator.
static bool thermalized(AtomIndex centerAtom, Shapes::Shape shape, const RankingInformation &ranking, const Graph &graph)
Decide whether stereopermutations are thermalized based on the graph.
const RankingInformation & getRanking() const
Returns the underlying ranking.
void setShape(Shapes::Shape shape, const Graph &graph, const std::vector< std::vector< SiteIndex >> &siteGroups={})
Changes the assignment of the stereopermutator.
static auto thermalizationFunctor(const Graph &g)
Binds a graph instance into a functor invoking thermalized.
Definition: AtomStereopermutator.h:215
unsigned numAssignments() const
Returns the number of possible assignments.
static Shapes::Shape up(Shapes::Shape shape)
Picks a shape retaining as much chiral state as possible on a shape size increase.
const Stereopermutators::Abstract & getAbstract() const
Returns the underlying feasible stereopermutations object.
void applyPermutation(const std::vector< AtomIndex > &permutation)
Applies an atom index permutation.
std::array< boost::optional< SiteIndex >, 4 > MinimalChiralConstraint
Site index sequence defining a chiral constraint. If a site index is None, then it denotes the positi...
Definition: AtomStereopermutator.h:108
boost::optional< ShapeMap > fit(const Graph &graph, const AngstromPositions &angstromWrapper)
Changes the assignment of the stereopermutator.
double angle(SiteIndex i, SiteIndex j) const
Fetches angle between binding sites in the idealized shape.
boost::optional< ShapeMap > fit(const AngstromPositions &wrapper, const FeasiblesGenerator &feasibility={}, const ThermalizationPredicate &thermalization={})
Determine the shape and assignment realized in positions.
SiteCentroids sitePositions(const AngstromPositions &wrapper, const std::vector< std::pair< AtomIndex, AtomIndex >> &substitutions={}) const
Generate site centroid positions from a whole-molecule set of positions.
Class performing spatial modeling of molecules.
Definition: SpatialModel.h:40
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:54
Drives a PRNG.
Definition: Prng.h:24
ShapeResult shape(const PositionCollection &normalizedPositions, Shape shape)
Forwarding function to calculate the continuous shape measure.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
Data struct representing a chiral constraint.
Definition: DistanceGeometry.h:32
Class to compute the set of abstract permutations from ranking and shape.
Definition: AbstractPermutations.h:24
Definition: FeasiblePermutations.h:51