MTK++ Latest version: 0.2.0

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MTKpp::rings Class Reference

Determines rings in a molecule. More...

#include <mtkpp/src/Molecule/ring.h>

Collaboration diagram for MTKpp::rings:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 rings (molecule *parent=0)
 rings Constructor
virtual ~rings ()
 rings Destructor.
void determine ()
 Determine all rings in the molecule.
void kekulize (ring *r)
 Determine if ring is aromatic.
int getPlaneNormal (ring *r)
 Determine the plane and normal of the ring.
void calcCentroid (ring *r)
 Determine the centroid of the ring.

Protected Types

typedef std::map< int, Bond * >
::iterator 
BondMapIterator
 Bond map iterator.

Protected Member Functions

void removeHydrogenAtoms ()
 Removes hydrogen atoms from the cyclicAtom vector.
void removeHydrogenBonds ()
 Removes hydrogen containing bonds from the cyclicbonds vector.
void removeOpenAcyclic ()
 Removes all OPEN ACYCLIC NODES (hydrogen and terminal atoms)
void removeOpenAcyclicBonds ()
 Removes all OPEN ACYCLIC bonds.
void findNeighbors ()
 Find all neighbouring atoms.
void findNeighbors (std::vector< atom * > a, std::vector< std::vector< int > > &b)
 Find all neighbouring atoms.
void getBonds (std::vector< atom * > a, std::vector< Bond * > b, std::vector< Bond * > &c, std::vector< int > &d)
 Find all bonds between atoms in a from all possible in b.
void removeClosedAcyclic ()
 Removes all CLOSED ACYCLIC NODES (atom joining ring systems)
int pickRootAtom (std::vector< atom * > a)
 Pick Root Atom.
void separateBlocks ()
 Separate cyclic atoms into blocks.
void findSSSR ()
 Find the smallest set of smallest rings (SSSR)
void decomposeBlock (std::vector< atom * > block)
void getIrreducibleClosedPath (std::vector< atom * > block, int root, std::vector< atom * > &path)
int numberRingsInBlock (std::vector< atom * > block)
void getNewPath (std::vector< atom * > &path, std::vector< atom * > curPath, bool &done)
void eliminateReducibleAtoms (std::vector< atom * > block, std::vector< atom * > path)
void checkPath (std::vector< atom * > &path, bool &ok)
void dfs_visit (int curAtom, int rootAtom, std::vector< atom * > &vertexes, std::vector< Bond * > edges, std::vector< std::vector< int > > &neighbours, std::vector< int > &vertexesColor, std::vector< int > &edgesColor, bool &loop, int &t, std::vector< atom * > &curPath, std::vector< std::vector< atom * > > &paths)
 Depth-First-Search of the molecular graph.
void dfs_visitNEW (int curAtom, int rootAtom, bool first, bool &loop, std::vector< atom * > &vertexes, std::vector< Bond * > edges, std::vector< std::vector< int > > &neighbors, std::vector< int > &vertexesColor, std::vector< int > &edgesColor, std::vector< atom * > &path)

Protected Attributes

moleculepParent
 molecule pointer
std::vector< atom * > molAtomList
 molecule atom list
std::map< int, Bond * > molBondMap
 molecule Bond map
std::vector< atom * > hydrogens
 Hydrogen atoms.
std::vector< atom * > acyclicAtoms
 Open and closed acyclic atoms.
std::vector< atom * > cyclicAtoms
 cyclic atoms
std::vector< Bond * > cyclicBonds
 Cyclic Bonds.
std::vector< std::vector< int > > neighbors
 Neighboring atoms.
std::vector< std::vector< atom * > > blocks
 vector of blocks
std::vector< atom * >::iterator atomIterator
 atom iterator
std::vector< Bond * >::iterator bondIterator
atompAtom
 atom pointer
atompAtom2
 atom pointer
BondpBond
 Bond pointer.
std::vector< atom * > finalPath

Detailed Description

Determines rings in a molecule.

Author:
Martin Peters
Date:
2006

See the Ring Perception page for more details.


Member Typedef Documentation

typedef std::map<int, Bond*>::iterator MTKpp::rings::BondMapIterator [protected]

