Functions | |
| unsigned int | getMolFrags (const ROMol &mol, INT_VECT &mapping) |
| find fragments (disconnected components of the molecular graph) | |
| unsigned int | getMolFrags (const ROMol &mol, VECT_INT_VECT &frags) |
| find fragments (disconnected components of the molecular graph) | |
| ROMol * | addHs (const ROMol &mol, bool explicitOnly=false, bool addCoords=false) |
| returns a copy of a molecule with hydrogens added in as explicit Atoms | |
| ROMol * | removeHs (const ROMol &mol, bool implicitOnly=false, bool updateExplicitCount=false, bool sanitize=true) |
| returns a copy of a molecule with hydrogens removed | |
| ROMol * | mergeQueryHs (const ROMol &mol) |
| int | countAtomElec (const Atom *at) |
| return the number of electrons available on an atom to donate for aromaticity | |
| int | setAromaticity (RWMol &mol) |
| Sets up the aromaticity for a molecule. | |
| void | cleanUp (RWMol &mol) |
| Designed to be called by the sanitizer to handle special cases before anything is done. | |
| void | adjustHs (RWMol &mol) |
| adjust the number of implicit and explicit Hs for special cases | |
| int | findSSSR (const ROMol &mol, VECT_INT_VECT &res) |
| finds a molecule's Smallest Set of Smallest Rings | |
| int | findSSSR (const ROMol &mol, VECT_INT_VECT *res=0) |
| int | symmetrizeSSSR (ROMol &mol, VECT_INT_VECT &res) |
| symmetrize the molecule's Smallest Set of Smallest Rings | |
| void | Kekulize (RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100) |
| Kekulizes the molecule. | |
| void | setConjugation (ROMol &mol) |
| flags the molecule's conjugated bonds | |
| bool | atomHasConjugatedBond (const Atom *at) |
| returns whether or not the given Atom is involved in a conjugated bond | |
| void | setHybridization (ROMol &mol) |
| calculates and sets the hybridization of all a molecule's Stoms | |
| void | sanitizeMol (RWMol &mol) |
| carries out a collection of tasks for cleaning up a molecule and ensuring that it makes "chemical sense" | |
| double * | getAdjacencyMatrix (const ROMol &mol, bool useBO=false, int emptyVal=0, bool force=false, const char *propNamePrefix=0) |
| returns a molecule's adjacency matrix | |
| double * | getDistanceMat (const ROMol &mol, bool useBO=false, bool useAtomWts=false, bool force=false, const char *propNamePrefix=0) |
| Computes the molecule's topological distance matrix. | |
| double * | getDistanceMat (const ROMol &mol, const std::vector< int > &activeAtoms, const std::vector< const Bond * > &bonds, bool useBO=false, bool useAtomWts=false) |
| Computes the molecule's topological distance matrix. | |
| INT_LIST | getShortestPath (const ROMol &mol, int aid1, int aid2) |
| Find the shortest path between two atoms. | |
| DiscrimTuple | computeDiscriminators (const ROMol &mol, bool useBO=true, bool force=false) |
| calculates a set of molecular discriminators from the distance matrix | |
| DiscrimTuple | computeDiscriminators (double *distMat, int nb, int na) |
| Same as MolOps::computeDiscriminators(const ROMol &mol), except that this directly uses the user-supplied distance matrix. | |
| double | computeBalabanJ (const ROMol &mol, bool useBO=true, bool force=false, const std::vector< int > *bondPath=0, bool cacheIt=true) |
| calculates Balaban's J index for the molecule | |
| void | findSpanningTree (const ROMol &mol, INT_VECT &mst) |
| finds a molecule's minimium spanning tree (MST) | |
| void | rankAtoms (const ROMol &mol, INT_VECT &ranks, AtomInvariantType invariantType=ComprehensiveInvariants, bool breakTies=true, VECT_INT_VECT *rankHistory=0, bool includeChirality=false) |
| assign a canonical ordering to a molecule's atoms | |
| void | buildAtomInvariants (const ROMol &mol, INVAR_VECT &res, bool includeChirality=false) |
| calculates a set of atom invariants | |
| void | buildChiralAtomInvariants (const ROMol &mol, INVAR_VECT &res) |
| calculates a set of chiral atom invariants | |
| void | assignAtomChiralCodes (ROMol &mol, bool cleanIt=false, bool force=false) |
| calculate CIP (R/S) codes for a molecule's chiral centers | |
| void | assignBondStereoCodes (ROMol &mol, bool cleanIt=false, bool force=false) |
| calculate CIP (Z/E) codes for a molecule's double bonds | |
| void | findPotentialStereoBonds (ROMol &mol, bool cleanIt=false) |
| finds bonds that could be cis/trans in a molecule and mark them as Bond::STEREONONE | |
| int | getFormalCharge (const ROMol &mol) |
| sums up all atomic formal charges and returns the result | |
| void | cleanupChirality (RWMol &mol) |
| removes bogus chirality markers (those on non-sp3 centers): | |
| ROMol* RDKit::MolOps::addHs | ( | const ROMol & | mol, | |
| bool | explicitOnly = false, |
|||
| bool | addCoords = false | |||
| ) |
returns a copy of a molecule with hydrogens added in as explicit Atoms
| mol | the molecule to add Hs to | |
| explicitOnly | (optional) if this true, only explicit Hs will be added | |
| addCoords | (optional) If this is true, estimates for the atomic coordinates of the added Hs will be used. |
addCoords option if the molecule's heavy atoms don't already have coordinates.deleteing the pointer this returns. | void RDKit::MolOps::adjustHs | ( | RWMol & | mol | ) |
adjust the number of implicit and explicit Hs for special cases
Currently this:
"c1cc[nH]cc1"
| mol | the molecule of interest |
| void RDKit::MolOps::assignAtomChiralCodes | ( | ROMol & | mol, | |
| bool | cleanIt = false, |
|||
| bool | force = false | |||
| ) |
calculate CIP (R/S) codes for a molecule's chiral centers
| mol | the molecule of interest | |
| cleanIt | toggles removal of chiral flags from atoms that do not have four unique neighbors | |
| force | forces the calculation to be repeated even if it has already been done |
| void RDKit::MolOps::assignBondStereoCodes | ( | ROMol & | mol, | |
| bool | cleanIt = false, |
|||
| bool | force = false | |||
| ) |
calculate CIP (Z/E) codes for a molecule's double bonds
| mol | the molecule of interest | |
| cleanIt | toggles removal of stereo flags from double bonds that can not have stereochemistry | |
| force | forces the calculation to be repeated even if it has already been done |
| bool RDKit::MolOps::atomHasConjugatedBond | ( | const Atom * | at | ) |
returns whether or not the given Atom is involved in a conjugated bond
| void RDKit::MolOps::buildAtomInvariants | ( | const ROMol & | mol, | |
| INVAR_VECT & | res, | |||
| bool | includeChirality = false | |||
| ) |
calculates a set of atom invariants
These invariants include terms for:
| mol | the molecule of interest | |
| res | used to return the results | |
| includeChirality | toggles inclusion of chirality, see MolOps::rankAtoms() for an explanation. |
| void RDKit::MolOps::buildChiralAtomInvariants | ( | const ROMol & | mol, | |
| INVAR_VECT & | res | |||
| ) |
calculates a set of chiral atom invariants
These are based upon Labute's proposal in the article: "An Efficient Algorithm for the Determination of Topological RS Chirality" Journal of the CCG (1996) and include terms for:
| mol | the molecule of interest | |
| res | used to return the results |
| void RDKit::MolOps::cleanUp | ( | RWMol & | mol | ) |
Designed to be called by the sanitizer to handle special cases before anything is done.
Currently this:
"[N+](=O)[O-]"
| mol | the molecule of interest |
| void RDKit::MolOps::cleanupChirality | ( | RWMol & | mol | ) |
removes bogus chirality markers (those on non-sp3 centers):
| double RDKit::MolOps::computeBalabanJ | ( | const ROMol & | mol, | |
| bool | useBO = true, |
|||
| bool | force = false, |
|||
| const std::vector< int > * | bondPath = 0, |
|||
| bool | cacheIt = true | |||
| ) |
calculates Balaban's J index for the molecule
| mol | the molecule of interest | |
| useBO | toggles inclusion of the bond order in the calculation (when false, we're not really calculating the J value) | |
| force | forces the calculation (instead of using cached results) | |
| bondPath | when included, only paths using bonds whose indices occur in this vector will be included in the calculation | |
| cacheIt | If this is true, the calculated value will be cached as a property on the molecule |
| DiscrimTuple RDKit::MolOps::computeDiscriminators | ( | double * | distMat, | |
| int | nb, | |||
| int | na | |||
| ) |
Same as MolOps::computeDiscriminators(const ROMol &mol), except that this directly uses the user-supplied distance matrix.
| DiscrimTuple RDKit::MolOps::computeDiscriminators | ( | const ROMol & | mol, | |
| bool | useBO = true, |
|||
| bool | force = false | |||
| ) |
calculates a set of molecular discriminators from the distance matrix
Computes:
| mol | the molecule of interest | |
| useBO | toggles inclusion of the bond order in the discriminators (when false, the discriminators are purely topological) | |
| force | forces the calculation (instead of using cached results) |
DiscrimTuple with the results | int RDKit::MolOps::countAtomElec | ( | const Atom * | at | ) |
return the number of electrons available on an atom to donate for aromaticity
The result is determined using the default valency, number of lone pairs, number of bonds and the formal charge. Note that the atom may not donate all of these electrons to a ring for aromaticity (also used in Conjugation and hybridization code).
| at | the atom of interest |
| void RDKit::MolOps::findPotentialStereoBonds | ( | ROMol & | mol, | |
| bool | cleanIt = false | |||
| ) |
finds bonds that could be cis/trans in a molecule and mark them as Bond::STEREONONE
| mol | the molecule of interest | |
| cleanIt | toggles removal of stereo flags from double bonds that can not have stereochemistry |
| void RDKit::MolOps::findSpanningTree | ( | const ROMol & | mol, | |
| INT_VECT & | mst | |||
| ) |
finds a molecule's minimium spanning tree (MST)
| mol | the molecule of interest | |
| mst | used to return the MST as a vector of bond indices |
| int RDKit::MolOps::findSSSR | ( | const ROMol & | mol, | |
| VECT_INT_VECT * | res = 0 | |||
| ) |
| int RDKit::MolOps::findSSSR | ( | const ROMol & | mol, | |
| VECT_INT_VECT & | res | |||
| ) |
finds a molecule's Smallest Set of Smallest Rings
Currently this implements a modified form of Figueras algorithm (JCICS - Vol. 36, No. 5, 1996, 986-991)
| mol | the molecule of interest | |
| res | used to return the vector of rings. Each entry is a vector with atom indices. This information is also stored in the molecule's RingInfo structure, so this argument is optional (see overload) |
Our Modifications:
These changes were motivated by several factors:
| double* RDKit::MolOps::getAdjacencyMatrix | ( | const ROMol & | mol, | |
| bool | useBO = false, |
|||
| int | emptyVal = 0, |
|||
| bool | force = false, |
|||
| const char * | propNamePrefix = 0 | |||
| ) |
returns a molecule's adjacency matrix
| mol | the molecule of interest | |
| useBO | toggles use of bond orders in the matrix | |
| emptyVal | sets the empty value (for non-adjacent atoms) | |
| force | forces calculation of the matrix, even if already computed | |
| propNamePrefix | used to set the cached property name |
delete this pointer. | double* RDKit::MolOps::getDistanceMat | ( | const ROMol & | mol, | |
| const std::vector< int > & | activeAtoms, | |||
| const std::vector< const Bond * > & | bonds, | |||
| bool | useBO = false, |
|||
| bool | useAtomWts = false | |||
| ) |
Computes the molecule's topological distance matrix.
Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
| mol | the molecule of interest | |
| activeAtoms | only elements corresponding to these atom indices will be included in the calculation | |
| bonds | only bonds found in this list will be included in the calculation | |
| useBO | toggles use of bond orders in the matrix | |
| useAtomWts | sets the diagonal elements of the result to 6.0/(atomic number) so that the matrix can be used to calculate Balaban J values. This does not affect the bond weights. |
delete this pointer. | double* RDKit::MolOps::getDistanceMat | ( | const ROMol & | mol, | |
| bool | useBO = false, |
|||
| bool | useAtomWts = false, |
|||
| bool | force = false, |
|||
| const char * | propNamePrefix = 0 | |||
| ) |
Computes the molecule's topological distance matrix.
Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
| mol | the molecule of interest | |
| useBO | toggles use of bond orders in the matrix | |
| useAtomWts | sets the diagonal elements of the result to 6.0/(atomic number) so that the matrix can be used to calculate Balaban J values. This does not affect the bond weights. | |
| force | forces calculation of the matrix, even if already computed | |
| propNamePrefix | used to set the cached property name |
delete this pointer. | int RDKit::MolOps::getFormalCharge | ( | const ROMol & | mol | ) |
sums up all atomic formal charges and returns the result
| unsigned int RDKit::MolOps::getMolFrags | ( | const ROMol & | mol, | |
| VECT_INT_VECT & | frags | |||
| ) |
find fragments (disconnected components of the molecular graph)
| mol | the molecule of interest | |
| frags | used to return the Atoms in each fragment On return mapping will be numFrags long, and each entry will contain the indices of the Atoms in that fragment. |
| unsigned int RDKit::MolOps::getMolFrags | ( | const ROMol & | mol, | |
| INT_VECT & | mapping | |||
| ) |
find fragments (disconnected components of the molecular graph)
| mol | the molecule of interest | |
| mapping | used to return the mapping of Atoms->fragments. On return mapping will be mol->getNumAtoms() long and will contain the fragment assignment for each Atom |
| INT_LIST RDKit::MolOps::getShortestPath | ( | const ROMol & | mol, | |
| int | aid1, | |||
| int | aid2 | |||
| ) |
Find the shortest path between two atoms.
Uses the Bellman-Ford algorithm
| mol | molecule of interest | |
| aid1 | index of the first atom | |
| aid2 | index of the second atom |
| void RDKit::MolOps::Kekulize | ( | RWMol & | mol, | |
| bool | markAtomsBonds = true, |
|||
| unsigned int | maxBackTracks = 100 | |||
| ) |
Kekulizes the molecule.
| mol | the molecule of interest | |
| markAtomsBonds | if this is set to true, isAromatic boolean settings on both the Bonds and Atoms are turned to false following the Kekulization, otherwise they are left alone in their original state. | |
| maxBackTracks | the maximum number of attempts at back-tracking. The algorithm uses a back-tracking procedure to revist a previous setting of double bond if we hit a wall in the kekulization process |
markAtomsBonds is false the BondType for all aromatic bonds will be changed from RDKit::Bond::AROMATIC to RDKit::Bond::SINGLE or RDKit::Bond::DOUBLE during Kekulization. | ROMol* RDKit::MolOps::mergeQueryHs | ( | const ROMol & | mol | ) |
returns a copy of a molecule with hydrogens removed and added as queries to the heavy atoms to which they are bound.
This is really intended to be used with molecules that contain QueryAtoms
| mol | the molecule to remove Hs from |
"[H][H]" from having all atoms removed.deleteing the pointer this returns. | void RDKit::MolOps::rankAtoms | ( | const ROMol & | mol, | |
| INT_VECT & | ranks, | |||
| AtomInvariantType | invariantType = ComprehensiveInvariants, |
|||
| bool | breakTies = true, |
|||
| VECT_INT_VECT * | rankHistory = 0, |
|||
| bool | includeChirality = false | |||
| ) |
assign a canonical ordering to a molecule's atoms
The algorithm used here is a modification of the published Daylight canonical smiles algorithm (i.e. it uses atom invariants and products of primes).
| mol | the molecule of interest | |
| ranks | used to return the ranks | |
| invariantType | the type of invariant to be computed | |
| breakTies | toggles breaking of ties (see below) | |
| rankHistory | used to return the rank history (see below) | |
| includeChirality | toggles inclusion of chirality in the atom ranking (see below) |
rankHistory argument is provided, the evolution of the ranks of individual atoms will be tracked. The rankHistory pointer should be to a VECT_INT_VECT that has at least mol.getNumAtoms() elements.includeChirality argument only makes sense when generating full invariants (i.e. ComprehensiveInvariant) | ROMol* RDKit::MolOps::removeHs | ( | const ROMol & | mol, | |
| bool | implicitOnly = false, |
|||
| bool | updateExplicitCount = false, |
|||
| bool | sanitize = true | |||
| ) |
returns a copy of a molecule with hydrogens removed
| mol | the molecule to remove Hs from | |
| implicitOnly | (optional) if this true, only implicit Hs will be removed | |
| updateExplicitCount | (optional) If this is true, when explicit Hs are removed from the graph, the heavy atom to which they are bound will have its counter of explicit Hs increased. | |
| sanitize,: | (optional) If this is true, the final molecule will be sanitized |
"[H][H]" from having all atoms removed.
deleteing the pointer this returns. | void RDKit::MolOps::sanitizeMol | ( | RWMol & | mol | ) |
carries out a collection of tasks for cleaning up a molecule and ensuring that it makes "chemical sense"
This functions calls the following in sequence
| mol | the RWMol to be cleaned |
SanitException will be thrown.| int RDKit::MolOps::setAromaticity | ( | RWMol & | mol | ) |
Sets up the aromaticity for a molecule.
This is what happens here:
| mol | the RWMol of interest |
MolOps::Kekulize() has already been called) | void RDKit::MolOps::setConjugation | ( | ROMol & | mol | ) |
flags the molecule's conjugated bonds
| void RDKit::MolOps::setHybridization | ( | ROMol & | mol | ) |
calculates and sets the hybridization of all a molecule's Stoms
| int RDKit::MolOps::symmetrizeSSSR | ( | ROMol & | mol, | |
| VECT_INT_VECT & | res | |||
| ) |
symmetrize the molecule's Smallest Set of Smallest Rings
SSSR rings obatined from "findSSSR" can be non-unique in some case. For example, cubane has five SSSR rings, not six as one would hope.
This function adds additional rings to the SSSR list if necessary to make the list symmetric, e.g. all atoms in cubane will be part of the same number of SSSRs. This function choses these extra rings from the extra rings computed and discarded during findSSSR. The new ring are chosen such that:
| mol | - the molecule of interest | |
| res | used to return the vector of rings. Each entry is a vector with atom indices. This information is also stored in the molecule's RingInfo structure, so this argument is optional (see overload) |
1.5.3