RDKit
Open-source cheminformatics and machine learning.
RDKit::EnumerateLibraryBase Class Referenceabstract

Base class for enumerating chemical reactions from collections of. More...

#include <EnumerateBase.h>

Inheritance diagram for RDKit::EnumerateLibraryBase:
RDKit::EnumerateLibrary

Public Member Functions

 EnumerateLibraryBase ()
 default constructor More...
 
 EnumerateLibraryBase (const ChemicalReaction &rxn, EnumerationStrategyBase *enumerator=0)
 construct with a chemical reaction and an enumeration strategy More...
 
 EnumerateLibraryBase (const EnumerateLibraryBase &rhs)
 Copy constructor. More...
 
virtual ~EnumerateLibraryBase ()
 
virtual operator bool () const
 Are there any enumerations left? More...
 
void reset ()
 reset the enumeration to the beginning. More...
 
const ChemicalReactiongetReaction () const
 returns the underlying chemical reaction More...
 
const EnumerationStrategyBasegetEnumerator ()
 return the current enumeration strategy More...
 
virtual std::vector< MOL_SPTR_VECTnext ()=0
 get the next set of products (See run_Reactants) for details More...
 
virtual std::vector< std::vector< std::string > > nextSmiles ()
 get the next set of products as smiles More...
 
const EnumerationTypes::RGROUPSgetPosition () const
 Get the current position into the reagent vectors. More...
 
std::string getState () const
 Get the current state of the enumerator. More...
 
void setState (const std::string &)
 Set the current state of the enumerator. More...
 
void resetState ()
 Reset the enumerator to the beginning. More...
 
virtual void toStream (std::ostream &ss) const =0
 serializes (pickles) to a stream More...
 
virtual std::string Serialize () const
 returns a string with a serialized (pickled) representation More...
 
virtual void initFromStream (std::istream &ss)=0
 initializes from a stream pickle More...
 
virtual void initFromString (const std::string &text)
 initializes from a string pickle More...
 

Protected Attributes

ChemicalReaction m_rxn
 
boost::shared_ptr< EnumerationStrategyBasem_enumerator
 
boost::shared_ptr< EnumerationStrategyBasem_initialEnumerator
 

Detailed Description

Base class for enumerating chemical reactions from collections of.

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 62 of file EnumerateBase.h.

Constructor & Destructor Documentation

RDKit::EnumerateLibraryBase::EnumerateLibraryBase ( )
inline

default constructor

Definition at line 69 of file EnumerateBase.h.

RDKit::EnumerateLibraryBase::EnumerateLibraryBase ( const ChemicalReaction rxn,
EnumerationStrategyBase enumerator = 0 
)
inline

construct with a chemical reaction and an enumeration strategy

Definition at line 74 of file EnumerateBase.h.

References RDKit::ChemicalReaction::initReactantMatchers().

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

Copy constructor.

Definition at line 84 of file EnumerateBase.h.

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

Definition at line 89 of file EnumerateBase.h.

Member Function Documentation

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

return the current enumeration strategy

Definition at line 108 of file EnumerateBase.h.

References getPosition(), getState(), m_enumerator, next(), nextSmiles(), PRECONDITION, resetState(), setState(), and toStream().

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

Get the current position into the reagent vectors.

Referenced by getEnumerator().

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

returns the underlying chemical reaction

Definition at line 105 of file EnumerateBase.h.

References m_rxn.

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

Get the current state of the enumerator.

Referenced by getEnumerator().

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

initializes from a stream pickle

Implemented in RDKit::EnumerateLibrary.

Referenced by initFromString(), and Serialize().

virtual void RDKit::EnumerateLibraryBase::initFromString ( const std::string &  text)
inlinevirtual
virtual std::vector<MOL_SPTR_VECT> RDKit::EnumerateLibraryBase::next ( )
pure virtual

get the next set of products (See run_Reactants) for details

Implemented in RDKit::EnumerateLibrary.

Referenced by getEnumerator().

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

get the next set of products as smiles

Referenced by getEnumerator().

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

Are there any enumerations left?

Definition at line 92 of file EnumerateBase.h.

References PRECONDITION.

void RDKit::EnumerateLibraryBase::reset ( )
inline

reset the enumeration to the beginning.

Definition at line 98 of file EnumerateBase.h.

void RDKit::EnumerateLibraryBase::resetState ( )

Reset the enumerator to the beginning.

Referenced by getEnumerator().

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 initFromStream(), and toStream().

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

Set the current state of the enumerator.

Referenced by getEnumerator().

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

serializes (pickles) to a stream

Implemented in RDKit::EnumerateLibrary.

Referenced by getEnumerator(), and Serialize().

Member Data Documentation

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

Definition at line 65 of file EnumerateBase.h.

Referenced by getEnumerator(), and initFromString().

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

Definition at line 66 of file EnumerateBase.h.

ChemicalReaction RDKit::EnumerateLibraryBase::m_rxn
protected

Definition at line 64 of file EnumerateBase.h.

Referenced by getReaction().


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