Bond map iterator.


Constructor & Destructor Documentation

MTKpp::rings::rings ( molecule parent = 0)

rings Constructor

Parameters:
parentmolecule pointer
MTKpp::rings::~rings ( ) [virtual]

rings Destructor.


Member Function Documentation

void MTKpp::rings::determine ( )
void MTKpp::rings::kekulize ( ring r)
int MTKpp::rings::getPlaneNormal ( ring r)
void MTKpp::rings::calcCentroid ( ring r)

Determine the centroid of the ring.

Parameters:
rring pointer

References MTKpp::ring::atoms, MTKpp::ring::centroid, and MTKpp::atom::getCoords().

Referenced by MTKpp::molecule::generateFeatureDistMatrix(), and getPlaneNormal().

void MTKpp::rings::removeHydrogenAtoms ( ) [protected]

Removes hydrogen atoms from the cyclicAtom vector.

References cyclicAtoms, MTKpp::atom::getAtomicNum(), hydrogens, molAtomList, pAtom, and MTKpp::atom::setType().

Referenced by determine().

void MTKpp::rings::removeHydrogenBonds ( ) [protected]

Removes hydrogen containing bonds from the cyclicbonds vector.

References MTKpp::Bond::atom1, MTKpp::Bond::atom2, cyclicBonds, MTKpp::atom::getAtomicNum(), molBondMap, pBond, and MTKpp::Bond::topology.

Referenced by determine().

void MTKpp::rings::removeOpenAcyclic ( ) [protected]

Removes all OPEN ACYCLIC NODES (hydrogen and terminal atoms)

References acyclicAtoms, atomIterator, cyclicAtoms, MTKpp::atom::getAtomicNum(), MTKpp::atom::getBondedAtoms(), hydrogens, pAtom, pAtom2, and MTKpp::atom::setType().

Referenced by determine().

void MTKpp::rings::removeOpenAcyclicBonds ( ) [protected]
void MTKpp::rings::findNeighbors ( ) [protected]

Find all neighbouring atoms.

References cyclicAtoms, MTKpp::molecule::getBond(), neighbors, pAtom, pAtom2, pBond, and pParent.

Referenced by determine(), and getIrreducibleClosedPath().

void MTKpp::rings::findNeighbors ( std::vector< atom * >  a,
std::vector< std::vector< int > > &  b 
) [protected]

Find all neighbouring atoms.

Parameters:
avector of atoms
bvector of vector of ints

References MTKpp::molecule::getBond(), pAtom, pAtom2, pBond, and pParent.

void MTKpp::rings::getBonds ( std::vector< atom * >  a,
std::vector< Bond * >  b,
std::vector< Bond * > &  c,
std::vector< int > &  d 
) [protected]

Find all bonds between atoms in a from all possible in b.

Parameters:
avector of atoms
bvector of bonds
cvector of bonds
dvector of int

References MTKpp::Bond::atom1, MTKpp::Bond::atom2, and bondIterator.

Referenced by determine(), getIrreducibleClosedPath(), and numberRingsInBlock().

void MTKpp::rings::removeClosedAcyclic ( ) [protected]

Removes all CLOSED ACYCLIC NODES (atom joining ring systems)

References acyclicAtoms, cyclicAtoms, cyclicBonds, dfs_visit(), neighbors, pAtom, and removeOpenAcyclicBonds().

Referenced by determine().

int MTKpp::rings::pickRootAtom ( std::vector< atom * >  a) [protected]

Pick Root Atom.

Parameters:
avector of atoms
Returns:
index of atom with greatest connectivity

References MTKpp::molecule::getBond(), pAtom, pAtom2, pBond, and pParent.

void MTKpp::rings::separateBlocks ( ) [protected]

Separate cyclic atoms into blocks.

References atomIterator, blocks, bondIterator, cyclicAtoms, cyclicBonds, dfs_visit(), MTKpp::molecule::getBond(), neighbors, pBond, and pParent.

Referenced by determine().

void MTKpp::rings::findSSSR ( ) [protected]

Find the smallest set of smallest rings (SSSR)

References blocks, and decomposeBlock().

