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

Class to help validate aromatic subgraphs in parsed smiles strings. More...

#include <SmilesMoleculeBuilder.h>

Data Structures

struct  EligibleOmissible
 Data struct for eligibleOmissible() More...
 

Public Types

Types
using BaseGraph = boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, boost::no_property, boost::property< boost::edge_index_t, int > >
 
using Graph = boost::subgraph< BaseGraph >
 
using Vertex = typename BaseGraph::vertex_descriptor
 
using Edge = typename BaseGraph::edge_descriptor
 
using IndexMap = boost::bimap< Vertex, Vertex >
 
using VertexSet = std::unordered_set< Vertex >
 

Public Member Functions

Modification
Vertex findOrAdd (Vertex i)
 Find a precursor vertex's subgraph index, inserting it if not present.
 
boost::optional< VertexSet > match ()
 Find a precursor vertex's subgraph index, inserting it if not present.
 

Static Public Member Functions

Static predicates
static bool hasUnpairedElectrons (Vertex i, int charge, const PrivateGraph &g)
 Decide whether an element type is allowed to be in the pi subgraph. More...
 
static bool permittedElementType (Utils::ElementType e)
 Decide whether an element type is allowed to be in the pi subgraph. More...
 
static EligibleOmissible eligibleOmissible (Vertex i, const PrivateGraph &component, const AtomData &atomData)
 Determine viability and omissibility of a vertex in a pi subgraph. More...
 
static boost::optional
< EligibleOmissible
multipleOrderAdjacent (Vertex i, const PrivateGraph &component, const AtomData &atomData, const boost::optional< unsigned > &neighborCount)
 Decide whether an element type is allowed to be in the pi subgraph. More...
 
static boost::optional
< EligibleOmissible
threeNeighborChargedCarbon (Vertex i, const PrivateGraph &component, const AtomData &atomData, const boost::optional< unsigned > &neighborCount)
 Decide whether an element type is allowed to be in the pi subgraph. More...
 
static boost::optional
< EligibleOmissible
neutralTrivalents (Vertex i, const PrivateGraph &component, const AtomData &atomData, const boost::optional< unsigned > &neighborCount)
 Decide whether an element type is allowed to be in the pi subgraph. More...
 
static boost::optional
< EligibleOmissible
neutralDivalents (Vertex i, const PrivateGraph &component, const AtomData &atomData, const boost::optional< unsigned > &neighborCount)
 Decide whether an element type is allowed to be in the pi subgraph. More...
 

Data Fields

Data
Graph graph
 Subgraph data structure.
 
IndexMap index
 Index mapping from precursor to subgraph vertex index.
 
VertexSet omissible
 Set of omissible subgraph vertices.
 

Detailed Description

Class to help validate aromatic subgraphs in parsed smiles strings.

Atoms marked aromatic in a SMILES string must form a valid pi subgraph. Also, a perfect matching of the pi subgraph must be found that indicates which vertices of the system receive incremented formal valences so that hydrogen filling can proceed correctly.

This class is here to help with both.

Member Function Documentation

static EligibleOmissible Scine::Molassembler::IO::PiSubgraph::eligibleOmissible ( Vertex  i,
const PrivateGraph component,
const AtomData atomData 
)
static

Determine viability and omissibility of a vertex in a pi subgraph.

Vertices that are marked aromatic in a SMILES string may not be eligible for perfect matching, i.e. marking an adjacent edge as a double bond in finding an alternating sequence of single and double bonds. For instance, a neutral nitrogen atom with three neighbors is not viable for addition to the subgraph. If the nitrogen atom is neutral and has two neighbors, it is viable for addition but optionally omissible, since the missing valence can be filled by hydrogen filling. It can, but does need to have an adjacent edge marked as a double bond.

Parameters
iVertex index of the atom within the component graph
componentThe graph of the smiles component
atomDataThe parsed atom data from the SMILES string
static bool Scine::Molassembler::IO::PiSubgraph::hasUnpairedElectrons ( Vertex  i,
int  charge,
const PrivateGraph g 
)
static

Decide whether an element type is allowed to be in the pi subgraph.

Parameters
eThe element type for which to decide basic eligibility
Precondition
e Must be an element type base
static boost::optional<EligibleOmissible> Scine::Molassembler::IO::PiSubgraph::multipleOrderAdjacent ( Vertex  i,
const PrivateGraph component,
const AtomData atomData,
const boost::optional< unsigned > &  neighborCount 
)
static

Decide whether an element type is allowed to be in the pi subgraph.

Parameters
eThe element type for which to decide basic eligibility
Precondition
e Must be an element type base
static boost::optional<EligibleOmissible> Scine::Molassembler::IO::PiSubgraph::neutralDivalents ( Vertex  i,
const PrivateGraph component,
const AtomData atomData,
const boost::optional< unsigned > &  neighborCount 
)
static

Decide whether an element type is allowed to be in the pi subgraph.

Parameters
eThe element type for which to decide basic eligibility
Precondition
e Must be an element type base
static boost::optional<EligibleOmissible> Scine::Molassembler::IO::PiSubgraph::neutralTrivalents ( Vertex  i,
const PrivateGraph component,
const AtomData atomData,
const boost::optional< unsigned > &  neighborCount 
)
static

Decide whether an element type is allowed to be in the pi subgraph.

Parameters
eThe element type for which to decide basic eligibility
Precondition
e Must be an element type base
static bool Scine::Molassembler::IO::PiSubgraph::permittedElementType ( Utils::ElementType  e)
inlinestatic

Decide whether an element type is allowed to be in the pi subgraph.

Parameters
eThe element type for which to decide basic eligibility
Precondition
e Must be an element type base
static boost::optional<EligibleOmissible> Scine::Molassembler::IO::PiSubgraph::threeNeighborChargedCarbon ( Vertex  i,
const PrivateGraph component,
const AtomData atomData,
const boost::optional< unsigned > &  neighborCount 
)
static

Decide whether an element type is allowed to be in the pi subgraph.

Parameters
eThe element type for which to decide basic eligibility
Precondition
e Must be an element type base

The documentation for this struct was generated from the following file: