#include <templateMolecule.hh>
TemplateMolecules are regular expression like objects needed to identify specific configurations of connected Molecules. Individual TemplateMolecules are derived from a particular MoleculeType and inherit their set of components from their parent MoleculeType. TemplateMolecules can be connected to other TemplateMolecules through component bonds forming the regular expression pattern. An individual Molecule matches an individual TemplateMolecule if they are of the same MoleculeType and their component bonds and state values match. Any component state not explicitly specified in a TemplateMolecule is treated as a wild-card and will always match the corresponding component of a Molecule. For more complex patterns, an entire connected set of Molecules is matched to a connected set of TemplateMolecules through a recursive algorithm that checks for graph isomorphism between the two sets. The worst case performance of the recursive matching algorithm is proportional to the number of connected TemplateMolecules in the pattern. However, the average performance is much better because a match is rejected as soon as a single difference in component states or molecule connectivity is found.
Public Member Functions | |
TemplateMolecule (MoleculeType *moleculeType) | |
~TemplateMolecule () | |
MoleculeType * | getMoleculeType () const |
string | getMoleculeTypeName () const |
int | getN_symComps () const |
int | getN_symCompBonds () const |
int | getN_mapGenerators () const |
int | getN_connectedTo () const |
void | addEmptyComponent (string cName) |
void | addBoundComponent (string cName) |
void | addComponentConstraint (string cName, string stateName) |
void | addComponentConstraint (string cName, int stateValue) |
void | addComponentExclusion (string cName, string stateName) |
void | addComponentExclusion (string cName, int stateValue) |
void | addBond (string thisBsiteName, TemplateMolecule *t2, string bSiteName2) |
void | addConnectedTo (TemplateMolecule *t2, int otherConToIndex) |
void | addConnectedTo (TemplateMolecule *t2, int otherConToIndex, bool otherHasRxnCenter) |
void | clearConnectedTo () |
void | addSymCompConstraint (string cName, string uniqueId, int bondState, int stateConstraint) |
void | addSymBond (string thisBsiteName, string thisCompId, TemplateMolecule *t2, string bSiteName2) |
void | addMapGenerator (MapGenerator *mg) |
bool | contains (TemplateMolecule *tempMol) |
bool | compare (Molecule *m) |
bool | compare (Molecule *m, ReactantContainer *rc, MappingSet *ms, bool holdMolClearToEnd=false) |
void | clear () |
void | clearTemplateOnly () |
bool | tryToMap (Molecule *toMap, string toMapComponent, Molecule *mappedFrom, string mappedFromComponent) |
bool | isSymMapValid () |
void | printErrorAndExit (string message) |
void | printDetails () |
void | printDetails (ostream &o) |
string | getPatternString () |
void | printPattern () |
void | printPattern (ostream &o) |
Static Public Member Functions | |
static void | bind (TemplateMolecule *t1, string bSiteName1, string compId1, TemplateMolecule *t2, string bSiteName2, string compId2) |
static void | traverse (TemplateMolecule *tempMol, vector< TemplateMolecule * > &tmList, bool skipConnectedTo) |
static int | getNumDisjointSets (vector< TemplateMolecule * > &tMolecules, vector< vector< TemplateMolecule * > > &sets, vector< int > &uniqueSetId) |
static bool | checkSymmetry (TemplateMolecule *tm1, TemplateMolecule *tm2, string bSite1, string bSite2) |
static bool | checkSymmetryAroundBond (TemplateMolecule *tm1, TemplateMolecule *tm2, string bSite1, string bSite2) |
Static Public Attributes | |
static const int | EMPTY = 0 |
static const int | OCCUPIED = 1 |
static const int | NO_CONSTRAINT = -1 |
static const bool | FIND_ALL = false |
static const bool | SKIP_CONNECTED_TO = true |
Protected Attributes | |
MoleculeType * | moleculeType |
int | uniqueTemplateID |
int | n_mapGenerators |
MapGenerator ** | mapGenerators |
int | n_emptyComps |
int * | emptyComps |
int | n_occupiedComps |
int * | occupiedComps |
int | n_compStateConstraint |
int * | compStateConstraint_Comp |
int * | compStateConstraint_Constraint |
int | n_compStateExclusion |
int * | compStateExclusion_Comp |
int * | compStateExclusion_Exclusion |
int | n_bonds |
int * | bondComp |
string * | bondCompName |
TemplateMolecule ** | bondPartner |
string * | bondPartnerCompName |
int * | bondPartnerCompIndex |
bool * | hasVisitedBond |
int | n_connectedTo |
TemplateMolecule ** | connectedTo |
bool * | hasTraversedDownConnectedTo |
int * | otherTemplateConnectedToIndex |
bool * | connectedToHasRxnCenter |
int | n_symComps |
string * | symCompName |
string * | symCompUniqueId |
int * | symCompStateConstraint |
int * | symCompBoundState |
TemplateMolecule ** | symBondPartner |
string * | symBondPartnerCompName |
int * | symBondPartnerCompIndex |
vector< vector< int > > | canBeMappedTo |
bool * | hasTraversedDownSym |
int | n_totalComps |
bool * | isSymCompMapped |
bool * | compIsAlwaysMapped |
Molecule * | matchMolecule |
bool | hasVisitedThis |
Static Protected Attributes | |
static int | TotalTemplateMoleculeCount = 0 |
static queue< TemplateMolecule * > | q |
static queue< int > | d |
static vector < TemplateMolecule * > ::iterator | tmVecIter |
static list< TemplateMolecule * > ::iterator | tmIter |
TemplateMolecule::TemplateMolecule | ( | MoleculeType * | moleculeType | ) |
Only constructor for TemplateMolecules
TemplateMolecule::~TemplateMolecule | ( | ) |
MoleculeType* NFcore::TemplateMolecule::getMoleculeType | ( | ) | const [inline] |
string TemplateMolecule::getMoleculeTypeName | ( | ) | const |
int NFcore::TemplateMolecule::getN_symComps | ( | ) | const [inline] |
int NFcore::TemplateMolecule::getN_symCompBonds | ( | ) | const [inline] |
int NFcore::TemplateMolecule::getN_mapGenerators | ( | ) | const [inline] |
int NFcore::TemplateMolecule::getN_connectedTo | ( | ) | const [inline] |
void TemplateMolecule::addEmptyComponent | ( | string | cName | ) |
void TemplateMolecule::addBoundComponent | ( | string | cName | ) |
void TemplateMolecule::addComponentConstraint | ( | string | cName, | |
string | stateName | |||
) |
void TemplateMolecule::addComponentConstraint | ( | string | cName, | |
int | stateValue | |||
) |
void TemplateMolecule::addComponentExclusion | ( | string | cName, | |
string | stateName | |||
) |
void TemplateMolecule::addComponentExclusion | ( | string | cName, | |
int | stateValue | |||
) |
void TemplateMolecule::addBond | ( | string | thisBsiteName, | |
TemplateMolecule * | t2, | |||
string | bSiteName2 | |||
) |
void TemplateMolecule::addConnectedTo | ( | TemplateMolecule * | t2, | |
int | otherConToIndex | |||
) |
void TemplateMolecule::addConnectedTo | ( | TemplateMolecule * | t2, | |
int | otherConToIndex, | |||
bool | otherHasRxnCenter | |||
) |
void TemplateMolecule::clearConnectedTo | ( | ) |
void TemplateMolecule::addSymCompConstraint | ( | string | cName, | |
string | uniqueId, | |||
int | bondState, | |||
int | stateConstraint | |||
) |
void TemplateMolecule::addSymBond | ( | string | thisBsiteName, | |
string | thisCompId, | |||
TemplateMolecule * | t2, | |||
string | bSiteName2 | |||
) |
void TemplateMolecule::bind | ( | TemplateMolecule * | t1, | |
string | bSiteName1, | |||
string | compId1, | |||
TemplateMolecule * | t2, | |||
string | bSiteName2, | |||
string | compId2 | |||
) | [static] |
void TemplateMolecule::addMapGenerator | ( | MapGenerator * | mg | ) |
bool TemplateMolecule::contains | ( | TemplateMolecule * | tempMol | ) |
void TemplateMolecule::traverse | ( | TemplateMolecule * | tempMol, | |
vector< TemplateMolecule * > & | tmList, | |||
bool | skipConnectedTo | |||
) | [static] |
int TemplateMolecule::getNumDisjointSets | ( | vector< TemplateMolecule * > & | tMolecules, | |
vector< vector< TemplateMolecule * > > & | sets, | |||
vector< int > & | uniqueSetId | |||
) | [static] |
bool TemplateMolecule::compare | ( | Molecule * | m | ) |
bool TemplateMolecule::compare | ( | Molecule * | m, | |
ReactantContainer * | rc, | |||
MappingSet * | ms, | |||
bool | holdMolClearToEnd = false | |||
) |
End handle connected-to
void TemplateMolecule::clear | ( | ) |
void TemplateMolecule::clearTemplateOnly | ( | ) |
bool TemplateMolecule::tryToMap | ( | Molecule * | toMap, | |
string | toMapComponent, | |||
Molecule * | mappedFrom, | |||
string | mappedFromComponent | |||
) |
bool TemplateMolecule::isSymMapValid | ( | ) |
bool TemplateMolecule::checkSymmetry | ( | TemplateMolecule * | tm1, | |
TemplateMolecule * | tm2, | |||
string | bSite1, | |||
string | bSite2 | |||
) | [static] |
bool TemplateMolecule::checkSymmetryAroundBond | ( | TemplateMolecule * | tm1, | |
TemplateMolecule * | tm2, | |||
string | bSite1, | |||
string | bSite2 | |||
) | [static] |
void TemplateMolecule::printErrorAndExit | ( | string | message | ) |
void TemplateMolecule::printDetails | ( | ) |
void TemplateMolecule::printDetails | ( | ostream & | o | ) |
string TemplateMolecule::getPatternString | ( | ) |
void TemplateMolecule::printPattern | ( | ) |
void TemplateMolecule::printPattern | ( | ostream & | o | ) |
const int NFcore::TemplateMolecule::EMPTY = 0 [static] |
const int NFcore::TemplateMolecule::OCCUPIED = 1 [static] |
const int NFcore::TemplateMolecule::NO_CONSTRAINT = -1 [static] |
const bool NFcore::TemplateMolecule::FIND_ALL = false [static] |
const bool NFcore::TemplateMolecule::SKIP_CONNECTED_TO = true [static] |
int TemplateMolecule::TotalTemplateMoleculeCount = 0 [static, protected] |
MoleculeType* NFcore::TemplateMolecule::moleculeType [protected] |
int NFcore::TemplateMolecule::uniqueTemplateID [protected] |
int NFcore::TemplateMolecule::n_mapGenerators [protected] |
MapGenerator** NFcore::TemplateMolecule::mapGenerators [protected] |
int NFcore::TemplateMolecule::n_emptyComps [protected] |
int* NFcore::TemplateMolecule::emptyComps [protected] |
int NFcore::TemplateMolecule::n_occupiedComps [protected] |
int* NFcore::TemplateMolecule::occupiedComps [protected] |
int NFcore::TemplateMolecule::n_compStateConstraint [protected] |
int* NFcore::TemplateMolecule::compStateConstraint_Comp [protected] |
int* NFcore::TemplateMolecule::compStateConstraint_Constraint [protected] |
int NFcore::TemplateMolecule::n_compStateExclusion [protected] |
int* NFcore::TemplateMolecule::compStateExclusion_Comp [protected] |
int* NFcore::TemplateMolecule::compStateExclusion_Exclusion [protected] |
int NFcore::TemplateMolecule::n_bonds [protected] |
int* NFcore::TemplateMolecule::bondComp [protected] |
string* NFcore::TemplateMolecule::bondCompName [protected] |
TemplateMolecule** NFcore::TemplateMolecule::bondPartner [protected] |
string* NFcore::TemplateMolecule::bondPartnerCompName [protected] |
int* NFcore::TemplateMolecule::bondPartnerCompIndex [protected] |
bool* NFcore::TemplateMolecule::hasVisitedBond [protected] |
int NFcore::TemplateMolecule::n_connectedTo [protected] |
TemplateMolecule** NFcore::TemplateMolecule::connectedTo [protected] |
bool* NFcore::TemplateMolecule::hasTraversedDownConnectedTo [protected] |
int* NFcore::TemplateMolecule::otherTemplateConnectedToIndex [protected] |
bool* NFcore::TemplateMolecule::connectedToHasRxnCenter [protected] |
int NFcore::TemplateMolecule::n_symComps [protected] |
string* NFcore::TemplateMolecule::symCompName [protected] |
string* NFcore::TemplateMolecule::symCompUniqueId [protected] |
int* NFcore::TemplateMolecule::symCompStateConstraint [protected] |
int* NFcore::TemplateMolecule::symCompBoundState [protected] |
TemplateMolecule** NFcore::TemplateMolecule::symBondPartner [protected] |
string* NFcore::TemplateMolecule::symBondPartnerCompName [protected] |
int* NFcore::TemplateMolecule::symBondPartnerCompIndex [protected] |
vector< vector <int> > NFcore::TemplateMolecule::canBeMappedTo [protected] |
bool* NFcore::TemplateMolecule::hasTraversedDownSym [protected] |
int NFcore::TemplateMolecule::n_totalComps [protected] |
bool* NFcore::TemplateMolecule::isSymCompMapped [protected] |
bool* NFcore::TemplateMolecule::compIsAlwaysMapped [protected] |
Molecule* NFcore::TemplateMolecule::matchMolecule [protected] |
bool NFcore::TemplateMolecule::hasVisitedThis [protected] |
queue< TemplateMolecule * > TemplateMolecule::q [static, protected] |
queue< int > TemplateMolecule::d [static, protected] |
vector< TemplateMolecule * >::iterator TemplateMolecule::tmVecIter [static, protected] |
list< TemplateMolecule * >::iterator TemplateMolecule::tmIter [static, protected] |