Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::ShapeInference Namespace Reference

Methods to determine local shapes of atoms based on graph information. More...

Data Structures

struct  BindingSite
 Type used to represent minimal binding site information. More...
 

Functions

double bondWeight (BondType bond)
 Map bond type to a floating-point weight. More...
 
int formalCharge (const Graph &graph, AtomIndex index)
 Calculates the formal charge on a main group-element atom. More...
 
boost::optional< Shapes::Shapevsepr (Utils::ElementType centerAtomType, const std::vector< BindingSite > &sites, int formalCharge)
 Applies very basic VSEPR theory to derive a shape based on graph information. More...
 
Shapes::Shape firstOfSize (unsigned size)
 Yields the first shape of required size. More...
 
std::vector< BindingSitereduceToSiteInformation (const Graph &molGraph, AtomIndex index, const RankingInformation &ranking)
 Reduces a ranking to binding site information.
 
boost::optional< Shapes::ShapeinferShape (const Graph &graph, AtomIndex index, const RankingInformation &ranking)
 Forwards inference to appropriate model depending on environment. More...
 

Detailed Description

Methods to determine local shapes of atoms based on graph information.

Function Documentation

double Scine::Molassembler::ShapeInference::bondWeight ( BondType  bond)

Map bond type to a floating-point weight.

Shapes::Shape Scine::Molassembler::ShapeInference::firstOfSize ( unsigned  size)

Yields the first shape of required size.

Complexity \(\Theta(1)\)

Exceptions
std::runtime_errorIf no shapes of size exist
int Scine::Molassembler::ShapeInference::formalCharge ( const Graph &  graph,
AtomIndex  index 
)

Calculates the formal charge on a main group-element atom.

Complexity \(\Theta(1)\)

Parameters
graphThe graph to which the atom index belongs
indexThe atom index for which to calculate the formal charge
Warning
This is an awful concept and should be avoided in any sort of important calculation.
This will yield nonsense if the bond orders in your graph are not correct.
This function may work sometimes for organic neighborhoods. That's how confident we are in this function.
Returns
0 for non-main group elements, possibly the formal charge otherwise
boost::optional<Shapes::Shape> Scine::Molassembler::ShapeInference::inferShape ( const Graph &  graph,
AtomIndex  index,
const RankingInformation &  ranking 
)

Forwards inference to appropriate model depending on environment.

Currently just a stub forwarding to VSEPR

boost::optional<Shapes::Shape> Scine::Molassembler::ShapeInference::vsepr ( Utils::ElementType  centerAtomType,
const std::vector< BindingSite > &  sites,
int  formalCharge 
)

Applies very basic VSEPR theory to derive a shape based on graph information.

Complexity \(\Theta(1)\)