Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ShapeInference.h
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_MOLASSEMBLER_LOCAL_GEOMETRY_MODEL_H
13 #define INCLUDE_MOLASSEMBLER_LOCAL_GEOMETRY_MODEL_H
14 
15 #include "boost/optional/optional_fwd.hpp"
16 
19 
21 
22 #include <map>
23 
24 namespace Scine {
25 namespace Molassembler {
26 
27 // Forward-declarations
28 class Graph;
29 
33 namespace ShapeInference {
34 
38 struct BindingSite {
39  unsigned L, X;
40 
41  std::vector<Utils::ElementType> elements;
42  /* Only one bond type is needed - If the ligand consists of a single atom,
43  * then we only need to store one bond. If the ligand consists of multiple
44  * atoms, then the BondType is Eta.
45  */
46  BondType bondType;
47 
48  BindingSite() = default;
50  const unsigned passL,
51  const unsigned passX,
52  std::vector<Utils::ElementType> passElements,
53  const BondType passBondType
54  ) : L(passL), X(passX), elements(std::move(passElements)), bondType(passBondType) {}
55 };
56 
61 double bondWeight(BondType bond);
62 
84 int formalCharge(
85  const Graph& graph,
86  AtomIndex index
87 );
88 
89 /* Models */
95 boost::optional<Shapes::Shape> vsepr(
96  Utils::ElementType centerAtomType,
97  const std::vector<BindingSite>& sites,
98  int formalCharge
99 );
100 
106 Shapes::Shape firstOfSize(unsigned size);
107 
110 std::vector<BindingSite> reduceToSiteInformation(
111  const Graph& molGraph,
112  AtomIndex index,
113  const RankingInformation& ranking
114 );
115 
120 boost::optional<Shapes::Shape> inferShape(
121  const Graph& graph,
122  AtomIndex index,
123  const RankingInformation& ranking
124 );
125 
126 } // namespace ShapeInference
127 } // namespace Molassembler
128 } // namespace Scine
129 
130 #endif
Ranking data of substituents around a central vertex.
Definition: RankingInformation.h:23
Shapes::Shape firstOfSize(unsigned size)
Yields the first shape of required size.
std::vector< BindingSite > reduceToSiteInformation(const Graph &molGraph, AtomIndex index, const RankingInformation &ranking)
Reduces a ranking to binding site information.
boost::optional< Shapes::Shape > vsepr(Utils::ElementType centerAtomType, const std::vector< BindingSite > &sites, int formalCharge)
Applies very basic VSEPR theory to derive a shape based on graph information.
unsigned size(Shape shape)
Fetch the number of vertices of a shape.
Represents the connectivity of atoms of a molecule.
Definition: Graph.h:54
boost::optional< Shapes::Shape > inferShape(const Graph &graph, AtomIndex index, const RankingInformation &ranking)
Forwards inference to appropriate model depending on environment.
int formalCharge(const Graph &graph, AtomIndex index)
Calculates the formal charge on a main group-element atom.
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
std::vector< std::vector< AtomIndex >> sites(const PrivateGraph &graph, AtomIndex placement, const std::vector< AtomIndex > &excludeAdjacents={})
Differentiate adjacent vertices of a central index into sites.
BondType
Discrete bond type numeration.
Definition: Types.h:26
double bondWeight(BondType bond)
Map bond type to a floating-point weight.
Defines symmetry names and total count.
Shape
Enumeration of all contained symmetry names.
Definition: Shapes.h:28
Data struct storing results of ranking and local graph algorithms.
Type used to represent minimal binding site information.
Definition: ShapeInference.h:38