RDKit
Open-source cheminformatics and machine learning.
RDKit::EnumerateLibrary Class Reference

This is a class for running reactions on sets of reagents. More...

#include <Enumerate.h>

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

Public Member Functions

 EnumerateLibrary ()
 
 EnumerateLibrary (const std::string &s)
 
 EnumerateLibrary (const ChemicalReaction &rxn, const EnumerationTypes::BBS &reagents, const EnumerationParams &params=EnumerationParams())
 
 EnumerateLibrary (const ChemicalReaction &rxn, const EnumerationTypes::BBS &reagents, const EnumerationStrategyBase &enumerator, const EnumerationParams &params=EnumerationParams())
 
 EnumerateLibrary (const EnumerateLibrary &rhs)
 
const EnumerationTypes::BBSgetReagents () const
 Return the reagents used in the library. More...
 
std::vector< MOL_SPTR_VECTnext ()
 Get the next product set. More...
 
void toStream (std::ostream &ss) const
 serializes (pickles) to a stream More...
 
void initFromStream (std::istream &ss)
 initializes from a stream pickle More...
 
- Public Member Functions inherited from RDKit::EnumerateLibraryBase
 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< 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 std::string Serialize () const
 returns a string with a serialized (pickled) representation More...
 
virtual void initFromString (const std::string &text)
 initializes from a string pickle More...
 

Additional Inherited Members

- Protected Attributes inherited from RDKit::EnumerateLibraryBase
ChemicalReaction m_rxn
 
boost::shared_ptr< EnumerationStrategyBasem_enumerator
 
boost::shared_ptr< EnumerationStrategyBasem_initialEnumerator
 

Detailed Description

This is a class for running reactions on sets of reagents.

This class is a fully self contained reaction engine that can be serialized and restarted. For example, a million products can be generated, the engine can be saved for later and reloaded to retrieve the next million products.

basic usage will be something like:

 ChemicalReaction rxn = ...
 BBS bbs(num_rgroups);
 ... somehow LoadRGroups(bbs[0]);
 ... somehow LoadRGroups(bbs[1]..);
 ...
 EnumerateLibrary enumerator(en, bbs);
 for(; (bool)en; ++i) {
   // This is the same as rxn.run_Reactants( reagents );
   std::vector<MOL_SPTR_VECT> products = en.next();
   ...
 }

In general, reactions will enumerate to more products than desired, a standard use is:

 for(int i=0;i<num_samples && (bool)en; ++i) {
   std::vector<MOL_SPTR_VECT> products = en.next();
   ...
 }

Definition at line 118 of file Enumerate.h.

Constructor & Destructor Documentation

RDKit::EnumerateLibrary::EnumerateLibrary ( )
inline

Definition at line 122 of file Enumerate.h.

RDKit::EnumerateLibrary::EnumerateLibrary ( const std::string &  s)
inline

Definition at line 123 of file Enumerate.h.

References RDKit::EnumerationParams::EnumerationParams().

RDKit::EnumerateLibrary::EnumerateLibrary ( const ChemicalReaction rxn,
const EnumerationTypes::BBS reagents,
const EnumerationParams params = EnumerationParams() 
)
RDKit::EnumerateLibrary::EnumerateLibrary ( const ChemicalReaction rxn,
const EnumerationTypes::BBS reagents,
const EnumerationStrategyBase enumerator,
const EnumerationParams params = EnumerationParams() 
)
RDKit::EnumerateLibrary::EnumerateLibrary ( const EnumerateLibrary rhs)

Member Function Documentation

const EnumerationTypes::BBS& RDKit::EnumerateLibrary::getReagents ( ) const
inline
void RDKit::EnumerateLibrary::initFromStream ( std::istream &  ss)
virtual

initializes from a stream pickle

Implements RDKit::EnumerateLibraryBase.

std::vector<MOL_SPTR_VECT> RDKit::EnumerateLibrary::next ( )
virtual

Get the next product set.

Implements RDKit::EnumerateLibraryBase.

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

serializes (pickles) to a stream

Implements RDKit::EnumerateLibraryBase.


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