RDKit: RDKit::ROMol Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Friends | List of all members
RDKit::ROMol Class Reference

`#include <ROMol.h>`

Inheritance diagram for RDKit::ROMol:

## Public Member Functions
CXXAtomIterator< MolGraph, Atom * > | atoms ()
| C++11 Range iterator.
CXXAtomIterator< const MolGraph, Atom *const > | atoms () const
CXXAtomIterator< const MolGraph, Atom *const, MolGraph::adjacency_iterator > | atomNeighbors (Atom const *at) const
CXXAtomIterator< MolGraph, Atom *, MolGraph::adjacency_iterator > | atomNeighbors (Atom const *at)
CXXBondIterator< const MolGraph, Bond *const, MolGraph::out_edge_iterator > | atomBonds (Atom const *at) const
CXXBondIterator< MolGraph, Bond *, MolGraph::out_edge_iterator > | atomBonds (Atom const *at)
CXXBondIterator< MolGraph, Bond * > | bonds ()
CXXBondIterator< const MolGraph, Bond *const > | bonds () const
| ROMol ()
| ROMol (const ROMol &other, bool quickCopy=false, int confId=-1)
| copy constructor with a twist
| ROMol (const std::string &binStr)
| construct a molecule from a pickle string
| ROMol (const std::string &binStr, unsigned int propertyFlags)
| construct a molecule from a pickle string
| ROMol (ROMol &&o) noexcept
ROMol & | operator= (ROMol &&o) noexcept
ROMol & | operator= (const ROMol &)=delete
virtual | ~ROMol ()
Atom * | operator[] (const vertex_descriptor &v)
const Atom * | operator[] (const vertex_descriptor &v) const
Bond * | operator[] (const edge_descriptor &e)
const Bond * | operator[] (const edge_descriptor &e) const
const std::vector< StereoGroup > & | getStereoGroups () const
| Gets a reference to the groups of atoms with relative stereochemistry.
void | setStereoGroups (std::vector< StereoGroup > stereo_groups)
| Sets groups of atoms with relative stereochemistry.
Atoms
unsigned int | getNumAtoms () const
| returns our number of atoms
unsigned int | getNumAtoms (bool onlyExplicit) const
unsigned int | getNumHeavyAtoms () const
| returns our number of heavy atoms (atomic number > 1)
Atom * | getAtomWithIdx (unsigned int idx)
| returns a pointer to a particular Atom
const Atom * | 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.
template<class U>
Atom * | getAtomWithIdx (const U idx)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class U>
const Atom * | getAtomWithIdx (const U idx) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
unsigned int | getAtomDegree (const Atom *at) const
| returns the degree (number of neighbors) of an Atom in the graph
Bonds
unsigned int | getNumBonds (bool onlyHeavy=1) const
| returns our number of Bonds
Bond * | getBondWithIdx (unsigned int idx)
| returns a pointer to a particular Bond
const Bond * | 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.
template<class U>
Bond * | getBondWithIdx (const U idx)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class U>
const Bond * | getBondWithIdx (const U idx) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Bond * | getBondBetweenAtoms (unsigned int idx1, unsigned int idx2)
| returns a pointer to the bond between two atoms, Null on failure
const Bond * | 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.
template<class U, class V>
Bond * | getBondBetweenAtoms (const U idx1, const V idx2)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class U, class V>
const Bond * | getBondBetweenAtoms (const U idx1, const V idx2) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Bookmarks
void | setAtomBookmark (Atom *at, int mark)
| associates an Atom pointer with a bookmark
void | replaceAtomBookmark (Atom *at, int mark)
| associates an Atom pointer with a bookmark
Atom * | getAtomWithBookmark (int mark)
| returns the first Atom associated with the `bookmark` provided
Atom * | getUniqueAtomWithBookmark (int mark)
ATOM_PTR_LIST & | getAllAtomsWithBookmark (int mark)
| returns all Atoms associated with the `bookmark` provided
void | clearAtomBookmark (int mark)
| removes a `bookmark` from our collection
void | clearAtomBookmark (int mark, const Atom *atom)
| removes a particular Atom from the list associated with the `bookmark`
void | clearAllAtomBookmarks ()
| blows out all atomic `bookmarks`
bool | hasAtomBookmark (int mark) const
| queries whether or not any atoms are associated with a `bookmark`
ATOM_BOOKMARK_MAP * | getAtomBookmarks ()
| returns a pointer to all of our atom `bookmarks`
void | setBondBookmark (Bond *bond, int mark)
| associates a Bond pointer with a bookmark
Bond * | getBondWithBookmark (int mark)
| returns the first Bond associated with the `bookmark` provided
Bond * | getUniqueBondWithBookmark (int mark)
BOND_PTR_LIST & | getAllBondsWithBookmark (int mark)
| returns all bonds associated with the `bookmark` provided
void | clearBondBookmark (int mark)
| removes a `bookmark` from our collection
void | clearBondBookmark (int mark, const Bond *bond)
| removes a particular Bond from the list associated with the `bookmark`
void | clearAllBondBookmarks ()
| blows out all bond `bookmarks`
bool | hasBondBookmark (int mark) const
| queries whether or not any bonds are associated with a `bookmark`
BOND_BOOKMARK_MAP * | getBondBookmarks ()
| returns a pointer to all of our bond `bookmarks`
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.
void | clearConformers ()
| Clear all the conformations on the molecule.
unsigned int | addConformer (Conformer *conf, bool assignId=false)
| Add a new conformation to the molecule.
unsigned int | getNumConformers () const
Topology
RingInfo * | getRingInfo () const
ADJ_ITER_PAIR | getAtomNeighbors (Atom const *at) const
| provides access to all neighbors around an Atom
OBOND_ITER_PAIR | getAtomBonds (Atom const *at) const
| provides access to all Bond objects connected to an Atom
ATOM_ITER_PAIR | getVertices ()
| returns an iterator pair for looping over all Atoms
BOND_ITER_PAIR | getEdges ()
| returns an iterator pair for looping over all Bonds
ATOM_ITER_PAIR | getVertices () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BOND_ITER_PAIR | getEdges () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
MolGraph const & | getTopology () const
| brief returns a pointer to our underlying BGL object
Iterators
AtomIterator | beginAtoms ()
| get an AtomIterator pointing at our first Atom
ConstAtomIterator | beginAtoms () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AtomIterator | endAtoms ()
| get an AtomIterator pointing at the end of our Atoms
ConstAtomIterator | endAtoms () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BondIterator | beginBonds ()
| get a BondIterator pointing at our first Bond
ConstBondIterator | beginBonds () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BondIterator | endBonds ()
| get a BondIterator pointing at the end of our Bonds
ConstBondIterator | endBonds () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AromaticAtomIterator | beginAromaticAtoms ()
| get an AtomIterator pointing at our first aromatic Atom
ConstAromaticAtomIterator | beginAromaticAtoms () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AromaticAtomIterator | endAromaticAtoms ()
| get an AtomIterator pointing at the end of our Atoms
ConstAromaticAtomIterator | endAromaticAtoms () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
HeteroatomIterator | beginHeteros ()
| get an AtomIterator pointing at our first hetero Atom
ConstHeteroatomIterator | beginHeteros () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
HeteroatomIterator | endHeteros ()
| get an AtomIterator pointing at the end of our Atoms
ConstHeteroatomIterator | endHeteros () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool | hasQuery () const
| if the Mol has any Query atoms or bonds
QueryAtomIterator | beginQueryAtoms (QueryAtom const *query)
| get an AtomIterator pointing at our first Atom that matches `query`
ConstQueryAtomIterator | 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.
QueryAtomIterator | endQueryAtoms ()
| get an AtomIterator pointing at the end of our Atoms
ConstQueryAtomIterator | endQueryAtoms () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
MatchingAtomIterator | beginMatchingAtoms (bool(*query)(Atom *))
| get an AtomIterator pointing at our first Atom that matches `query`
ConstMatchingAtomIterator | beginMatchingAtoms (bool(*query)(const Atom *)) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
MatchingAtomIterator | endMatchingAtoms ()
| get an AtomIterator pointing at the end of our Atoms
ConstMatchingAtomIterator | endMatchingAtoms () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
ConformerIterator | beginConformers ()
ConformerIterator | endConformers ()
ConstConformerIterator | beginConformers () const
ConstConformerIterator | endConformers () const
Properties
void | clearComputedProps (bool includeRings=true) const
| clears all of our `computed` `properties`
void | updatePropertyCache (bool strict=true)
| calculates any of our lazy `properties`
bool | needsUpdatePropertyCache () const
void | clearPropertyCache ()
Misc
sends some debugging info to a stream
void | debugMol (std::ostream &str) const
Public Member Functions inherited from RDKit::RDProps
| RDProps ()
| RDProps (const RDProps &rhs)
RDProps & | operator= (const RDProps &rhs)
| RDProps (RDProps &&o) noexcept=default
RDProps & | operator= (RDProps &&rhs) noexcept=default
void | clear ()
const Dict & | getDict () const
| gets the underlying Dictionary
Dict & | getDict ()
STR_VECT | getPropList (bool includePrivate=true, bool includeComputed=true) const
| returns a list with the names of our `properties`
template<typename T>
void | setProp (const std::string &key, T val, bool computed=false) const
| sets a `property` value
template<typename T>
void | getProp (const std::string &key, T &res) const
| allows retrieval of a particular property value
template<typename T>
T | getProp (const std::string &key) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
bool | getPropIfPresent (const std::string &key, T &res) const
bool | hasProp (const std::string &key) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void | clearProp (const std::string &key) const
| clears the value of a `property`
void | clearComputedProps () const
| clears all of our `computed` `properties`
void | updateProps (const RDProps &source, bool preserveExisting=false)
| update the properties from another

