RDKit::ROMol Class Reference

ROMol is a molecule class that is intended to have a fixed topology. More...

`#include <ROMol.h>`

Inheritance diagram for RDKit::ROMol:

## Public Member Functions

| ROMol ()
| ROMol (const ROMol &other, bool quickCopy=false, int confId=-1)
| copy constructor with a twist More...
| ROMol (const std::string &binStr)
| construct a molecule from a pickle string More...
virtual | ~ROMol ()
ATOM_SPTR | operator[] (const vertex_descriptor &v)
const ATOM_SPTR | operator[] (const vertex_descriptor &v) const
BOND_SPTR | operator[] (const edge_descriptor &e)
const BOND_SPTR | operator[] (const edge_descriptor &e) const
Atoms
unsigned int | getNumAtoms (bool onlyExplicit=1) const
| returns our number of atoms More...
unsigned int | getNumHeavyAtoms () const
| returns our number of heavy atoms (atomic number > 1) More...
Atom * | getAtomWithIdx (unsigned int idx)
| returns a pointer to a particular Atom More...
const Atom * | getAtomWithIdx (unsigned int idx) const
template<class U >
Atom * | getAtomWithIdx (const U idx)
template<class U >
const Atom * | getAtomWithIdx (const U idx) const
unsigned int | getAtomDegree (const Atom *at) const
| returns the degree (number of neighbors) of an Atom in the graph More...
unsigned int | getAtomDegree (ATOM_SPTR at) const
Bonds
unsigned int | getNumBonds (bool onlyHeavy=1) const
| returns our number of Bonds More...
Bond * | getBondWithIdx (unsigned int idx)
| returns a pointer to a particular Bond More...
const Bond * | getBondWithIdx (unsigned int idx) const
template<class U >
Bond * | getBondWithIdx (const U idx)
template<class U >
const Bond * | getBondWithIdx (const U idx) const
Bond * | getBondBetweenAtoms (unsigned int idx1, unsigned int idx2)
| returns a pointer to the bond between two atoms, Null on failure More...
const Bond * | getBondBetweenAtoms (unsigned int idx1, unsigned int idx2) const
template<class U , class V >
Bond * | getBondBetweenAtoms (const U idx1, const V idx2)
template<class U , class V >
const Bond * | getBondBetweenAtoms (const U idx1, const V idx2) const
Bookmarks
void | setAtomBookmark (ATOM_SPTR at, int mark)
| associates an Atom pointer with a bookmark More...
void | setAtomBookmark (Atom *at, int mark)
void | replaceAtomBookmark (ATOM_SPTR at, int mark)
| associates an Atom pointer with a bookmark More...
void | replaceAtomBookmark (Atom *at, int mark)
Atom * | getAtomWithBookmark (int mark)
| returns the first Atom associated with the `bookmark` provided More...
ATOM_PTR_LIST & | getAllAtomsWithBookmark (int mark)
| returns all Atoms associated with the `bookmark` provided More...
void | clearAtomBookmark (const int mark)
| removes a `bookmark` from our collection More...
void | clearAtomBookmark (const int mark, const Atom *atom)
| removes a particular Atom from the list associated with the `bookmark` More...
void | clearAtomBookmark (const int mark, ATOM_SPTR atom)
void | clearAllAtomBookmarks ()
| blows out all atomic `bookmarks` More...
bool | hasAtomBookmark (int mark) const
| queries whether or not any atoms are associated with a `bookmark` More...
ATOM_BOOKMARK_MAP * | getAtomBookmarks ()
| returns a pointer to all of our atom `bookmarks` More...
void | setBondBookmark (BOND_SPTR bond, int mark)
| associates a Bond pointer with a bookmark More...
void | setBondBookmark (Bond *bond, int mark)
Bond * | getBondWithBookmark (int mark)
| returns the first Bond associated with the `bookmark` provided More...
BOND_PTR_LIST & | getAllBondsWithBookmark (int mark)
| returns all bonds associated with the `bookmark` provided More...
void | clearBondBookmark (int mark)
| removes a `bookmark` from our collection More...
void | clearBondBookmark (int mark, const Bond *bond)
| removes a particular Bond from the list associated with the `bookmark` More...
void | clearBondBookmark (int mark, BOND_SPTR bond)
void | clearAllBondBookmarks ()
| blows out all bond `bookmarks` More...
bool | hasBondBookmark (int mark) const
| queries whether or not any bonds are associated with a `bookmark` More...
BOND_BOOKMARK_MAP * | getBondBookmarks ()
| returns a pointer to all of our bond `bookmarks` More...
Conformers
const Conformer & | getConformer (int id=-1) const
Conformer & | getConformer (int id=-1)
void | removeConformer (unsigned int id)
| Delete the conformation with the specified ID. More...
void | clearConformers ()
| Clear all the conformations on the molecule. More...
unsigned int | addConformer (Conformer *conf, bool assignId=false)
| Add a new conformation to the molecule. More...
unsigned int | getNumConformers () const
Topology
RingInfo * | getRingInfo () const
ADJ_ITER_PAIR | getAtomNeighbors (Atom const *at) const
| provides access to all neighbors around an Atom More...
ADJ_ITER_PAIR | getAtomNeighbors (ATOM_SPTR at) const
OBOND_ITER_PAIR | getAtomBonds (Atom const *at) const
| provides access to all Bond objects connected to an Atom More...
ATOM_ITER_PAIR | getVertices ()
| returns an iterator pair for looping over all Atoms More...
BOND_ITER_PAIR | getEdges ()
| returns an iterator pair for looping over all Bonds More...
ATOM_ITER_PAIR | getVertices () const
BOND_ITER_PAIR | getEdges () const
MolGraph const & | getTopology () const
| brief returns a pointer to our underlying BGL object More...
Iterators
AtomIterator | beginAtoms ()
| get an AtomIterator pointing at our first Atom More...
ConstAtomIterator | beginAtoms () const
AtomIterator | endAtoms ()
| get an AtomIterator pointing at the end of our Atoms More...
ConstAtomIterator | endAtoms () const
BondIterator | beginBonds ()
| get a BondIterator pointing at our first Bond More...
ConstBondIterator | beginBonds () const
BondIterator | endBonds ()
| get a BondIterator pointing at the end of our Bonds More...
ConstBondIterator | endBonds () const
AromaticAtomIterator | beginAromaticAtoms ()
| get an AtomIterator pointing at our first aromatic Atom More...
ConstAromaticAtomIterator | beginAromaticAtoms () const
AromaticAtomIterator | endAromaticAtoms ()
| get an AtomIterator pointing at the end of our Atoms More...
ConstAromaticAtomIterator | endAromaticAtoms () const
HeteroatomIterator | beginHeteros ()
| get an AtomIterator pointing at our first hetero Atom More...
ConstHeteroatomIterator | beginHeteros () const
HeteroatomIterator | endHeteros ()
| get an AtomIterator pointing at the end of our Atoms More...
ConstHeteroatomIterator | endHeteros () const
QueryAtomIterator | beginQueryAtoms (QueryAtom const *query)
| get an AtomIterator pointing at our first Atom that matches `query` More...
ConstQueryAtomIterator | beginQueryAtoms (QueryAtom const *) const
QueryAtomIterator | endQueryAtoms ()
| get an AtomIterator pointing at the end of our Atoms More...
ConstQueryAtomIterator | endQueryAtoms () const
MatchingAtomIterator | beginMatchingAtoms (bool(*query)(Atom *))
| get an AtomIterator pointing at our first Atom that matches `query` More...
ConstMatchingAtomIterator | beginMatchingAtoms (bool(*query)(const Atom *)) const
MatchingAtomIterator | endMatchingAtoms ()
| get an AtomIterator pointing at the end of our Atoms More...
ConstMatchingAtomIterator | endMatchingAtoms () const
ConformerIterator | beginConformers ()
ConformerIterator | endConformers ()
ConstConformerIterator | beginConformers () const
ConstConformerIterator | endConformers () const
Properties
STR_VECT | getPropList (bool includePrivate=true, bool includeComputed=true) const
| returns a list with the names of our `properties` More...
template<typename T >
void | setProp (const char *key, T val, bool computed=false) const
| sets a `property` value More...
template<typename T >
void | setProp (const std::string &key, T val, bool computed=false) const
template<typename T >
void | getProp (const char *key, T &res) const
| allows retrieval of a particular property value More...
template<typename T >
void | getProp (const std::string &key, T &res) const
template<typename T >
T | getProp (const char *key) const
template<typename T >
T | getProp (const std::string &key) const
template<typename T >
bool | getPropIfPresent (const char *key, T &res) const
template<typename T >
bool | getPropIfPresent (const std::string &key, T &res) const
bool | hasProp (const char *key) const
| returns whether or not we have a `property` with name `key` More...
bool | hasProp (const std::string &key) const
void | clearProp (const char *key) const
| clears the value of a `property` More...
void | clearProp (const std::string &key) const
void | clearComputedProps (bool includeRings=true) const
| clears all of our `computed` `properties` More...
void | updatePropertyCache (bool strict=true)
| calculates any of our lazy `properties` More...
bool | needsUpdatePropertyCache () const
Misc
void | debugMol (std::ostream &str) const
| sends some debugging info to a stream More...

