RDKit::ResonanceMolSupplier Class Reference

`#include <Resonance.h>`

## Public Types

enum | ResonanceFlags { ALLOW_INCOMPLETE_OCTETS = (1 << 0) , ALLOW_CHARGE_SEPARATION = (1 << 1) , KEKULE_ALL = (1 << 2) , UNCONSTRAINED_CATIONS = (1 << 3) , UNCONSTRAINED_ANIONS = (1 << 4) }

## Public Member Functions

| ResonanceMolSupplier (ROMol &mol, unsigned int flags=0, unsigned int maxStructs=1000)
| ~ResonanceMolSupplier ()
const ROMol & | mol () const
unsigned int | flags () const
unsigned int | getNumConjGrps () const
int | getBondConjGrpIdx (unsigned int bi) const
int | getAtomConjGrpIdx (unsigned int ai) const
void | setNumThreads (int numThreads=1)
void | setProgressCallback (ResonanceMolSupplierCallback *callback)
ResonanceMolSupplierCallback * | getProgressCallback () const
bool | wasCanceled () const
void | enumerate ()
bool | getIsEnumerated ()
unsigned int | length ()
void | reset ()
bool | atEnd ()
ROMol * | next ()
void | moveTo (unsigned int idx)
ROMol * | operator[] (unsigned int idx)

## Detailed Description

Definition at line 86 of file Resonance.h.

## Member Enumeration Documentation

## ResonanceFlags

enum RDKit::ResonanceMolSupplier::ResonanceFlags

Enumerator
ALLOW_INCOMPLETE_OCTETS | include resonance structures whose octets are less complete than the most octet-complete structure
ALLOW_CHARGE_SEPARATION | include resonance structures featuring charge separation also when uncharged resonance structures exist
KEKULE_ALL | enumerate all possible degenerate Kekule resonance structures (the default is to include just one)
UNCONSTRAINED_CATIONS | if the UNCONSTRAINED_CATIONS flag is not set, positively charged atoms left and right of N with an incomplete octet are acceptable only if the conjugated group has a positive total formal charge. UNCONSTRAINED_CATIONS implies ALLOW_INCOMPLETE_OCTETS and ALLOW_CHARGE_SEPARATION.
UNCONSTRAINED_ANIONS | if the UNCONSTRAINED_ANIONS flag is not set, negatively charged atoms left of N are acceptable only if the conjugated group has a negative total formal charge. UNCONSTRAINED_ANIONS implies ALLOW_CHARGE_SEPARATION.

Definition at line 88 of file Resonance.h.

## Constructor & Destructor Documentation

## ResonanceMolSupplier()

RDKit::ResonanceMolSupplier::ResonanceMolSupplier | ( | ROMol & | mol,
|  | unsigned int | flags = `0`,
|  | unsigned int | maxStructs = `1000`
| ) |  |

Parameters

  mol | - the starter molecule
  flags | - flags which influence criteria to generate resonance structures
  maxStructs | - maximum number of complete resonance structures generated
  numThreads | - the number of threads used to carry out the resonance structure enumeration (defaults to 1; 0 selects the number of concurrent threads supported by the hardware; negative values are added to the number of concurrent threads supported by the hardware)

## ~ResonanceMolSupplier()

RDKit::ResonanceMolSupplier::~ResonanceMolSupplier | ( |  | ) |

## Member Function Documentation

## atEnd()

bool RDKit::ResonanceMolSupplier::atEnd | ( |  | ) |

Returns true if there are no more resonance structures left

## enumerate()

void RDKit::ResonanceMolSupplier::enumerate | ( |  | ) |

Ask ResonanceMolSupplier to enumerate resonance structures (automatically done as soon as any attempt to access them is made)

## flags()

unsigned int RDKit::ResonanceMolSupplier::flags | ( |  | ) | const

inline

Returns the flags the ResonanceMolSupplier was initialized with

Definition at line 135 of file Resonance.h.

## getAtomConjGrpIdx()

int RDKit::ResonanceMolSupplier::getAtomConjGrpIdx | ( | unsigned int | ai | ) | const

Given an atom index, it returns the index of the conjugated group the atom belongs to, or -1 if it is not conjugated

## getBondConjGrpIdx()

int RDKit::ResonanceMolSupplier::getBondConjGrpIdx | ( | unsigned int | bi | ) | const

Given a bond index, it returns the index of the conjugated group the bond belongs to, or -1 if it is not conjugated

## getIsEnumerated()

bool RDKit::ResonanceMolSupplier::getIsEnumerated | ( |  | ) |

inline

Returns true if resonance structure enumeration has already happened

Definition at line 175 of file Resonance.h.

## getNumConjGrps()

unsigned int RDKit::ResonanceMolSupplier::getNumConjGrps | ( |  | ) | const

inline

Returns the number of individual conjugated groups in the molecule

Definition at line 138 of file Resonance.h.

## getProgressCallback()

ResonanceMolSupplierCallback* RDKit::ResonanceMolSupplier::getProgressCallback | ( |  | ) | const

inline

Get the pointer to the ResonanceMolSupplierCallback subclass instance (do not delete it, has the ResonanceMolSupplier takes ownership of the pointer), or nullptr if none was set.

Definition at line 161 of file Resonance.h.

## length()

unsigned int RDKit::ResonanceMolSupplier::length | ( |  | ) |

Returns the number of resonance structures in the ResonanceMolSupplier

## mol()

const ROMol& RDKit::ResonanceMolSupplier::mol | ( |  | ) | const

inline

Returns a reference to the Kekulized form of the ROMol the ResonanceMolSupplier was initialized with

Definition at line 132 of file Resonance.h.

## moveTo()

void RDKit::ResonanceMolSupplier::moveTo | ( | unsigned int | idx | ) |

Sets the ResonanceMolSupplier index to idx

## next()

ROMol* RDKit::ResonanceMolSupplier::next | ( |  | ) |

Returns a pointer to the next resonance structure as a ROMol, or NULL if there are no more resonance structures left. The caller is responsible for freeing memory associated to the pointer

## operator[]()

ROMol* RDKit::ResonanceMolSupplier::operator[] | ( | unsigned int | idx | ) |

Returns a pointer to the resonance structure with index idx as a ROMol. The index generates complete resonance structures by combining ConjElectrons objects for the respective conjugated groups in a breadth-first fashion, in order to return the most stable complete resonance structures first. The caller is responsible for freeing memory associated to the pointer

## reset()

void RDKit::ResonanceMolSupplier::reset | ( |  | ) |

Resets the ResonanceMolSupplier index

## setNumThreads()

void RDKit::ResonanceMolSupplier::setNumThreads | ( | int | numThreads = `1` | ) |

Sets the number of threads to be used to enumerate resonance structures (defaults to 1; 0 selects the number of concurrent threads supported by the hardware; negative values are added to the number of concurrent threads supported by the hardware)

## setProgressCallback()

void RDKit::ResonanceMolSupplier::setProgressCallback | ( | ResonanceMolSupplierCallback * | callback | ) |

Pass a pointer to an instance of a class derived from ResonanceMolSupplierCallback, which must implement the callback() method. The ResonanceMolSupplier takes ownership of the pointer, which must not be deleted.

## wasCanceled()

bool RDKit::ResonanceMolSupplier::wasCanceled | ( |  | ) | const

inline

Returns true if the resonance structure generation was canceled before completion due to the ResMolSupplierProgressCallback having returned false.

Definition at line 168 of file Resonance.h.

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

- Resonance.h