## Protected Attributes
unsigned int | numBonds {0}
Protected Attributes inherited from RDKit::RDProps
Dict | d_props

## Friends
class | MolPickler
class | RWMol
RDKIT_GRAPHMOL_EXPORT std::vector< SubstanceGroup > & | getSubstanceGroups (ROMol &mol)
RDKIT_GRAPHMOL_EXPORT const std::vector< SubstanceGroup > & | getSubstanceGroups (const ROMol &mol)

## Detailed Description

Definition at line 199 of file ROMol.h.

## Constructor & Destructor Documentation

## ◆ ROMol() [1/5]

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

Definition at line 322 of file ROMol.h.

References RDKit::RDProps::RDProps().

Referenced by getSubstanceGroups, getSubstanceGroups, RDKit::RWMol::insertMol(), operator=(), operator=(), ROMol(), ROMol(), RWMol, RDKit::RWMol::RWMol(), RDKit::RWMol::RWMol(), RDKit::RWMol::RWMol(), and RDKit::RWMol::RWMol().

## ◆ ROMol() [2/5]

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 335 of file ROMol.h.

References numBonds, rdcast, RDKit::RDProps::RDProps(), and ROMol().

## ◆ ROMol() [3/5]

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

construct a molecule from a pickle string

## ◆ ROMol() [4/5]

