8 #ifndef INCLUDE_MOLASSEMBLER_IO_SMILES_MOLECULE_BUILDER_H
9 #define INCLUDE_MOLASSEMBLER_IO_SMILES_MOLECULE_BUILDER_H
14 #include "boost/variant.hpp"
20 enum class ElementType : unsigned;
24 namespace Molassembler {
45 void addRingClosure(
const BondData& bond);
49 vertexStack.push(vertexStack.top());
54 assert(!vertexStack.empty());
60 lastBondData = SimpleLastBondData::Unbonded;
70 std::vector<Molecule> interpret();
76 static bool isValenceFillElement(Utils::ElementType e);
79 static unsigned valenceFillElementImplicitHydrogenCount(
89 const boost::optional<BondType>& a,
90 const boost::optional<BondType>& b
94 static std::vector<Shapes::Vertex> shapeMap(
const ChiralData& chiralData);
102 const std::vector<unsigned>& componentMap,
103 const std::vector<PrivateGraph::Vertex>& indexInComponentMap
109 const std::vector<unsigned>& componentMap,
110 const std::vector<PrivateGraph::Vertex>& indexInComponentMap
116 const std::vector<unsigned>& componentMap,
117 const std::vector<PrivateGraph::Vertex>& indexInComponentMap
129 boost::variant<SimpleLastBondData, BondData> lastBondData = SimpleLastBondData::Unbonded;
144 std::pair<PrivateGraph::Vertex, boost::optional<BondType>>
MoleculesResult molecules(const Utils::ElementTypeCollection &elements, const AngstromPositions &angstromWrapper, const Utils::BondOrderCollection &bondOrders, BondDiscretizationOption discretization=BondDiscretizationOption::Binary, const boost::optional< double > &stereopermutatorThreshold=1.4)
The function that actually does all the work with the library-internal wrapper.
Semantic interpreter of the smiles grammar, constructs molecules from the data accrued by the parser...
Definition: SmilesMoleculeBuilder.h:34
void branchClose()
Parsing trigger on branch close.
Definition: SmilesMoleculeBuilder.h:53
void setNextAtomBondInformation(const BondData &bond)
Parsing trigger on encountering non-default bond information.
Definition: SmilesMoleculeBuilder.h:64
Definition: SmilesParseData.h:37
Centralizes basic shape data in runtime types.
std::stack< PrivateGraph::Vertex > vertexStack
State to track the vertex a new vertex is bound to.
Definition: SmilesMoleculeBuilder.h:135
std::tuple< PrivateGraph::Vertex, PrivateGraph::Vertex, BondData::StereoMarker > StereoMarkedBondTuple
Storage for bonds marked with stereo indicators ("/" and "\")
Definition: SmilesMoleculeBuilder.h:138
SimpleLastBondData
Storage for bonds marked with stereo indicators ("/" and "\")
Definition: SmilesMoleculeBuilder.h:123
Library internal graph class wrapping BGL types.
Definition: PrivateGraph.h:24
PrivateGraph graph
Possibly disconnected tracking graph.
Definition: SmilesMoleculeBuilder.h:132
Definition: SmilesParseData.h:42
BondType
Discrete bond type numeration.
Definition: Types.h:26
void setNextAtomUnbonded()
Parsing trigger on finding a dot (molecule separator) in place of a bond.
Definition: SmilesMoleculeBuilder.h:59
Definition: SmilesParseData.h:63
std::unordered_map< unsigned, std::pair< PrivateGraph::Vertex, boost::optional< BondType > > > ringClosures
Storage for ring closure bond indicators.
Definition: SmilesMoleculeBuilder.h:145
Define data accrued in smiles parser for consumption in the accompanying molecule builder...
void branchOpen()
Parsing trigger on branch open.
Definition: SmilesMoleculeBuilder.h:48
std::vector< StereoMarkedBondTuple > stereoMarkedBonds
Storage for bonds marked with stereo indicators ("/" and "\")
Definition: SmilesMoleculeBuilder.h:139
std::vector< AtomData > vertexData
AtomData for each created vertex.
Definition: SmilesMoleculeBuilder.h:148
Boost Graph Library wrapper to help in concealing underlying type.