## Friends

class | MolPickler
class | RWMol

## Detailed Description

ROMol is a molecule class that is intended to have a fixed topology.

This is the primary class for most molecule operations.

If you need to be manipulating the molecule (e.g. adding or deleting atoms or bonds, use an RWMol instead.

Notes:

- each ROMol maintains a Dict of `properties:`
  - Each `property` is keyed by name and can store an arbitrary type.
  - `Properties` can be marked as `calculated`, in which case they will be cleared when the `clearComputedProps()` method is called.
  - Because they have no impact upon chemistry, all `property` operations are `const`, this allows extra flexibility for clients who need to store extra data on ROMol objects.
- each ROMol has collections of `bookmarks` for Atoms and Bonds:
  - the Atom bookmarks and Bond bookmarks are stored separately from each other
  - each `bookmark`, an integer, can map to more than one Atom or Bond
  - these are currently used in molecule construction, but could also be useful for reaction mapping and the like
- information about rings (SSSR and the like) is stored in the molecule's RingInfo pointer.

Definition at line 102 of file ROMol.h.

## Constructor & Destructor Documentation

## ROMol() [1/3]

RDKit::ROMol::ROMol | ( |  | ) |

inline

Definition at line 177 of file ROMol.h.

Referenced by ROMol().

## ROMol() [2/3]

RDKit::ROMol::ROMol | ( | const ROMol & | other,
|  | bool | quickCopy = `false`,
|  | int | confId = `-1`
| ) |  |

inline

copy constructor with a twist

Parameters

  other | the molecule to be copied
  quickCopy | (optional) if this is true, the resulting ROMol will not copy any of the properties or bookmarks and conformers from `other`. This can make the copy substantially faster (thus the name).
  confId | (optional) if this is >=0, the resulting ROMol will contain only the specified conformer from `other`.

Definition at line 190 of file ROMol.h.

References ROMol().

## ROMol() [3/3]

RDKit::ROMol::ROMol | ( | const std::string & | binStr | ) |

construct a molecule from a pickle string

## ~ROMol()

virtual RDKit::ROMol::~ROMol | ( |  | ) |

inline virtual

Definition at line 198 of file ROMol.h.

References getAtomWithIdx(), getNumAtoms(), and getNumHeavyAtoms().

## Member Function Documentation

## addConformer()

unsigned int RDKit::ROMol::addConformer | ( | Conformer * | conf,
|  | bool | assignId = `false`
| ) |  |

Add a new conformation to the molecule.

Parameters

  conf | - conformation to be added to the molecule, this molecule takes ownership of the conformer
  assignId | - a unique ID will be assigned to the the conformation if true otherwise it is assumed that the conformation already has an (unique) ID set

Referenced by clearConformers().

## beginAromaticAtoms() [1/2]

AromaticAtomIterator RDKit::ROMol::beginAromaticAtoms | ( |  | ) |

get an AtomIterator pointing at our first aromatic Atom

Referenced by getTopology().

## beginAromaticAtoms() [2/2]

ConstAromaticAtomIterator RDKit::ROMol::beginAromaticAtoms | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## beginAtoms() [1/2]

AtomIterator RDKit::ROMol::beginAtoms | ( |  | ) |

get an AtomIterator pointing at our first Atom

Referenced by getTopology().

## beginAtoms() [2/2]

ConstAtomIterator RDKit::ROMol::beginAtoms | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## beginBonds() [1/2]

BondIterator RDKit::ROMol::beginBonds | ( |  | ) |

get a BondIterator pointing at our first Bond

Referenced by getTopology().

## beginBonds() [2/2]

ConstBondIterator RDKit::ROMol::beginBonds | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## beginConformers() [1/2]

ConformerIterator RDKit::ROMol::beginConformers | ( |  | ) |

inline

Definition at line 541 of file ROMol.h.

Referenced by RDKit::MMFF::MMFFOptimizeMolecule(), RDKit::MMFF::MMFFOptimizeMoleculeConfs(), RDKit::UFF::UFFOptimizeMolecule(), and RDKit::UFF::UFFOptimizeMoleculeConfs().

## beginConformers() [2/2]

ConstConformerIterator RDKit::ROMol::beginConformers | ( |  | ) | const

inline

Definition at line 545 of file ROMol.h.

## beginHeteros() [1/2]

HeteroatomIterator RDKit::ROMol::beginHeteros | ( |  | ) |

get an AtomIterator pointing at our first hetero Atom

Referenced by getTopology().

## beginHeteros() [2/2]

ConstHeteroatomIterator RDKit::ROMol::beginHeteros | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## beginMatchingAtoms() [1/2]

MatchingAtomIterator RDKit::ROMol::beginMatchingAtoms | ( | bool(*)(Atom *) | query | ) |

get an AtomIterator pointing at our first Atom that matches `query`

Referenced by getTopology().

## beginMatchingAtoms() [2/2]

ConstMatchingAtomIterator RDKit::ROMol::beginMatchingAtoms | ( | bool(*)(const Atom *) | query | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## beginQueryAtoms() [1/2]

QueryAtomIterator RDKit::ROMol::beginQueryAtoms | ( | QueryAtom const * | query | ) |

get an AtomIterator pointing at our first Atom that matches `query`

Referenced by getTopology().

## beginQueryAtoms() [2/2]

ConstQueryAtomIterator RDKit::ROMol::beginQueryAtoms | ( | QueryAtom const * |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## clearAllAtomBookmarks()

void RDKit::ROMol::clearAllAtomBookmarks | ( |  | ) |

inline

blows out all atomic `bookmarks`

Definition at line 299 of file ROMol.h.

## clearAllBondBookmarks()

void RDKit::ROMol::clearAllBondBookmarks | ( |  | ) |

inline

blows out all bond `bookmarks`

Definition at line 326 of file ROMol.h.

## clearAtomBookmark() [1/3]

void RDKit::ROMol::clearAtomBookmark | ( | const int | mark | ) |

removes a `bookmark` from our collection

Referenced by clearAtomBookmark(), and replaceAtomBookmark().

## clearAtomBookmark() [2/3]

void RDKit::ROMol::clearAtomBookmark | ( | const int | mark,
|  | const Atom * | atom
| ) |  |

removes a particular Atom from the list associated with the `bookmark`

## clearAtomBookmark() [3/3]

void RDKit::ROMol::clearAtomBookmark | ( | const int | mark,
|  | ATOM_SPTR | atom
| ) |  |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 295 of file ROMol.h.

References clearAtomBookmark().

## clearBondBookmark() [1/3]

void RDKit::ROMol::clearBondBookmark | ( | int | mark | ) |

removes a `bookmark` from our collection

Referenced by clearBondBookmark(), and setBondBookmark().

## clearBondBookmark() [2/3]

void RDKit::ROMol::clearBondBookmark | ( | int | mark,
|  | const Bond * | bond
| ) |  |

removes a particular Bond from the list associated with the `bookmark`

## clearBondBookmark() [3/3]

void RDKit::ROMol::clearBondBookmark | ( | int | mark,
|  | BOND_SPTR | bond
| ) |  |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 322 of file ROMol.h.

References clearBondBookmark().

## clearComputedProps()

void RDKit::ROMol::clearComputedProps | ( | bool | includeRings = `true` | ) | const

clears all of our `computed` `properties`

Referenced by clearProp().

## clearConformers()

void RDKit::ROMol::clearConformers | ( |  | ) |

inline

Clear all the conformations on the molecule.

Definition at line 349 of file ROMol.h.

References addConformer().

## clearProp() [1/2]

void RDKit::ROMol::clearProp | ( | const char * | key | ) | const

inline

clears the value of a `property`

Notes:

- if no `property` with name `key` exists, a KeyErrorException will be thrown.
- if the `property` is marked as `computed`, it will also be removed from our list of `computedProperties`

Definition at line 673 of file ROMol.h.

## clearProp() [2/2]

void RDKit::ROMol::clearProp | ( | const std::string & | key | ) | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 678 of file ROMol.h.

References clearComputedProps(), RDKit::Dict::clearVal(), detail::computedPropName, debugMol(), getProp(), needsUpdatePropertyCache(), RDKit::Dict::setVal(), and updatePropertyCache().

## debugMol()

void RDKit::ROMol::debugMol | ( | std::ostream & | str | ) | const

sends some debugging info to a stream

Referenced by clearProp().

## endAromaticAtoms() [1/2]

AromaticAtomIterator RDKit::ROMol::endAromaticAtoms | ( |  | ) |

get an AtomIterator pointing at the end of our Atoms

Referenced by getTopology().

## endAromaticAtoms() [2/2]

ConstAromaticAtomIterator RDKit::ROMol::endAromaticAtoms | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## endAtoms() [1/2]

AtomIterator RDKit::ROMol::endAtoms | ( |  | ) |

get an AtomIterator pointing at the end of our Atoms

Referenced by getTopology().

## endAtoms() [2/2]

ConstAtomIterator RDKit::ROMol::endAtoms | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## endBonds() [1/2]

BondIterator RDKit::ROMol::endBonds | ( |  | ) |

get a BondIterator pointing at the end of our Bonds

Referenced by getTopology().

## endBonds() [2/2]

ConstBondIterator RDKit::ROMol::endBonds | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## endConformers() [1/2]

ConformerIterator RDKit::ROMol::endConformers | ( |  | ) |

inline

Definition at line 543 of file ROMol.h.

Referenced by RDKit::MMFF::MMFFOptimizeMolecule(), RDKit::MMFF::MMFFOptimizeMoleculeConfs(), RDKit::UFF::UFFOptimizeMolecule(), and RDKit::UFF::UFFOptimizeMoleculeConfs().

## endConformers() [2/2]

ConstConformerIterator RDKit::ROMol::endConformers | ( |  | ) | const

inline

Definition at line 549 of file ROMol.h.

## endHeteros() [1/2]

HeteroatomIterator RDKit::ROMol::endHeteros | ( |  | ) |

get an AtomIterator pointing at the end of our Atoms

Referenced by getTopology().

## endHeteros() [2/2]

ConstHeteroatomIterator RDKit::ROMol::endHeteros | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## endMatchingAtoms() [1/2]

MatchingAtomIterator RDKit::ROMol::endMatchingAtoms | ( |  | ) |

get an AtomIterator pointing at the end of our Atoms

Referenced by getTopology().

## endMatchingAtoms() [2/2]

ConstMatchingAtomIterator RDKit::ROMol::endMatchingAtoms | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## endQueryAtoms() [1/2]

QueryAtomIterator RDKit::ROMol::endQueryAtoms | ( |  | ) |

get an AtomIterator pointing at the end of our Atoms

Referenced by getTopology().

## endQueryAtoms() [2/2]

ConstQueryAtomIterator RDKit::ROMol::endQueryAtoms | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getAllAtomsWithBookmark()

ATOM_PTR_LIST& RDKit::ROMol::getAllAtomsWithBookmark | ( | int | mark | ) |

returns all Atoms associated with the `bookmark` provided

Referenced by replaceAtomBookmark().

## getAllBondsWithBookmark()

BOND_PTR_LIST& RDKit::ROMol::getAllBondsWithBookmark | ( | int | mark | ) |

returns all bonds associated with the `bookmark` provided

Referenced by setBondBookmark().

## getAtomBonds()

OBOND_ITER_PAIR RDKit::ROMol::getAtomBonds | ( | Atom const * | at | ) | const

provides access to all Bond objects connected to an Atom

Parameters

  at | the atom whose neighbors we are looking for

Usage

... molPtr is a const ROMol * ...
... atomPtr is a const Atom * ...
ROMol::OEDGE_ITER beg,end;
boost::tie(beg,end) = molPtr->getAtomBonds(atomPtr);
while(beg!=end){
const BOND_SPTR bond=(*molPtr)[*beg];
... do something with the Bond ...
++beg;
}

or, if you need a non-const Bond *:

... molPtr is a ROMol * ...
... atomPtr is a const Atom * ...
ROMol::OEDGE_ITER beg,end;
boost::tie(beg,end) = molPtr->getAtomBonds(atomPtr);
while(beg!=end){
BOND_SPTR bond=(*molPtr)[*beg];
... do something with the Bond ...
++beg;
}

Referenced by RDKit::Drawing::DrawMol(), getRingInfo(), RDKit::queryAtomHasRingBond(), and RDKit::queryAtomRingBondCount().

## getAtomBookmarks()

ATOM_BOOKMARK_MAP* RDKit::ROMol::getAtomBookmarks | ( |  | ) |

inline

returns a pointer to all of our atom `bookmarks`

Definition at line 303 of file ROMol.h.

## getAtomDegree() [1/2]

unsigned int RDKit::ROMol::getAtomDegree | ( | const Atom * | at | ) | const

returns the degree (number of neighbors) of an Atom in the graph

Referenced by getAtomWithIdx().

## getAtomDegree() [2/2]

unsigned int RDKit::ROMol::getAtomDegree | ( | ATOM_SPTR | at | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getAtomNeighbors() [1/2]

ADJ_ITER_PAIR RDKit::ROMol::getAtomNeighbors | ( | Atom const * | at | ) | const

provides access to all neighbors around an Atom

Parameters

  at | the atom whose neighbors we are looking for

Usage

... molPtr is a const ROMol & ...
... atomPtr is a const Atom * ...
ROMol::ADJ_ITER nbrIdx,endNbrs;
boost::tie(nbrIdx,endNbrs) = molPtr.getAtomNeighbors(atomPtr);
while(nbrIdx!=endNbrs){
const ATOM_SPTR at=molPtr[*nbrIdx];
... do something with the Atom ...
++nbrIdx;
}

Referenced by getRingInfo().

## getAtomNeighbors() [2/2]

ADJ_ITER_PAIR RDKit::ROMol::getAtomNeighbors | ( | ATOM_SPTR | at | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getAtomWithBookmark()

Atom* RDKit::ROMol::getAtomWithBookmark | ( | int | mark | ) |

returns the first Atom associated with the `bookmark` provided

Referenced by replaceAtomBookmark().

## getAtomWithIdx() [1/4]

Atom* RDKit::ROMol::getAtomWithIdx | ( | unsigned int | idx | ) |

returns a pointer to a particular Atom

Referenced by RDKit::Drawing::DrawMol(), getAtomWithIdx(), RDKit::RWMol::getLastAtom(), and ~ROMol().

## getAtomWithIdx() [2/4]

const Atom* RDKit::ROMol::getAtomWithIdx | ( | unsigned int | idx | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getAtomWithIdx() [3/4]

template<class U >

Atom* RDKit::ROMol::getAtomWithIdx | ( | const U | idx | ) |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 213 of file ROMol.h.

References getAtomWithIdx().

## getAtomWithIdx() [4/4]

template<class U >

const Atom* RDKit::ROMol::getAtomWithIdx | ( | const U | idx | ) | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 218 of file ROMol.h.

References getAtomDegree(), getAtomWithIdx(), getBondWithIdx(), and getNumBonds().

## getBondBetweenAtoms() [1/4]

Bond* RDKit::ROMol::getBondBetweenAtoms | ( | unsigned int | idx1,
|  | unsigned int | idx2
| ) |  |

returns a pointer to the bond between two atoms, Null on failure

Referenced by getBondBetweenAtoms(), getBondWithIdx(), and RDKit::FMCS::TargetMatch::init().

## getBondBetweenAtoms() [2/4]

const Bond* RDKit::ROMol::getBondBetweenAtoms | ( | unsigned int | idx1,
|  | unsigned int | idx2
| ) |  | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getBondBetweenAtoms() [3/4]

template<class U , class V >

Bond* RDKit::ROMol::getBondBetweenAtoms | ( | const U | idx1,
|  | const V | idx2
| ) |  |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 252 of file ROMol.h.

References getBondBetweenAtoms().

## getBondBetweenAtoms() [4/4]

template<class U , class V >

const Bond* RDKit::ROMol::getBondBetweenAtoms | ( | const U | idx1,
|  | const V | idx2
| ) |  | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 258 of file ROMol.h.

References getBondBetweenAtoms().

## getBondBookmarks()

BOND_BOOKMARK_MAP* RDKit::ROMol::getBondBookmarks | ( |  | ) |

inline

returns a pointer to all of our bond `bookmarks`

Definition at line 330 of file ROMol.h.

References getConformer(), and removeConformer().

## getBondWithBookmark()

Bond* RDKit::ROMol::getBondWithBookmark | ( | int | mark | ) |

returns the first Bond associated with the `bookmark` provided

Referenced by setBondBookmark().

## getBondWithIdx() [1/4]

Bond* RDKit::ROMol::getBondWithIdx | ( | unsigned int | idx | ) |

returns a pointer to a particular Bond

Referenced by RDKit::FMCS::RingMatchTableSet::computeRingMatchTable(), getAtomWithIdx(), and getBondWithIdx().

## getBondWithIdx() [2/4]

const Bond* RDKit::ROMol::getBondWithIdx | ( | unsigned int | idx | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getBondWithIdx() [3/4]

template<class U >

Bond* RDKit::ROMol::getBondWithIdx | ( | const U | idx | ) |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 238 of file ROMol.h.

References getBondWithIdx().

## getBondWithIdx() [4/4]

template<class U >

const Bond* RDKit::ROMol::getBondWithIdx | ( | const U | idx | ) | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 243 of file ROMol.h.

References getBondBetweenAtoms(), and getBondWithIdx().

## getConformer() [1/2]

const Conformer& RDKit::ROMol::getConformer | ( | int | id = `-1` | ) | const

return the conformer with a specified ID if the ID is negative the first conformation will be returned

Referenced by RDKit::Drawing::DrawMol(), and getBondBookmarks().

## getConformer() [2/2]

Conformer& RDKit::ROMol::getConformer | ( | int | id = `-1` | ) |

return the conformer with a specified ID if the ID is negative the first conformation will be returned

## getEdges() [1/2]

BOND_ITER_PAIR RDKit::ROMol::getEdges | ( |  | ) |

returns an iterator pair for looping over all Bonds

Usage

ROMol::EDGE_ITER firstB,lastB;
boost::tie(firstB,lastB) = mol.getEdges();
while(firstB!=lastB){
BOND_SPTR bond = mol[*firstB];
... do something with the Bond ...
++firstB;
}

Referenced by getRingInfo().

## getEdges() [2/2]

BOND_ITER_PAIR RDKit::ROMol::getEdges | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## getNumAtoms()

unsigned int RDKit::ROMol::getNumAtoms | ( | bool | onlyExplicit = `1` | ) | const

returns our number of atoms

Referenced by RDKit::Canon::BreakTies(), RDKit::Drawing::DrawMol(), RDKit::RWMol::getLastAtom(), RDKit::FMCS::TargetMatch::init(), RDKit::MMFF::MMFFOptimizeMolecule(), RDKit::MMFF::MMFFOptimizeMoleculeConfs(), RDKit::Canon::RefinePartitions(), RDKit::MolChemicalFeatureDef::setWeights(), RDKit::UFF::UFFOptimizeMolecule(), and ~ROMol().

## getNumBonds()

unsigned int RDKit::ROMol::getNumBonds | ( | bool | onlyHeavy = `1` | ) | const

returns our number of Bonds

Referenced by RDKit::FMCS::RingMatchTableSet::addTargetBondRingsIndeces(), getAtomWithIdx(), RDKit::FragCatalogEntry::getOrder(), RDKit::FMCS::TargetMatch::init(), and RDKit::FMCS::RingMatchTableSet::init().

## getNumConformers()

unsigned int RDKit::ROMol::getNumConformers | ( |  | ) | const

inline

Definition at line 363 of file ROMol.h.

Referenced by RDKit::MMFF::MMFFOptimizeMoleculeConfs(), RDKit::Drawing::MolToDrawing(), and RDKit::UFF::UFFOptimizeMoleculeConfs().

## getNumHeavyAtoms()

unsigned int RDKit::ROMol::getNumHeavyAtoms | ( |  | ) | const

returns our number of heavy atoms (atomic number > 1)

Referenced by ~ROMol().

## getProp() [1/4]

template<typename T >

void RDKit::ROMol::getProp | ( | const char * | key,
|  | T & | res
| ) |  | const

inline

allows retrieval of a particular property value

Parameters

  key | the name under which the `property` should be stored. If a `property` is already stored under this name, it will be replaced.
  res | a reference to the storage location for the value.

Notes:

- if no `property` with name `key` exists, a KeyErrorException will be thrown.
- the `boost::lexical_cast` machinery is used to attempt type conversions. If this fails, a `boost::bad_lexical_cast` exception will be thrown.

Definition at line 622 of file ROMol.h.

References RDKit::Dict::getVal().

Referenced by clearProp().

## getProp() [2/4]

template<typename T >

void RDKit::ROMol::getProp | ( | const std::string & | key,
|  | T & | res
| ) |  | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 627 of file ROMol.h.

References RDKit::Dict::getVal().

## getProp() [3/4]

template<typename T >

T RDKit::ROMol::getProp | ( | const char * | key | ) | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 632 of file ROMol.h.

References RDKit::Dict::getVal().

## getProp() [4/4]

template<typename T >

T RDKit::ROMol::getProp | ( | const std::string & | key | ) | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 637 of file ROMol.h.

References RDKit::Dict::getVal().

## getPropIfPresent() [1/2]

template<typename T >

bool RDKit::ROMol::getPropIfPresent | ( | const char * | key,
|  | T & | res
| ) |  | const

inline

returns whether or not we have a `property` with name `key` and assigns the value if we do

Definition at line 644 of file ROMol.h.

References RDKit::Dict::getValIfPresent().

Referenced by getPropList().

## getPropIfPresent() [2/2]

template<typename T >

bool RDKit::ROMol::getPropIfPresent | ( | const std::string & | key,
|  | T & | res
| ) |  | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 649 of file ROMol.h.

References RDKit::Dict::getValIfPresent().

## getPropList()

STR_VECT RDKit::ROMol::getPropList | ( | bool | includePrivate = `true`,
|  | bool | includeComputed = `true`
| ) |  | const

inline

returns a list with the names of our `properties`

Definition at line 557 of file ROMol.h.

References detail::computedPropName, getPropIfPresent(), and RDKit::Dict::keys().

## getRingInfo()

RingInfo* RDKit::ROMol::getRingInfo | ( |  | ) | const

inline

returns a pointer to our RingInfo structure Note: the client should not delete this.

Definition at line 374 of file ROMol.h.

References getAtomBonds(), getAtomNeighbors(), getEdges(), and getVertices().

Referenced by RDKit::FMCS::RingMatchTableSet::addTargetBondRingsIndeces(), RDKit::FMCS::RingMatchTableSet::computeRingMatchTable(), RDKit::Drawing::DrawMol(), RDKit::FMCS::RingMatchTableSet::init(), RDKit::queryAtomHasRingBond(), RDKit::queryAtomIsInRingOfSize(), RDKit::queryAtomMinRingSize(), RDKit::queryAtomRingBondCount(), RDKit::queryAtomRingMembership(), RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsAtomInNRings(), RDKit::queryIsAtomInRing(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().

## getTopology()

MolGraph const& RDKit::ROMol::getTopology | ( |  | ) | const

inline

brief returns a pointer to our underlying BGL object

This can be useful if you need to call other BGL algorithms:

Here's an example:

... mol is a const ROMol ...
... mapping is an INT_VECT ...
mapping.resize(mol.getNumAtoms());
const MolGraph &G_p = mol.getTopology();
int res = boost::connected_components(G_p,&mapping[0]);

Definition at line 481 of file ROMol.h.

References beginAromaticAtoms(), beginAtoms(), beginBonds(), beginHeteros(), beginMatchingAtoms(), beginQueryAtoms(), endAromaticAtoms(), endAtoms(), endBonds(), endHeteros(), endMatchingAtoms(), and endQueryAtoms().

Referenced by RDKit::queryAtomHasRingBond(), and RDKit::queryAtomRingBondCount().

## getVertices() [1/2]

ATOM_ITER_PAIR RDKit::ROMol::getVertices | ( |  | ) |

returns an iterator pair for looping over all Atoms

Usage

ROMol::VERTEX_ITER atBegin,atEnd;
boost::tie(atBegin,atEnd) = mol.getVertices();
while(atBegin!=atEnd){
ATOM_SPTR at2=mol[*atBegin];
... do something with the Atom ...
++atBegin;
}

Referenced by RDKit::Drawing::DrawMol(), and getRingInfo().

## getVertices() [2/2]

ATOM_ITER_PAIR RDKit::ROMol::getVertices | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## hasAtomBookmark()

bool RDKit::ROMol::hasAtomBookmark | ( | int | mark | ) | const

inline

queries whether or not any atoms are associated with a `bookmark`

Definition at line 301 of file ROMol.h.

## hasBondBookmark()

bool RDKit::ROMol::hasBondBookmark | ( | int | mark | ) | const

inline

queries whether or not any bonds are associated with a `bookmark`

Definition at line 328 of file ROMol.h.

## hasProp() [1/2]

bool RDKit::ROMol::hasProp | ( | const char * | key | ) | const

inline

returns whether or not we have a `property` with name `key`

Definition at line 654 of file ROMol.h.

References RDKit::Dict::hasVal().

## hasProp() [2/2]

bool RDKit::ROMol::hasProp | ( | const std::string & | key | ) | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 659 of file ROMol.h.

References RDKit::Dict::hasVal().

## needsUpdatePropertyCache()

bool RDKit::ROMol::needsUpdatePropertyCache | ( |  | ) | const

Referenced by clearProp().

## operator[]() [1/4]

ATOM_SPTR RDKit::ROMol::operator[] | ( | const vertex_descriptor & | v | ) |

inline

Definition at line 709 of file ROMol.h.

## operator[]() [2/4]

const ATOM_SPTR RDKit::ROMol::operator[] | ( | const vertex_descriptor & | v | ) | const

inline

Definition at line 710 of file ROMol.h.

## operator[]() [3/4]

BOND_SPTR RDKit::ROMol::operator[] | ( | const edge_descriptor & | e | ) |

inline

Definition at line 714 of file ROMol.h.

## operator[]() [4/4]

const BOND_SPTR RDKit::ROMol::operator[] | ( | const edge_descriptor & | e | ) | const

inline

Definition at line 715 of file ROMol.h.

## removeConformer()

void RDKit::ROMol::removeConformer | ( | unsigned int | id | ) |

Delete the conformation with the specified ID.

Referenced by getBondBookmarks().

## replaceAtomBookmark() [1/2]

void RDKit::ROMol::replaceAtomBookmark | ( | ATOM_SPTR | at,
|  | int | mark
| ) |  |

inline

associates an Atom pointer with a bookmark

Definition at line 277 of file ROMol.h.

## replaceAtomBookmark() [2/2]

void RDKit::ROMol::replaceAtomBookmark | ( | Atom * | at,
|  | int | mark
| ) |  |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 282 of file ROMol.h.

References clearAtomBookmark(), getAllAtomsWithBookmark(), and getAtomWithBookmark().

## setAtomBookmark() [1/2]

void RDKit::ROMol::setAtomBookmark | ( | ATOM_SPTR | at,
|  | int | mark
| ) |  |

inline

associates an Atom pointer with a bookmark

Definition at line 269 of file ROMol.h.

## setAtomBookmark() [2/2]

void RDKit::ROMol::setAtomBookmark | ( | Atom * | at,
|  | int | mark
| ) |  |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 273 of file ROMol.h.

## setBondBookmark() [1/2]

void RDKit::ROMol::setBondBookmark | ( | BOND_SPTR | bond,
|  | int | mark
| ) |  |

inline

associates a Bond pointer with a bookmark

Definition at line 306 of file ROMol.h.

## setBondBookmark() [2/2]

void RDKit::ROMol::setBondBookmark | ( | Bond * | bond,
|  | int | mark
| ) |  |

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 310 of file ROMol.h.

References clearBondBookmark(), getAllBondsWithBookmark(), and getBondWithBookmark().

## setProp() [1/2]

template<typename T >

void RDKit::ROMol::setProp | ( | const char * | key,
|  | T | val,
|  | bool | computed = `false`
| ) |  | const

inline

sets a `property` value

Parameters

  key | the name under which the `property` should be stored. If a `property` is already stored under this name, it will be replaced.
  val | the value to be stored
  computed | (optional) allows the `property` to be flagged `computed`.

Definition at line 587 of file ROMol.h.

## setProp() [2/2]

template<typename T >

void RDKit::ROMol::setProp | ( | const std::string & | key,
|  | T | val,
|  | bool | computed = `false`
| ) |  | const

inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 593 of file ROMol.h.

References detail::computedPropName, RDKit::Dict::getVal(), and RDKit::Dict::setVal().

## updatePropertyCache()

void RDKit::ROMol::updatePropertyCache | ( | bool | strict = `true` | ) |

calculates any of our lazy `properties`

Notes:

- this calls `updatePropertyCache()` on each of our Atoms and Bonds

Referenced by clearProp().

## Friends And Related Function Documentation

## MolPickler

friend class MolPickler

friend

Definition at line 104 of file ROMol.h.

## RWMol

friend class RWMol

friend

Definition at line 105 of file ROMol.h.

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

- ROMol.h