Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AtomStereopermutatorImpl.h
Go to the documentation of this file.
1 
8 #ifndef INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_IMPL_H
9 #define INCLUDE_MOLASSEMBLER_ATOM_STEREOPERMUTATOR_IMPL_H
10 
12 
16 
17 #include "boost/optional.hpp"
18 
19 namespace Scine {
20 namespace Molassembler {
21 
22 namespace Shapes {
23 namespace Properties {
24 struct ShapeTransitionGroup;
25 } // namespace Properties
26 } // namespace Shapes
27 
29 public:
30 /* Typedefs */
32 
35 
42 
49  static Shapes::Shape down(Shapes::Shape shape, Shapes::Vertex removedVertex);
50 
54  static boost::optional<std::vector<Shapes::Vertex>> selectTransitionMapping(
55  const Shapes::Properties::ShapeTransitionGroup& mappingsGroup,
56  const ChiralStatePreservation& preservationOption
57  );
58 
60  static bool thermalized(
61  const Graph& graph,
62  AtomIndex centerAtom,
63  const Shapes::Shape shape,
64  const RankingInformation& ranking
65  );
67 
68 /* Constructors */
77  Impl(
78  const Graph& graph,
79  Shapes::Shape shape,
80  AtomIndex centerAtom,
81  RankingInformation ranking
82  );
83 
84 /* Modification */
86  void assign(boost::optional<unsigned> assignment);
87 
92  void assign(std::vector<Shapes::Vertex> vertexMapping);
93 
95  void assignRandom(Random::Engine& engine);
96 
102  void applyPermutation(const std::vector<AtomIndex>& permutation);
103 
109  boost::optional<ShapeMap> fit(
110  const Graph& graph,
111  const AngstromPositions& angstromWrapper
112  );
113 
119  boost::optional<PropagatedState> propagate(
120  const Graph& graph,
121  RankingInformation newRanking,
122  boost::optional<Shapes::Shape> shapeOption
123  );
124 
129  void propagateVertexRemoval(AtomIndex removedIndex);
130 
132  void setShape(
133  Shapes::Shape shape,
134  const Graph& graph
135  );
136 
137 /* Information */
139  double angle(SiteIndex i, SiteIndex j) const;
140 
148  boost::optional<unsigned> assigned() const;
149 
151  AtomIndex placement() const;
152 
160  boost::optional<unsigned> indexOfPermutation() const;
161 
175  std::vector<MinimalChiralConstraint> minimalChiralConstraints(bool enforce = false) const;
176 
178  std::string info() const;
179 
181  std::string rankInfo() const;
182 
191  std::vector<std::vector<SiteIndex>> siteGroups() const;
192 
198 
204 
206  const RankingInformation& getRanking() const;
207 
209  Shapes::Shape getShape() const;
210 
215  const ShapeMap& getShapePositionMap() const;
216 
225  unsigned numAssignments() const;
226 
233  unsigned numStereopermutations() const;
234 
235 /* Operators */
236  inline auto tie() const {
237  return std::make_tuple(shape_, centerAtom_, numStereopermutations(), assigned());
238  }
239 
240 private:
241 /* State */
244 
247 
250 
253 
256 
258  boost::optional<unsigned> assignmentOption_;
259 
262 
265 };
266 
267 } // namespace Molassembler
268 
269 } // namespace Scine
270 
271 #endif
ShapeMap shapePositionMap_
Derived property of assignmentOption_.
Definition: AtomStereopermutatorImpl.h:261
boost::optional< ShapeMap > fit(const Graph &graph, const AngstromPositions &angstromWrapper)
A grouping of index mappings of equal angular and chiral distortion.
Definition: Properties.h:233
boost::optional< PropagatedState > propagate(const Graph &graph, RankingInformation newRanking, boost::optional< Shapes::Shape > shapeOption)
Compute the set of abstract permutations.
Ranking data of substituents around a central vertex.
Definition: RankingInformation.h:23
AtomIndex placement() const
Returns a single-element vector containing the central atom.
boost::optional< unsigned > indexOfPermutation() const
Returns IOP within the set of symbolic ligand permutations.
Generates all operators using a method returning a tuple.
Definition: OperatorSuppliers.h:84
Drives a PRNG.
Definition: Prng.h:24
Represent abstract stereopermutation around atom center.
Definition: Stereopermutation.h:32
A wrapper class around Utils&#39; PositionCollection to emphasize that the positions stored therein are i...
Definition: AngstromPositions.h:25
void setShape(Shapes::Shape shape, const Graph &graph)
If the shape is changed, we must adapt.
ShapeResult shape(const PositionCollection &normalizedPositions, Shape shape)
Forwarding function to calculate the continuous shape measure.
unsigned numAssignments() const
Returns the number of possible permutations.
ChiralStatePreservation
Specifies the effects of graph modifications on chiral centers.
Definition: Options.h:129
const RankingInformation & getRanking() const
Returns the underlying ranking.
Stereopermutators::Feasible feasible_
Models abstract stereopermutations and decides three-dimensional feasibility.
Definition: AtomStereopermutatorImpl.h:255
void assignRandom(Random::Engine &engine)
Assigns the Stereopermutator randomly using relative stereopermutation weights.
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:57
static boost::optional< std::vector< Shapes::Vertex > > selectTransitionMapping(const Shapes::Properties::ShapeTransitionGroup &mappingsGroup, const ChiralStatePreservation &preservationOption)
Selects a shape vertex mapping from a shape transition group.
void applyPermutation(const std::vector< AtomIndex > &permutation)
Applies an atom index permutation.
Definition: AtomStereopermutatorImpl.h:28
Decide which stereopermutations are feasible.
const Stereopermutators::Abstract & getAbstract() const
Returns the underlying AbstractStereopermutation.
Impl(const Graph &graph, Shapes::Shape shape, AtomIndex centerAtom, RankingInformation ranking)
Constructor.
Handle arrangements of substituents at corners of an atom-centered shape.
boost::optional< unsigned > assignmentOption_
The current state of assignment (if or not, and if so, which)
Definition: AtomStereopermutatorImpl.h:258
AtomIndex centerAtom_
Central atom of the Stereopermutator.
Definition: AtomStereopermutatorImpl.h:243
Shapes::Shape getShape() const
Returns the underlying shape.
static bool thermalized(const Graph &graph, AtomIndex centerAtom, const Shapes::Shape shape, const RankingInformation &ranking)
Whether the stereopermutations interconvert rapidly at selected temp.
const ShapeMap & getShapePositionMap() const
Yields the mapping from site indices to shape positions.
void propagateVertexRemoval(AtomIndex removedIndex)
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
std::vector< MinimalChiralConstraint > minimalChiralConstraints(bool enforce=false) const
Returns a minimal representation of chiral constraints.
const Stereopermutators::Feasible & getFeasible() const
Returns the underlying FeasibleStereopermutation.
std::string info() const
Returns an information string for diagnostic purposes.
bool thermalized_
Whether all feasible assignments interconvert thermally.
Definition: AtomStereopermutatorImpl.h:264
Shapes::Shape shape_
The shape the stereopermutator represents.
Definition: AtomStereopermutatorImpl.h:246
unsigned numStereopermutations() const
Returns the number of symbolic ligand permutations.
Class to compute the set of abstract permutations from ranking and shape.
Definition: AbstractPermutations.h:24
double angle(SiteIndex i, SiteIndex j) const
Returns the angle between two site indices in the idealized shape.
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.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
Data struct to store chiral constraints for DG.
Definition: FeasiblePermutations.h:24
static Shapes::Shape up(Shapes::Shape shape)
Picks a shape retaining as much chiral state as possible on a shape size increase.
boost::optional< unsigned > assigned() const
Returns the permutation index within the set of possible permutations, if set.
Stereopermutators::Abstract abstract_
Abstract stereopermutations and intermediate state.
Definition: AtomStereopermutatorImpl.h:252
std::string rankInfo() const
Returns an information string for ranking equality checking purposes.
std::vector< std::vector< SiteIndex > > siteGroups() const
Returns site indices grouped by rotational interconversion.
void assign(boost::optional< unsigned > assignment)
Changes the assignment of the stereopermutator.
RankingInformation ranking_
Ranking information of substituents.
Definition: AtomStereopermutatorImpl.h:249