Referenced by determine().

void MTKpp::rings::decomposeBlock ( std::vector< atom * >  block) [protected]
void MTKpp::rings::getIrreducibleClosedPath ( std::vector< atom * >  block,
int  root,
std::vector< atom * > &  path 
) [protected]
int MTKpp::rings::numberRingsInBlock ( std::vector< atom * >  block) [protected]

References cyclicBonds, and getBonds().

Referenced by decomposeBlock().

void MTKpp::rings::getNewPath ( std::vector< atom * > &  path,
std::vector< atom * >  curPath,
bool &  done 
) [protected]
void MTKpp::rings::eliminateReducibleAtoms ( std::vector< atom * >  block,
std::vector< atom * >  path 
) [protected]
void MTKpp::rings::checkPath ( std::vector< atom * > &  path,
bool &  ok 
) [protected]
void MTKpp::rings::dfs_visit ( int  curAtom,
int  rootAtom,
std::vector< atom * > &  vertexes,
std::vector< Bond * >  edges,
std::vector< std::vector< int > > &  neighbours,
std::vector< int > &  vertexesColor,
std::vector< int > &  edgesColor,
bool &  loop,
int &  t,
std::vector< atom * > &  curPath,
std::vector< std::vector< atom * > > &  paths 
) [protected]

Depth-First-Search of the molecular graph.

Parameters:
curAtomsearch NODE
rootAtomROOT NODE
vertexesvector of atom pointers or vertexes
edgesvector of Bond pointers or edges
neighboursNODES linking each other
vertexesColorvertex colors used to traverse the molecular graph
edgesColoredge colors used to traverse the molecular graph
loopdelete
tdelete
curPathstorage of the current closed cycle
pathsstorage for all the paths found

References MTKpp::Bond::atom1, MTKpp::Bond::atom2, MTKpp::molecule::hasBond(), neighbors, pBond, and pParent.

Referenced by removeClosedAcyclic(), and separateBlocks().

void MTKpp::rings::dfs_visitNEW ( int  curAtom,
int  rootAtom,
bool  first,
bool &  loop,
std::vector< atom * > &  vertexes,
std::vector< Bond * >  edges,
std::vector< std::vector< int > > &  neighbors,
std::vector< int > &  vertexesColor,
std::vector< int > &  edgesColor,
std::vector< atom * > &  path 
) [protected]

Member Data Documentation

std::vector<atom*> MTKpp::rings::molAtomList [protected]

molecule atom list

Referenced by determine(), and removeHydrogenAtoms().

std::map<int, Bond*> MTKpp::rings::molBondMap [protected]

molecule Bond map

Referenced by determine(), and removeHydrogenBonds().

std::vector<atom*> MTKpp::rings::hydrogens [protected]

Hydrogen atoms.

Referenced by removeHydrogenAtoms(), and removeOpenAcyclic().

std::vector<atom*> MTKpp::rings::acyclicAtoms [protected]

Open and closed acyclic atoms.

Referenced by removeClosedAcyclic(), removeOpenAcyclic(), and removeOpenAcyclicBonds().

std::vector<atom*> MTKpp::rings::cyclicAtoms [protected]
std::vector<Bond*> MTKpp::rings::cyclicBonds [protected]
std::vector< std::vector<int> > MTKpp::rings::neighbors [protected]
std::vector< std::vector<atom*> > MTKpp::rings::blocks [protected]

vector of blocks

Referenced by determine(), findSSSR(), and separateBlocks().

std::vector<atom*>::iterator MTKpp::rings::atomIterator [protected]

atom iterator

Referenced by dfs_visitNEW(), removeOpenAcyclic(), and separateBlocks().

std::vector<Bond*>::iterator MTKpp::rings::bondIterator [protected]
atom* MTKpp::rings::pAtom [protected]
atom* MTKpp::rings::pAtom2 [protected]
Bond* MTKpp::rings::pBond [protected]
std::vector<atom*> MTKpp::rings::finalPath [protected]

The documentation for this class was generated from the following files:

Generated on Fri Dec 23 2011 09:28:57 for MTK++ by Doxygen 1.7.5.1