RDKit::ROMol::ROMol | ( | const std::string & | binStr,
|  | unsigned int | propertyFlags )

construct a molecule from a pickle string

## ◆ ROMol() [5/5]

RDKit::ROMol::ROMol | ( | ROMol && | o | ) |
| inlinenoexcept

Definition at line 346 of file ROMol.h.

References atoms(), bonds(), numBonds, RDKit::RDProps::RDProps(), and ROMol().

## ◆ ~ROMol()

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

Definition at line 414 of file ROMol.h.

## 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 conformation if true otherwise it is assumed that the conformation already has an (unique) ID set

## ◆ atomBonds() [1/2]

CXXBondIterator< MolGraph, Bond *, MolGraph::out_edge_iterator > RDKit::ROMol::atomBonds | ( | Atom const * | at | ) |
| inline

Definition at line 301 of file ROMol.h.

References getAtomBonds().

## ◆ atomBonds() [2/2]

CXXBondIterator< const MolGraph, Bond *const, MolGraph::out_edge_iterator > RDKit::ROMol::atomBonds | ( | Atom const * | at | ) | const
| inline

Definition at line 296 of file ROMol.h.

References getAtomBonds().

## ◆ atomNeighbors() [1/2]

CXXAtomIterator< MolGraph, Atom *, MolGraph::adjacency_iterator > RDKit::ROMol::atomNeighbors | ( | Atom const * | at | ) |
| inline

