Chemical graph grammar rule.
More...
#include <ChemRule.hh>
|
typedef
SuperClass::CopyAndPasteOperations | CopyAndPasteOperations |
| Cut-and-paste operation container. More...
|
|
typedef SuperClass::CoreGraph | CoreGraph |
| Access to the CoreGraph template argument. More...
|
|
typedef boost::property
< EdgeLabelProperty,
std::string, boost::property
< EdgeContextProperty,
RuleContext > > | CoreGraph_EdgeProperties |
|
typedef boost::property
< NodeIndexProperty, size_t,
boost::property
< NodeLabelProperty,
std::string, boost::property
< NodeRightLabelProperty,
std::string, boost::property
< NodeContextProperty,
RuleContext > > > > | CoreGraph_NodeProperties |
| The properties available for the nodes of a CoreGraph. More...
|
|
typedef
SuperClass::EdgeContextProperty | EdgeContextProperty |
| Access to the EDGE_RULE_CONTEXT_PROPERTY template argument. More...
|
|
typedef
SuperClass::EdgeLabelProperty | EdgeLabelProperty |
| Access to the EDGE_LABEL_PROPERTY template argument. More...
|
|
typedef std::vector
< sgm::Pattern_Interface::Match_Constraint * > | MatchConstraintVec |
| vector of constraints to be matched More...
|
|
typedef
SuperClass::NodeContextProperty | NodeContextProperty |
| Access to the NODE_RULE_CONTEXT_PROPERTY template argument. More...
|
|
typedef
SuperClass::NodeIndexProperty | NodeIndexProperty |
| Access to the NODE_INDEX_PROPERTY template argument. More...
|
|
typedef
SuperClass::NodeLabelProperty | NodeLabelProperty |
| Access to the NODE_LABEL_PROPERTY template argument. More...
|
|
typedef std::map< size_t, size_t > | NodeMap |
|
typedef
SuperClass::NodeRightLabelProperty | NodeRightLabelProperty |
| Access to the NODE_RIGHT_LABEL_PROPERTY template argument. More...
|
|
typedef std::vector< size_t > | NodeVec |
| Vector of node indices. More...
|
|
typedef std::map< size_t, NodeVec > | OutEdgeMap |
|
typedef SuperClass::RuleCnP | RuleCnP |
| Cut-and-paste operation definition. More...
|
|
enum | RuleContext { RULE_LEFT_SIDE = 2,
RULE_RIGHT_SIDE = 3,
RULE_LABEL_CHANGE = (RULE_LEFT_SIDE * RULE_RIGHT_SIDE),
RULE_CONTEXT = 5 * RULE_LABEL_CHANGE
} |
|
typedef SuperClass::RuleSide | RuleSide |
|
typedef ggl::Rule | SuperClass |
| Access to the super class type. More...
|
|
A description of a graph grammar rule with left and righ rule side and
context description. It describes a chemical reaction as well as its
transition state etc.
- Author
- Martin Mann (c) 2009 http://www.bioinf.uni-freiburg.de/~mmann/
Definition at line 63 of file ChemRule.hh.
The properties available for the edges of a CoreGraph
NOTE: EdgeContextProperty is NOT TO BE allowed to be RULE_LABEL_CHANGE.
Label changes of edges are to be encoded by insertion and deletion of
the edge, ie. present two times with according RULE_LEFT_SIDE and
RULE_RIGHT_SIDE EdgeContextProperty value.
Definition at line 142 of file Rule.hh.
If a node has outgoing edges, this class contains the indices of the ends of these edges.
Definition at line 77 of file Rule.hh.
A container that stores the information of a context side of a graph grammar rule like left, right, and context.
Definition at line 90 of file ChemRule.hh.
A type definition to encode the different use cases of a node or edge of a graph grammar rule.
Enumerator |
---|
RULE_LEFT_SIDE |
graph element is ONLY part of the left rule side
|
RULE_RIGHT_SIDE |
graph element is ONLY part of the right rule side
|
RULE_LABEL_CHANGE |
node is part of the both rule sides but the LABEL is CHANGING. NOTE: only valid for nodes!!!
|
RULE_CONTEXT |
graph element is part of the both rule sides = context of the rule
|
Definition at line 83 of file Rule.hh.
ggl::chem::ChemRule::ChemRule |
( |
const CoreGraph & |
core, |
|
|
const std::string & |
id = std::string("") |
|
) |
| |
Construction of a rule based on the given boost graph based core description.
- Parameters
-
core | the boost graph that describes the graph grammar rule |
id | the identifier or description of the graph grammar rule |
Construction of a rule based on the given boost graph based core description.
- Parameters
-
core | the boost graph that describes the graph grammar rule |
id | the identifier or description of the graph grammar rule |
constraints | the additional constraints for the matching of the left side of the rule |
copyAndPaste | the Cut-and-Paste operations to perform |
Construction of a rule based on the given boost graph based core description.
- Parameters
-
core | the boost graph that describes the graph grammar rule |
id | the identifier or description of the graph grammar rule |
constraints | the additional constraints for the matching of the left side of the rule |
ggl::chem::ChemRule::ChemRule |
( |
const ChemRule & |
toCopy | ) |
|
Copy construction.
- Parameters
-
toCopy | the ChemRule to make this a copy of |
ggl::chem::ChemRule::ChemRule |
( |
const ggl::Rule & |
toCopy | ) |
|
Construction from a normal graph grammar rule.
- Parameters
-
toCopy | the ChemRule to make this a copy of |
virtual ggl::chem::ChemRule::~ChemRule |
( |
| ) |
|
|
virtual |
static void ggl::chem::ChemRule::addImplicitNoEdgeConstraints |
( |
ChemRule & |
toUpdate | ) |
|
|
staticprotected |
Adds no edge constraints for all edges that are right side context only, to avoid the appearance of parallel edges within molecule graphs.
- Parameters
-
static bool ggl::chem::ChemRule::checkAtomComplexWithH |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks if any complex node label (in any context) contains implicit H atoms. This is currently not supported by the library.
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all atom/node labels are ok, false otherwise
static bool ggl::chem::ChemRule::checkAtomLabel |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks if the atom (node) labels are SMILES conform. This is checked for input and output of the rule (left/right side).
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all atom/node label are ok, false otherwise
static bool ggl::chem::ChemRule::checkBondLabel |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks if the bond (edge) labels are SMILES conform. This is checked for input and output of the rule (left/right side).
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all bond/edge label are ok, false otherwise
static bool ggl::chem::ChemRule::checkBondLoop |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks if an atom forms a bond with itself, i.e. a loop bond.
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true iff all bond labels are ok; false otherwise
static bool ggl::Rule::checkEdgeContext |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotectedinherited |
Checks the context assumptions of all edges, ie.
- context edges have to connect context nodes,
- left side edges have to connect left or context nodes, and
- right side edges have to connect right or context nodes.
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all edges show correct context use; false otherwise
static bool ggl::chem::ChemRule::checkEdgeInDel |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks that all bonds in the molecule graph are defined by the correct number of edges. That is either a single context, left, or right edge, or the combination of a left and right edge. Otherwise, no single bond between two atoms are defined by the rule.
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all bond definitions are correct, false otherwise
static bool ggl::chem::ChemRule::checkElectronChange |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks for each atom, if the electron changes of the adjacent bonds and the atom label are balanced.
NOTE: for aromatic atoms, the an unbalanced electron change of 1 is tolerated due to the flexibility of the involved electrons within the aromatic ring.
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if all electron changes are ok, false otherwise
static bool ggl::chem::ChemRule::checkNodeInDel |
( |
const CoreGraph & |
coreGraph | ) |
|
|
staticprotected |
Checks that no node in the graph is created or destroyed, i.e. if all nodes in the given rule core graph are part of the context or undergo a label change
- Parameters
-
coreGraph | the rule core graph to check |
- Returns
- true if no node is created/destroyed, false otherwise
virtual bool ggl::chem::ChemRule::decodeConsistencyStatus |
( |
const size_t |
consistencyCode, |
|
|
std::ostream & |
errorStream, |
|
|
const bool |
completeCheck = true |
|
) |
| |
|
virtual |
Writes a description of the consistency status or errors, encoded in a consistency code produced by isConsistent*(...), to a given outstream. The function returns whether or not an error occured.
- Parameters
-
consistencyCode | the error code to parse, produced by a call to isConsistent(...) |
errorStream | the output stream to write the error decription to |
completeCheck | if true: tries to decode the whole consistencyCode and reports an error message if this is not possible. if false: decodes and reports only the known error codes from consistencyCode |
- Returns
- true if no error is encoded; false otherwise
Reimplemented from ggl::Rule.
const RuleSide& ggl::Rule::getContext |
( |
void |
| ) |
const |
|
inherited |
Access to the context of the Rule that is fixed during the Rule application and that is present in the left and right side of the Rule.
- Returns
- the context
Access to the copy-and-Paste operations to perform
- Returns
- the CnP operation container
const CoreGraph& ggl::Rule::getCore |
( |
void |
| ) |
const |
|
inherited |
Access to the core graph that encodes the whole Rule.
- Returns
- the Rule's core graph
const std::string& ggl::Rule::getID |
( |
void |
| ) |
const |
|
inherited |
Access to the string identifier or description of the Rule.
- Returns
- the identifier
const RuleSide& ggl::Rule::getLeftSide |
( |
void |
| ) |
const |
|
inherited |
Access to the left side pattern of the rule that has to be matched when the Rule is applied.
- Returns
- the left side pattern
Access to the match constraints to fulfill for each left side match
- Returns
- the match constraint container
const RuleSide& ggl::Rule::getRightSide |
( |
void |
| ) |
const |
|
inherited |
Access to the right side pattern that is produced after the Rule was applied.
- Returns
- the right side pattern
Utility member function to derive the node information that describes a certain part of the Rule.
- Parameters
-
graph | the core graph that contains the whole information |
level | identifies what RuleSide is of interest |
- Returns
- the vector of node indices of the requested RuleSide
Access to the minimal transition state of the chemical reaction covered by this chemical graph grammar rule.
- Returns
- the minimal transition state for this rule
virtual const std::string* ggl::chem::ChemRule::getUsedWildcard |
( |
void |
| ) |
const |
|
virtual |
static bool ggl::chem::ChemRule::insertGroups |
( |
CoreGraph & |
core, |
|
|
const GroupMap & |
groups |
|
) |
| throw (std::runtime_error) |
|
static |
Replaces all nodes with group labels with the according molecule component if present in groups. If the group label is unknown, the method returns false; true otherwise.
NOTE: The node replacement is NOT recursive to avoid infinite replacement chains.
- Parameters
-
core | the rule core graph to alter |
groups | the list of known groups to be inserted |
- Returns
- true if all group labels have been replaced; false otherwise
- Exceptions
-
std::runtime_error | if a group is to be insert for a non-context node |
virtual size_t ggl::chem::ChemRule::isConsistent |
( |
void |
| ) |
const |
|
virtual |
Checks whether or not this rule is a consistent one. If not, a combination of according error codes is given.
- Returns
- the value is either C_Consistent, or a product of all other consistency error codes encountered
Reimplemented from ggl::Rule.
Assignment operator
- Parameters
-
toCopy | the ChemRule to make this a copy of |
- Returns
- *this
void ggl::Rule::setID |
( |
const std::string & |
newID | ) |
|
|
inherited |
Sets the string identifier or description of the Rule.
- Parameters
-
newID | the new identifier to set |
virtual void ggl::chem::ChemRule::setUsedWildcard |
( |
const std::string *const |
wildcardToUse | ) |
|
|
virtual |
Overwrites and disables the wildcard setup. This function does NOT change the wildcard, since the wildcard is fixed to MoleculeUtil::AtomLabelWildcard for chemical rules. Thus, this method is a dummy overwrite.
- Parameters
-
wildcardToUse | ignored parameter |
Reimplemented from ggl::Rule.
const size_t ggl::chem::ChemRule_Constants::C_AtomComplexWithH |
|
staticinherited |
consistency code : at least one atom label is complex and contains implicit H atoms, this is currently not supported
Definition at line 42 of file ChemRule.hh.
const size_t ggl::chem::ChemRule_Constants::C_AtomLabelInvalid |
|
staticinherited |
const size_t ggl::chem::ChemRule_Constants::C_BondLabelInvalid |
|
staticinherited |
const size_t ggl::chem::ChemRule_Constants::C_BondLoop |
|
staticinherited |
consistency code : at least one atom label is complex and contains implicit H atoms, this is currently not supported
Definition at line 45 of file ChemRule.hh.
const size_t ggl::Rule_ConCodes::C_Consistent |
|
staticinherited |
const size_t ggl::Rule_ConCodes::C_Consistent |
|
staticinherited |
const size_t ggl::chem::ChemRule_Constants::C_EdgeMultiplicity |
|
staticinherited |
const size_t ggl::chem::ChemRule_Constants::C_NodeInsertDeletion |
|
staticinherited |
const size_t ggl::Rule_ConCodes::C_NoID |
|
staticinherited |
const size_t ggl::Rule_ConCodes::C_NoID |
|
staticinherited |
const size_t ggl::chem::ChemRule_Constants::C_UnbalancedElectrons |
|
staticinherited |
consistency code : the valence/electron change of an atom is not balanced
Definition at line 39 of file ChemRule.hh.
const size_t ggl::Rule_ConCodes::C_WrongEdgeContext |
|
staticinherited |
const size_t ggl::Rule_ConCodes::C_WrongEdgeContext |
|
staticinherited |
std::string ggl::Rule::id |
|
protectedinherited |
the encoding of the minimal transition state of this reaction which is generated on demand (initially not calculated)
Definition at line 378 of file ChemRule.hh.
std::string* ggl::Rule::wildcard |
|
protectedinherited |
The documentation for this class was generated from the following file: