RDKit: RDKit::EnumerateLibraryBase Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
RDKit::EnumerateLibraryBase Class Referenceabstract

`#include <EnumerateBase.h>`

Inheritance diagram for RDKit::EnumerateLibraryBase:

## Public Member Functions
| EnumerateLibraryBase ()
| default constructor
| EnumerateLibraryBase (const ChemicalReaction &rxn, EnumerationStrategyBase *enumerator=nullptr)
| construct with a chemical reaction and an enumeration strategy
| EnumerateLibraryBase (const EnumerateLibraryBase &rhs)
| Copy constructor.
virtual | ~EnumerateLibraryBase ()
virtual | operator bool () const
| Are there any enumerations left?
void | reset ()
| reset the enumeration to the beginning.
const ChemicalReaction & | getReaction () const
| returns the underlying chemical reaction
const EnumerationStrategyBase & | getEnumerator ()
| return the current enumeration strategy
virtual std::vector< MOL_SPTR_VECT > | next ()=0
virtual std::vector< std::vector< std::string > > | nextSmiles ()
const EnumerationTypes::RGROUPS & | getPosition () const
std::string | getState () const
void | setState (const std::string &)
void | resetState ()
| Reset the enumerator to the beginning.
virtual void | toStream (std::ostream &ss) const =0
| serializes (pickles) to a stream
virtual std::string | Serialize () const
| returns a string with a serialized (pickled) representation
virtual void | initFromStream (std::istream &ss)=0
| initializes from a stream pickle
virtual void | initFromString (const std::string &text)
| initializes from a string pickle

## Protected Attributes
ChemicalReaction | m_rxn
boost::shared_ptr< EnumerationStrategyBase > | m_enumerator
boost::shared_ptr< EnumerationStrategyBase > | m_initialEnumerator

## Detailed Description

Base class for enumerating chemical reactions from collections of building blocks and reagents.

basic usage:

    EnumerateLibraryBase &enumerator;
    while (enumerator) {
      MOL_SPTR_VECT res = enumerator.next();
      // do something with enumeration products here
    }

See Reaction.h for more details on how ChemicalReactions are used.

Definition at line 63 of file EnumerateBase.h.

## Constructor & Destructor Documentation

## ◆ EnumerateLibraryBase() [1/3]

RDKit::EnumerateLibraryBase::EnumerateLibraryBase | ( |  | ) |
| inline

default constructor

Definition at line 71 of file EnumerateBase.h.

References m_enumerator, m_initialEnumerator, and m_rxn.

Referenced by RDKit::EnumerateLibrary::EnumerateLibrary(), RDKit::EnumerateLibrary::EnumerateLibrary(), and EnumerateLibraryBase().

## ◆ EnumerateLibraryBase() [2/3]

RDKit::EnumerateLibraryBase::EnumerateLibraryBase | ( | const ChemicalReaction & | rxn,
|  | EnumerationStrategyBase * | enumerator = nullptr )
| inline

construct with a chemical reaction and an enumeration strategy

Definition at line 74 of file EnumerateBase.h.

References m_enumerator, m_initialEnumerator, and m_rxn.

## ◆ EnumerateLibraryBase() [3/3]

RDKit::EnumerateLibraryBase::EnumerateLibraryBase | ( | const EnumerateLibraryBase & | rhs | ) |
| inline

Copy constructor.

Definition at line 83 of file EnumerateBase.h.

References EnumerateLibraryBase(), m_enumerator, m_initialEnumerator, and m_rxn.

## ◆ ~EnumerateLibraryBase()

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

Definition at line 88 of file EnumerateBase.h.

## Member Function Documentation

## ◆ getEnumerator()

const EnumerationStrategyBase & RDKit::EnumerateLibraryBase::getEnumerator | ( |  | ) |
| inline

return the current enumeration strategy

Definition at line 107 of file EnumerateBase.h.

References m_enumerator, and PRECONDITION.

## ◆ getPosition()

const EnumerationTypes::RGROUPS & RDKit::EnumerateLibraryBase::getPosition | ( |  | ) | const

Get the current position into the reagent vectors as returned by getReagents. It is not necessarily the index into the input reagents as it is only for the reagents compatible with the reaction. Use getState/setState to save/restart the enumeration from this position.

## ◆ getReaction()

const ChemicalReaction & RDKit::EnumerateLibraryBase::getReaction | ( |  | ) | const
| inline

returns the underlying chemical reaction

Definition at line 104 of file EnumerateBase.h.

References m_rxn.

## ◆ getState()

std::string RDKit::EnumerateLibraryBase::getState | ( |  | ) | const

Get the current state of the enumerator This is the position of the enumerator and the enumerators state that can be used to restart enumerating from this position.

## ◆ initFromStream()

virtual void RDKit::EnumerateLibraryBase::initFromStream | ( | std::istream & | ss | ) |
| pure virtual

initializes from a stream pickle

Implemented in RDKit::EnumerateLibrary.

Referenced by initFromString().

## ◆ initFromString()

virtual void RDKit::EnumerateLibraryBase::initFromString | ( | const std::string & | text | ) |
| inlinevirtual

initializes from a string pickle

Definition at line 159 of file EnumerateBase.h.

References initFromStream().

Referenced by RDKit::EnumerateLibrary::EnumerateLibrary().

## ◆ next()

virtual std::vector< MOL_SPTR_VECT > RDKit::EnumerateLibraryBase::next | ( |  | ) |
| pure virtual

get the next set of products (See run_Reactants) for details This returns a vector of a vector of molecules. Each result vector corresponds for a product template. i.e. res = library.next(); res[0] are the results for library.getReaction().getProdcts()[0]

Implemented in RDKit::EnumerateLibrary.

## ◆ nextSmiles()

virtual std::vector< std::vector< std::string > > RDKit::EnumerateLibraryBase::nextSmiles | ( |  | ) |
| virtual

get the next set of products as smiles This returns a vector of a vector strings. Each result vector corresponds for a product template.

## ◆ operator bool()

virtual RDKit::EnumerateLibraryBase::operator bool | ( |  | ) | const
| inlinevirtual

Are there any enumerations left?

Definition at line 91 of file EnumerateBase.h.

References m_enumerator, and PRECONDITION.

## ◆ reset()

void RDKit::EnumerateLibraryBase::reset | ( |  | ) |
| inline

reset the enumeration to the beginning.

Definition at line 97 of file EnumerateBase.h.

References m_enumerator, and m_initialEnumerator.

## ◆ resetState()

void RDKit::EnumerateLibraryBase::resetState | ( |  | ) |

Reset the enumerator to the beginning.

## ◆ Serialize()

virtual std::string RDKit::EnumerateLibraryBase::Serialize | ( |  | ) | const
| inlinevirtual

returns a string with a serialized (pickled) representation

Definition at line 149 of file EnumerateBase.h.

References toStream().

## ◆ setState()

void RDKit::EnumerateLibraryBase::setState | ( | const std::string & |  | ) |

Set the current state of the enumerator Restart the enumerator from this position.

## ◆ toStream()

virtual void RDKit::EnumerateLibraryBase::toStream | ( | std::ostream & | ss | ) | const
| pure virtual

serializes (pickles) to a stream

Implemented in RDKit::EnumerateLibrary.

Referenced by Serialize().

## Member Data Documentation

## ◆ m_enumerator

boost::shared_ptr<EnumerationStrategyBase> RDKit::EnumerateLibraryBase::m_enumerator
| protected

Definition at line 66 of file EnumerateBase.h.

Referenced by EnumerateLibraryBase(), EnumerateLibraryBase(), EnumerateLibraryBase(), getEnumerator(), operator bool(), and reset().

## ◆ m_initialEnumerator

boost::shared_ptr<EnumerationStrategyBase> RDKit::EnumerateLibraryBase::m_initialEnumerator
| protected

Definition at line 67 of file EnumerateBase.h.

Referenced by EnumerateLibraryBase(), EnumerateLibraryBase(), EnumerateLibraryBase(), and reset().

## ◆ m_rxn

ChemicalReaction RDKit::EnumerateLibraryBase::m_rxn
| protected

Definition at line 65 of file EnumerateBase.h.

Referenced by EnumerateLibraryBase(), EnumerateLibraryBase(), EnumerateLibraryBase(), and getReaction().

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

- EnumerateBase.h