Definition at line 289 of file ROMol.h.

References getAtomNeighbors().

## ◆ atomNeighbors() [2/2]

CXXAtomIterator< const MolGraph, Atom *const, MolGraph::adjacency_iterator > RDKit::ROMol::atomNeighbors | ( | Atom const * | at | ) | const
| inline

Definition at line 284 of file ROMol.h.

References getAtomNeighbors().

## ◆ atoms() [1/2]

CXXAtomIterator< MolGraph, Atom * > RDKit::ROMol::atoms | ( |  | ) |
| inline

C++11 Range iterator.

Usage

for(auto atom : mol.atoms()) {
atom->getIdx();
};

Definition at line 277 of file ROMol.h.

Referenced by RDKit::MolDraw2D_detail::addAtomIndices(), RDKit::FileParserUtils::createAtomBoolPropertyList(), RDKit::FileParserUtils::createAtomDoublePropertyList(), RDKit::FileParserUtils::createAtomIntPropertyList(), RDKit::FileParserUtils::createAtomStringPropertyList(), RDKit::FileParserUtils::getAtomPropertyList(), operator=(), and ROMol().

## ◆ atoms() [2/2]

CXXAtomIterator< const MolGraph, Atom *const > RDKit::ROMol::atoms | ( |  | ) | const
| inline

Definition at line 279 of file ROMol.h.

## ◆ beginAromaticAtoms() [1/2]

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

get an AtomIterator pointing at our first aromatic Atom

## ◆ 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

## ◆ 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

## ◆ 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 743 of file ROMol.h.

Referenced by RDKit::ForceFieldsHelper::detail::OptimizeMoleculeConfsST().

## ◆ beginConformers() [2/2]

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

Definition at line 747 of file ROMol.h.

## ◆ beginHeteros() [1/2]

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

get an AtomIterator pointing at our first hetero Atom

## ◆ 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(* | query )(Atom *) | ) |

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

## ◆ beginMatchingAtoms() [2/2]

ConstMatchingAtomIterator RDKit::ROMol::beginMatchingAtoms | ( | bool(* | query )(const Atom *) | ) | 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]

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.

## ◆ beginQueryAtoms() [2/2]

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

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

## ◆ bonds() [1/2]

CXXBondIterator< MolGraph, Bond * > RDKit::ROMol::bonds | ( |  | ) |
| inline

Usage

for(auto bond : mol.bonds()) {
bond->getIdx();
};

Definition at line 316 of file ROMol.h.

Referenced by RDKit::MolDraw2D_detail::addBondIndices(), RDKit::FileParserUtils::createBondBoolPropertyList(), RDKit::FileParserUtils::createBondDoublePropertyList(), RDKit::FileParserUtils::createBondIntPropertyList(), RDKit::FileParserUtils::createBondStringPropertyList(), operator=(), and ROMol().

## ◆ bonds() [2/2]

CXXBondIterator< const MolGraph, Bond *const > RDKit::ROMol::bonds | ( |  | ) | const
| inline

Definition at line 318 of file ROMol.h.

## ◆ clearAllAtomBookmarks()

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

blows out all atomic `bookmarks`

Definition at line 508 of file ROMol.h.

## ◆ clearAllBondBookmarks()

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

blows out all bond `bookmarks`

Definition at line 531 of file ROMol.h.

## ◆ clearAtomBookmark() [1/2]

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

removes a `bookmark` from our collection

## ◆ clearAtomBookmark() [2/2]

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

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

## ◆ clearBondBookmark() [1/2]

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

removes a `bookmark` from our collection

## ◆ clearBondBookmark() [2/2]

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

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

## ◆ clearComputedProps()

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

clears all of our `computed` `properties`

## ◆ clearConformers()

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

Clear all the conformations on the molecule.

Definition at line 554 of file ROMol.h.

## ◆ clearPropertyCache()

void RDKit::ROMol::clearPropertyCache | ( |  | ) |

## ◆ debugMol()

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

## ◆ endAromaticAtoms() [1/2]

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

get an AtomIterator pointing at the end of our Atoms

## ◆ 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

## ◆ 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

## ◆ 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 745 of file ROMol.h.

Referenced by RDKit::ForceFieldsHelper::detail::OptimizeMoleculeConfsST().

## ◆ endConformers() [2/2]

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

Definition at line 751 of file ROMol.h.

## ◆ endHeteros() [1/2]

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

get an AtomIterator pointing at the end of our Atoms

## ◆ 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

## ◆ 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

## ◆ 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

## ◆ getAllBondsWithBookmark()

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

returns all bonds associated with the `bookmark` provided

## ◆ 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

... mol is a const ROMol & ...
... atomPtr is a const Atom * ...
... requires #include <boost/range/iterator_range.hpp>
for (const auto &nbri :
boost::make_iterator_range(m.getAtomBonds(atomPtr))) {
const auto &nbr = (*m)[nbri];
// nbr is a bond pointer
}
RDKit::Atom
The class for representing atoms.
Definition Atom.h:74
RDKit::ROMol::ROMol
ROMol()
Definition ROMol.h:322
boost
Definition RDLog.h:24

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

... mol is a const ROMol & ...
... atomPtr is a const Atom * ...
... requires #include <boost/range/iterator_range.hpp>
for (const auto &nbri :
boost::make_iterator_range(m.getAtomBonds(atomPtr))) {
auto nbr = (*m)[nbri];
// nbr is a bond pointer
}

Referenced by atomBonds(), atomBonds(), 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 512 of file ROMol.h.

Referenced by RDKit::SLNParse::addBranchToMol().

## ◆ getAtomDegree()

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

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

## ◆ getAtomNeighbors()

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

... mol is a const ROMol & ...
... atomPtr is a const Atom * ...
... requires #include <boost/range/iterator_range.hpp>
for (const auto &nbri :
boost::make_iterator_range(m.getAtomNeighbors(atomPtr))) {
const auto &nbr = (*m)[nbri];
// nbr is an atom pointer
}

Referenced by atomNeighbors(), atomNeighbors(), RDKit::queryAtomHasAliphaticHeteroatomNbrs(), RDKit::queryAtomHasHeteroatomNbrs(), RDKit::queryAtomHeavyAtomDegree(), RDKit::queryAtomNonHydrogenDegree(), RDKit::queryAtomNumAliphaticHeteroatomNbrs(), and RDKit::queryAtomNumHeteroatomNbrs().

## ◆ getAtomWithBookmark()

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

returns the first Atom associated with the `bookmark` provided

Referenced by RDKit::SLNParse::closeRingBond().

## ◆ getAtomWithIdx() [1/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 433 of file ROMol.h.

References getAtomWithIdx(), and rdcast.

## ◆ getAtomWithIdx() [2/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 438 of file ROMol.h.

References getAtomWithIdx(), and rdcast.

## ◆ getAtomWithIdx() [3/4]

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

returns a pointer to a particular Atom

Referenced by RDKit::SLNParse::addBranchToMol(), RDKit::FileParserUtils::applyMolListPropsToAtoms(), RDKit::FileParserUtils::applyMolListPropToAtoms(), getAtomWithIdx(), getAtomWithIdx(), RDKit::RWMol::getLastAtom(), and RDKit::FileParserUtils::processMolPropertyList().

## ◆ getAtomWithIdx() [4/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.

## ◆ getBondBetweenAtoms() [1/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 470 of file ROMol.h.

References getBondBetweenAtoms(), and rdcast.

## ◆ getBondBetweenAtoms() [2/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 476 of file ROMol.h.

References getBondBetweenAtoms(), and rdcast.

## ◆ getBondBetweenAtoms() [3/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(), getBondBetweenAtoms(), and RDKit::MolEnumerator::utils::getMolLinkNodes().

## ◆ getBondBetweenAtoms() [4/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.

## ◆ getBondBookmarks()

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

returns a pointer to all of our bond `bookmarks`

Definition at line 535 of file ROMol.h.

Referenced by RDKit::SLNParse::addBranchToMol().

## ◆ getBondWithBookmark()

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

returns the first Bond associated with the `bookmark` provided

## ◆ getBondWithIdx() [1/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 456 of file ROMol.h.

References getBondWithIdx(), and rdcast.

## ◆ getBondWithIdx() [2/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 461 of file ROMol.h.

References getBondWithIdx(), and rdcast.

## ◆ getBondWithIdx() [3/4]

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

returns a pointer to a particular Bond

Referenced by getBondWithIdx(), getBondWithIdx(), and RDKit::FileParserUtils::processMolPropertyList().

## ◆ getBondWithIdx() [4/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.

## ◆ getConformer() [1/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

## ◆ getConformer() [2/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::ForceFieldsHelper::createEmptyForceFieldForMol().

## ◆ 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;
}
RDKit::Bond
class for representing a bond
Definition Bond.h:46

## ◆ 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() [1/2]

unsigned int RDKit::ROMol::getNumAtoms | ( |  | ) | const
| inline

returns our number of atoms

Definition at line 421 of file ROMol.h.

References rdcast.

Referenced by RDKit::SLNParse::addBranchToMol(), RDKit::FileParserUtils::applyMolListPropsToAtoms(), RDKit::FileParserUtils::applyMolListPropToAtoms(), RDKit::Canon::BreakTies(), RDKit::RWMol::getLastAtom(), RDKit::ForceFieldsHelper::detail::OptimizeMoleculeConfsST(), RDKit::FileParserUtils::processMolPropertyList(), and RDKit::Canon::RefinePartitions().

## ◆ getNumAtoms() [2/2]

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

## ◆ getNumBonds()

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

returns our number of Bonds

Referenced by RDKit::FileParserUtils::getV3000CTAB(), and RDKit::FileParserUtils::processMolPropertyList().

## ◆ getNumConformers()

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

Definition at line 568 of file ROMol.h.

References rdcast.

Referenced by RDKit::MMFF::MMFFOptimizeMoleculeConfs(), RDKit::ForceFieldsHelper::OptimizeMoleculeConfs(), and RDKit::ForceFieldsHelper::detail::OptimizeMoleculeConfsST().

## ◆ getNumHeavyAtoms()

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

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

## ◆ getRingInfo()

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

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

Definition at line 577 of file ROMol.h.

Referenced by RDKit::queryAtomHasRingBond(), RDKit::queryAtomIsInRingOfSize(), RDKit::queryAtomMinRingSize(), RDKit::queryAtomRingBondCount(), RDKit::queryBondIsInRingOfSize(), RDKit::queryBondMinRingSize(), RDKit::queryIsAtomInNRings(), RDKit::queryIsAtomInRing(), RDKit::queryIsBondInNRings(), and RDKit::queryIsBondInRing().

## ◆ getStereoGroups()

const std::vector< StereoGroup > & RDKit::ROMol::getStereoGroups | ( |  | ) | const
| inline

Gets a reference to the groups of atoms with relative stereochemistry.

Stereo groups are also called enhanced stereochemistry in the SDF/Mol3000 file format.

Definition at line 791 of file ROMol.h.

## ◆ 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]);
RDKit::INT_VECT
std::vector< int > INT_VECT
Definition types.h:303
RDKit::MolGraph
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, Atom *, Bond * > MolGraph
This is the BGL type used to store the topology:
Definition ROMol.h:55

Definition at line 680 of file ROMol.h.

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

## ◆ getUniqueAtomWithBookmark()

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

returns the Atom associated with the `bookmark` provided a check is made to ensure it is the only atom with that bookmark

## ◆ getUniqueBondWithBookmark()

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

returns the Bond associated with the `bookmark` provided a check is made to ensure it is the only bond with that bookmark

## ◆ 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;
}

## ◆ 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 510 of file ROMol.h.

Referenced by RDKit::SLNParse::addBranchToMol(), and RDKit::SLNParse::closeRingBond().

## ◆ hasBondBookmark()

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

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

Definition at line 533 of file ROMol.h.

Referenced by RDKit::SLNParse::addBranchToMol().

## ◆ hasQuery()

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

if the Mol has any Query atoms or bonds

## ◆ needsUpdatePropertyCache()

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

## ◆ operator=() [1/2]

ROMol & RDKit::ROMol::operator= | ( | const ROMol & |  | ) |
| delete

References ROMol().

## ◆ operator=() [2/2]

ROMol & RDKit::ROMol::operator= | ( | ROMol && | o | ) |
| inlinenoexcept

Definition at line 373 of file ROMol.h.

References atoms(), bonds(), numBonds, RDKit::RDProps::operator=(), and ROMol().

Referenced by RDKit::RWMol::operator=().

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

Bond * RDKit::ROMol::operator[] | ( | const edge_descriptor & | e | ) |
| inline

Definition at line 783 of file ROMol.h.

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

const Bond * RDKit::ROMol::operator[] | ( | const edge_descriptor & | e | ) | const
| inline

Definition at line 784 of file ROMol.h.

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

Atom * RDKit::ROMol::operator[] | ( | const vertex_descriptor & | v | ) |
| inline

Definition at line 778 of file ROMol.h.

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

const Atom * RDKit::ROMol::operator[] | ( | const vertex_descriptor & | v | ) | const
| inline

Definition at line 779 of file ROMol.h.

## ◆ removeConformer()

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

Delete the conformation with the specified ID.

## ◆ replaceAtomBookmark()

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

associates an Atom pointer with a bookmark

Definition at line 491 of file ROMol.h.

## ◆ setAtomBookmark()

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

associates an Atom pointer with a bookmark

Definition at line 487 of file ROMol.h.

Referenced by RDKit::SLNParse::addBranchToMol().

## ◆ setBondBookmark()

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

associates a Bond pointer with a bookmark

Definition at line 515 of file ROMol.h.

Referenced by RDKit::SLNParse::addBranchToMol(), and RDKit::SLNParse::closeRingBond().

## ◆ setStereoGroups()

void RDKit::ROMol::setStereoGroups | ( | std::vector< StereoGroup > | stereo_groups | ) |

Sets groups of atoms with relative stereochemistry.

Parameters

  stereo_groups | the new set of stereo groups. All will be replaced.

Stereo groups are also called enhanced stereochemistry in the SDF/Mol3000 file format. stereo_groups should be std::move()ed into this function.

## ◆ 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

## Friends And Related Symbol Documentation

## ◆ getSubstanceGroups [1/2]

RDKIT_GRAPHMOL_EXPORT const std::vector< SubstanceGroup > & getSubstanceGroups | ( | const ROMol & | mol | ) |
| friend

References ROMol().

## ◆ getSubstanceGroups [2/2]

RDKIT_GRAPHMOL_EXPORT std::vector< SubstanceGroup > & getSubstanceGroups | ( | ROMol & | mol | ) |
| friend

References RDKIT_GRAPHMOL_EXPORT, and ROMol().

## ◆ MolPickler

friend class MolPickler
| friend

Definition at line 201 of file ROMol.h.

References MolPickler.

Referenced by MolPickler.

## ◆ RWMol

friend class RWMol
| friend

Definition at line 202 of file ROMol.h.

References ROMol(), and RWMol.

Referenced by RWMol.

## Member Data Documentation

## ◆ numBonds

unsigned int RDKit::ROMol::numBonds {0}
| protected

Definition at line 833 of file ROMol.h.

Referenced by RDKit::RWMol::clear(), operator=(), ROMol(), and ROMol().

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

- ROMol.h