RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDKit::RandomSampleStrategy Class Reference

#include <RandomSample.h>

Inheritance diagram for RDKit::RandomSampleStrategy:
RDKit::EnumerationStrategyBase

Public Member Functions

 RandomSampleStrategy ()
 
void initializeStrategy (const ChemicalReaction &, const EnumerationTypes::BBS &) override
 
const chartype () const override
 
const EnumerationTypes::RGROUPSnext () override
 The current permutation {r1, r2, ...}.
 
boost::uint64_t getPermutationIdx () const override
 Returns how many permutations have been processed by this strategy.
 
 operator bool () const override
 
EnumerationStrategyBasecopy () const override
 copy the enumeration strategy complete with current state
 
void initialize (const ChemicalReaction &reaction, const EnumerationTypes::BBS &building_blocks)
 
- Public Member Functions inherited from RDKit::EnumerationStrategyBase
 EnumerationStrategyBase ()
 
virtual ~EnumerationStrategyBase ()
 
void initialize (const ChemicalReaction &reaction, const EnumerationTypes::BBS &building_blocks)
 
const EnumerationTypes::RGROUPSgetPosition () const
 The current position in the enumeration.
 
boost::uint64_t getNumPermutations () const
 
bool skip (boost::uint64_t skipCount)
 

Additional Inherited Members

- Static Public Attributes inherited from RDKit::EnumerationStrategyBase
static const boost::uint64_t EnumerationOverflow
 
- Protected Member Functions inherited from RDKit::EnumerationStrategyBase
void internalInitialize (const EnumerationTypes::RGROUPS &rgroups)
 
- Protected Attributes inherited from RDKit::EnumerationStrategyBase
EnumerationTypes::RGROUPS m_permutation
 
EnumerationTypes::RGROUPS m_permutationSizes
 
boost::uint64_t m_numPermutations {}
 

Detailed Description

This is a class for fully randomly sampling reagents. Note that this enumerator never halts.

basic usage:

std::vector<MOL_SPTR_VECT> bbs;
bbs.push_back( bbs_for_reactants_1 );
bbs.push_back( bbs_for_reactants_2 );

RandomSampleStrategy rgroups;
rgroups.initialize(rxn, bbs);
for(size_t i=0; i<num_samples && rgroups; ++i) {
  MOL_SPTR_VECT rvect = getReactantsFromRGroups(bbs, rgroups.next());
  std::vector<MOL_SPTR_VECT> lprops = rxn.RunReactants(rvect);
  ...
}

See EnumerationStrategyBase for more details and usage.

Definition at line 65 of file RandomSample.h.

Constructor & Destructor Documentation

◆ RandomSampleStrategy()

RDKit::RandomSampleStrategy::RandomSampleStrategy ( )
inline

Definition at line 72 of file RandomSample.h.

Member Function Documentation

◆ copy()

EnumerationStrategyBase * RDKit::RandomSampleStrategy::copy ( ) const
inlineoverridevirtual

copy the enumeration strategy complete with current state

Implements RDKit::EnumerationStrategyBase.

Definition at line 113 of file RandomSample.h.

◆ getPermutationIdx()

boost::uint64_t RDKit::RandomSampleStrategy::getPermutationIdx ( ) const
inlineoverridevirtual

Returns how many permutations have been processed by this strategy.

Implements RDKit::EnumerationStrategyBase.

Definition at line 107 of file RandomSample.h.

◆ initialize()

void RDKit::EnumerationStrategyBase::initialize ( const ChemicalReaction reaction,
const EnumerationTypes::BBS building_blocks 
)
inline

Initialize the enumerator based on the reaction and the supplied building blocks This is the standard API point. This calls the derived class's initializeStrategy method which must be implemented

Definition at line 145 of file EnumerationStrategyBase.h.

◆ initializeStrategy()

void RDKit::RandomSampleStrategy::initializeStrategy ( const ChemicalReaction ,
const EnumerationTypes::BBS  
)
inlineoverridevirtual

Implements RDKit::EnumerationStrategyBase.

Definition at line 84 of file RandomSample.h.

◆ next()

const EnumerationTypes::RGROUPS & RDKit::RandomSampleStrategy::next ( )
inlineoverridevirtual

The current permutation {r1, r2, ...}.

Implements RDKit::EnumerationStrategyBase.

Definition at line 97 of file RandomSample.h.

◆ operator bool()

RDKit::RandomSampleStrategy::operator bool ( ) const
inlineoverridevirtual

returns true if there are more permutations left random enumerators may always return true...

Implements RDKit::EnumerationStrategyBase.

Definition at line 111 of file RandomSample.h.

◆ type()

const char * RDKit::RandomSampleStrategy::type ( ) const
inlineoverridevirtual

Reimplemented from RDKit::EnumerationStrategyBase.

Definition at line 94 of file RandomSample.h.


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