#include <atom.h>
Inheritance diagram for Atom:
Public Member Functions | |
Atom construction functions | |
Atom () | |
Atom (const Atom &anAtom) | |
Atom (string aLabel) | |
~Atom () | |
Atom & | operator= (const Atom &anAtom) |
Bond * | addBond (Bond *aBond) throw ( CError ) |
Accessor functions | |
int | getId () const |
string | getIdString () |
int | getIdInMolecule () const |
void | setIdInMolecule (int anId) |
int | getType () const |
string | getName () |
string | getSymbol () |
string | getElementSymbol () |
void | setElementSymbol (string anElement) |
int | getAN () const |
bool | isGeneric () |
bool | isCSkeleton () |
bool | hasCoordinates () |
float | getX () |
float | getY () |
float | getZ () |
void | setCoordinates (float aX, float aY, float aZ) |
int | numBonds () |
int | numHiddenBonds () |
int | getNumAromaticBonds () |
int | degree () |
bool | wasVisited () |
void | setVisited () |
void | unsetVisited () |
int | getMorganIndex (int order) |
int | getUniqueMorganIndex (bool silentError=false) throw ( CError ) |
void | setMorganLabel (string aLabel) |
void | setMorganLabel (int anOrder) |
string | getMorganLabel (bool silentError=false) throw ( CError ) |
void | setPerretLabel () throw ( CError ) |
string | getPerretLabel (bool silentError=false) throw ( CError ) |
void | addRing (Ring *aRing) |
bool | hasRing (Ring *aRing) |
bool | hasRing () |
int | numRings () |
double | getKashimaPT (Atom *anAtom) |
vector< Atom * > * | getBFSVector () |
vector< Bond * > * | getBFSBondVector () |
int | getBFSVectorSize () |
void | resetBFSVector () |
Atom manipulation functions | |
void | eraseCoordinates () |
void | hideBond (map< Atom *, Bond * >::iterator aBondI) |
void | hideBond (Bond *aBond) |
Bond * | hideBond (Atom *aTarget) |
int | hideHydrogenBonds () |
void | hideAllToFromBonds () |
Bond * | hideToFromBonds (Atom *aTarget) |
Bond * | hideToFromFirstBond () |
int | restoreHiddenBonds () |
void | restoreHiddenBond (Bond *aBond) throw ( CError ) |
void | restoreHiddenBond (Atom *aTarget) throw ( CError ) |
void | deleteBonds () |
void | deleteHiddenBonds () |
bool | bondExists (Bond *aBond) |
long | bondSum () |
void | unsetBondFlags () |
void | unsetBondFlagsOriginal () |
void | setUniqueMorganIndex (int anOrder) |
int | getSumOfNeighboorMorganIndex (int anOrder) |
void | resetMorganIndex () |
void | setPartialCharge (double aValue) |
void | setMorganChargeLabel (double threshold) |
Bond * | getBondWithTarget (Atom *otherAtom) throw ( CError ) |
Atom * | nextUnvisitedAtom () throw ( CError ) |
Ring * | getRingBFS (vector< Atom * > *toVisit, vector< Bond * > *toVisitBond) throw ( CError ) |
void | pushBFSVector (vector< Atom * > *aPath, vector< Bond * > *aBondPath) |
Iterators | |
map< Atom *, Bond * > & | getBonds () |
map< Atom *, Bond * >::iterator | beginBond () |
map< Atom *, Bond * >::iterator | endBond () |
vector< Ring * >::iterator | beginRing () |
vector< Ring * >::iterator | endRing () |
map< Atom *, Bond * >::iterator | getBondIteratorWithTarget (Atom *otherAtom) |
Output functions | |
string | toString () |
string | toStringShort () |
void | describe () throw ( CError ) |
void | describeShort () |
string | toStringBFSVector () |
Static Public Member Functions | |
static void | getVectorIntersect (vector< Atom * > *v1, vector< Atom * > *v2, vector< Atom * > *result) |
Protected Member Functions | |
void | setAN (int a) |
void | setType (int aType) |
Static Protected Member Functions | |
static void | resetCounter () |
Protected Attributes | |
map< int, int > | morganIndex |
string | morganLabel |
string | perretLabel |
int | uniqueMorganIndex |
vector< Atom * > | BFSVector |
vector< Bond * > | BFSBondVector |
double | partialCharge |
Private Attributes | |
int | id |
int | idInMolecule |
int | type |
int | an |
float | x |
float | y |
float | z |
bool | flagHasCoordinates |
map< Atom *, Bond * > | bonds |
map< Atom *, Bond * > | hiddenBonds |
vector< Ring * > | rings |
bool | visited |
bool | genericAtomType |
Static Private Attributes | |
static int | counter |
Friends | |
class | Elements |
class | Bond |
class | Molecule |
ostream & | operator<< (ostream &os, const Atom &anAtom) |
FOR: SNSF SPONSORED PROJECT
PURPOSE:
This class implements the notion of atom. Atoms have
These descriptors are implemented using the DataContainer class which takes care of memory allocation for these descriptors. Therefore descriptors can be added and removed at runtime using the DataContainer functions.
Some atom descriptors need fast access and are thus directly implemented in the atom class using native data types (int or float). These is the case for id and should be done for ps and pq.
Atoms should always be created using the copy operator using the atoms stored in the global elements vector as template (#include <elements.h>).
for example instanciating a new hydrogen atom should be done in this way:
Atom* myatom = new Atom( elements["H"] );
|
class constructor. |
|
class constructor. |
|
class constructor. |
|
class destructor. |
|
adds a bond to the bond hash. |
|
adds a ring to the set of rings the atom is member of. |
|
returns an iterator to the first Bond. |
|
returns an iterator to the first ring the atom is member of. |
|
returns true if a bond (of any type) exists with the target atom. |
|
returns the sum of the bond types. |
|
returns the number of Bonds (synonymous to numBonds). |
|
deletes all bonds of that atom (called from the destructor of molecule). |
|
deletes all hidden bonds of that atom (called from the destructor of molecule). |
|
prints a description of the atom to cout (describeShort + descriptors, but not the kind descriptors). Reimplemented from DataContainer.
|
|
prints a short description of the atom to cout (atomic symbol + unique Id). Reimplemented from DataContainer. |
|
returns a pointer to the last Bond. |
|
returns an iterator to the last ring the atom is member of. |
|
erases the atoms coordinates (set flagHasCoordinates to false). |
|
returns the atomic number of the atom (ex: hydrogens should return 1). |
|
returns the BFS Bond vector. |
|
returns the BFS vector. |
|
returns the BFSVector size. |
|
NOT DOCUMENTED |
|
returns a pointer to the bonds map. |
|
returns the label of the bond connecting this atom with otherAtom. returns NOBOND if there are no bonds connecting both atoms. |
|
returns the element symbol. In case of mol files it is the same as getSymbol() but in case of KCF files, getSymbol() returns the Kegg atom type while getElementSymbol() returns the element atom type. |
|
returns the atom unique Id. |
|
returns the atom Id in the molecule. |
|
returns the atom unique Id as a string. |
|
returns the transition probability to anAtom. returns 0 if no atoms exist with anAtom. |
|
returns the Morgan index of order anOrder. Emits an error if it was not calculated before. |
|
returns the value of the Morgan label (set by setMorganLabel()). |
|
returns the value of the name descriptor in case atoms where names (used for reading the Mutag dataset). |
|
returns the number of aromatic Bonds for this atom. |
|
returns the value of the perret label (set by setPerretLabel(), called everytime a molecule is modified). |
|
BFS procedure for smallest ring detection. returns a pointer to the smallest ring containing the atom or NULL if the atom is not member of any ring. note you should check ring membership with hasRing(). |
|
returns the sum of the Morgan indices of order anOrder of all neighboors. |
|
returns the value of the symbol descriptor in case atoms where names (used for reading the Mutag dataset). |
|
returns the element type. |
|
returns the value of the Morgan index for which the diversity of Morgan indices is maximum in the current molecule. set by setUniqueMorganIndex(int). |
|
NO DOCUMENTATION. |
|
returns the x coordinate of the atom. |
|
returns the y coordinate of the atom. |
|
returns the z coordinate of the atom. |
|
returns true if the atom has valid coordinates. |
|
returns true if the atom is member of any ring. |
|
returns true if the atom is member of the given ring. |
|
hides all bonds to and from this Atom. |
|
hides a bond (but not reverse bond). |
|
hides a bond (but not reverse bond). |
|
hides a bond (but not reverse bond). |
|
hides all bonds whose target is an hydrogen. |
|
hides all bonds to and from to aTarget Atom and returns a poiter to the 'to Bond' of aTarget atom. |
|
hides the first bond in bonds (both to and from bonds) and returns a pointer to the 'to Bond'. |
|
returns true if the atom is a non terminal Carbon (a terminal carbon is a carbon atom attached to only one non hydrogen atom). |
|
returns true if the atom is 'generic'. |
|
returns a pointer to the next unvisited Node. returns NULL pointer if all atoms were visited. |
|
returns the number of Bonds. |
|
returns the number of hidden Bonds. |
|
returns the number of rings the atom is member of. |
|
assignment operator. |
|
NO DOCUMENTATION |
|
resets the BFSVector. |
|
resets the atom counter. Only the elements should call this function. |
|
resets the Morgan index map. call this function whenever the molecule is modified! |
|
restores hidden bond to atom aTarget. Throws a CError if no hidden bond to aTarget is found. |
|
restores hidden bond aBond. |
|
restores all hidden bonds (for example, bonds to hydrogens). |
|
this function is used when instanciating the atom for setting the atomic number. |
|
sets the x, y, and z coordinates of the atom. |
|
sets the value of the ElementSymbol descriptor. |
|
sets the Id of this atom in the molecule. |
|
include the sign of the partial charge in the Morgan label of the instance. If partial charge > threshold: sign = + ; otherwise, sign = - |
|
sets the Morgan label (used in the Molecule::morganKernel function) to the concatenation of the atomSymbol and the Morgan index of iteration anOrder. |
|
set the Morgan label of the atom. |
|
set the value of the partial charge of the instance to aValue |
|
sets the Perret label of the atom (if a carbon has more than 2 aromatic bonds it is renamed CJ). |
|
sets the atom type. |
|
sets the unique Morgan index of this atom to the value of anOrder iteration of the Morgan index calculation. |
|
sets the node as visited. |
|
returns a string describing the atom (atomic symbol + unique Id + memory location + number of bonds). |
|
NO DOCUMENTATION |
|
returns a short string describing the atom (atomic symbol + unique Id). Reimplemented from Node. |
|
unsets all bond flags. |
|
unsets all bond flags original. |
|
sets the node as unvisited. |
|
returns true if the node was already visited. |
|
stream operator for Atom. |
|
atomic number. to enhance retrival speed this property is hard coded rather than using the DataContainer mechanism. |
|
this vector is used to store paths in a BFS search (stores bonds). |
|
this vector is used to store paths in a BFS search (stores atoms). |
|
hash of bonds indexed by atom. |
|
counter of the number of atoms which have been instanciated. |
|
flag indicating if the atom has valid coordinates. |
|
indicates if this atom is part of the elements or if it is generic (created with constructor: Atom::Atom(string)). |
|
vector of hidden bonds indexed by atom. |
|
atom unique Id. |
|
atom unique Id in the molecule it belongs. |
|
map containing the morgan indices. |
|
Morgan label of the atom set by the Atom::setMorganLabel() function. |
|
partial charge of the atom. |
|
Perret label of the atom.set by the Atom::setPerretLabel() function. |
|
smallest rings of which this atom is member (set by Molecule::detectSSSR()). |
|
atom type: start from Hydrogen at 0, incremented at the instanciation of elements. used by MoleculeUtils::atomKernelExternalMatrix(). |
|
Morgan index value for the iteration with the biggest diversity for a molecule (set by Molecule::setUniqueMorganIndices()). |
|
flag to indicate if the atom was visited. Used in DFS graph algorithm. |
|
atom x coodinate. |
|
atom y coodinate. |
|
atom z coodinate. |