RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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::BBS & getReagents () const
 Return the reagents used in the library.
std::vector< MOL_SPTR_VECT > next () override
 Get the next product set.
void toStream (std::ostream &ss) const override
 serializes (pickles) to a stream
void initFromStream (std::istream &ss) override
 initializes from a stream pickle
Public Member Functions inherited from RDKit::EnumerateLibraryBase
 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< 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 std::string Serialize () const
 returns a string with a serialized (pickled) representation
virtual void initFromString (const std::string &text)
 initializes from a string pickle

Additional Inherited Members

Protected Attributes inherited from RDKit::EnumerateLibraryBase
ChemicalReaction m_rxn
boost::shared_ptr< EnumerationStrategyBase > m_enumerator
boost::shared_ptr< EnumerationStrategyBase > m_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 111 of file Enumerate.h.

Constructor & Destructor Documentation

◆ EnumerateLibrary() [1/5]

RDKit::EnumerateLibrary::EnumerateLibrary ( )
inline

Definition at line 116 of file Enumerate.h.

References RDKit::EnumerateLibraryBase::EnumerateLibraryBase().

Referenced by EnumerateLibrary().

◆ EnumerateLibrary() [2/5]

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

◆ EnumerateLibrary() [3/5]

RDKit::EnumerateLibrary::EnumerateLibrary ( const ChemicalReaction & rxn,
const EnumerationTypes::BBS & reagents,
const EnumerationParams & params = EnumerationParams() )

◆ EnumerateLibrary() [4/5]

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

◆ EnumerateLibrary() [5/5]

RDKit::EnumerateLibrary::EnumerateLibrary ( const EnumerateLibrary & rhs)

References EnumerateLibrary().

Member Function Documentation

◆ getReagents()

const EnumerationTypes::BBS & RDKit::EnumerateLibrary::getReagents ( ) const
inline

Return the reagents used in the library.

Definition at line 131 of file Enumerate.h.

◆ initFromStream()

void RDKit::EnumerateLibrary::initFromStream ( std::istream & ss)
overridevirtual

initializes from a stream pickle

Implements RDKit::EnumerateLibraryBase.

References RDKit::MolPickler::pickleMol().

◆ next()

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

Get the next product set.

Implements RDKit::EnumerateLibraryBase.

◆ toStream()

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

serializes (pickles) to a stream

Implements RDKit::EnumerateLibraryBase.


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