![]() |
RDKit
Open-source cheminformatics and machine learning.
|
This is a class for running reactions on sets of reagents. More...
#include <Enumerate.h>
Public Member Functions | |
| EnumerateLibrary () | |
| EnumerateLibrary (const std::string &s) | |
| EnumerateLibrary (const ChemicalReaction &rxn, const EnumerationTypes::BBS &reagents, const EnumerationParams ¶ms=EnumerationParams()) | |
| EnumerateLibrary (const ChemicalReaction &rxn, const EnumerationTypes::BBS &reagents, const EnumerationStrategyBase &enumerator, const EnumerationParams ¶ms=EnumerationParams()) | |
| EnumerateLibrary (const EnumerateLibrary &rhs) | |
| const EnumerationTypes::BBS & | getReagents () const |
| Return the reagents used in the library. This may be fewer reagents than. | |
| 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 |
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.
|
inline |
Definition at line 116 of file Enumerate.h.
References RDKit::EnumerateLibraryBase::EnumerateLibraryBase().
Referenced by EnumerateLibrary().
|
inline |
Definition at line 117 of file Enumerate.h.
References RDKit::EnumerateLibraryBase::EnumerateLibraryBase(), and RDKit::EnumerateLibraryBase::initFromString().
| 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 | ) |
References EnumerateLibrary().
|
inline |
Return the reagents used in the library. This may be fewer reagents than.
Definition at line 132 of file Enumerate.h.
|
overridevirtual |
initializes from a stream pickle
Implements RDKit::EnumerateLibraryBase.
References RDKit::MolPickler::pickleMol().
|
overridevirtual |
Get the next product set.
Implements RDKit::EnumerateLibraryBase.
|
overridevirtual |
serializes (pickles) to a stream
Implements RDKit::EnumerateLibraryBase.