Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Shape::ScreeningProcessor Class Reference

High-level driver for shape-based virtual screening of molecular databases. More...

#include <ScreeningProcessor.hpp>

Public Types

typedef std::shared_ptr< ScreeningProcessorSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningProcessor instances. More...
 
typedef boost::indirect_iterator< MolecularGraphList::const_iterator, const Chem::MolecularGraphConstMolecularGraphIterator
 A constant iterator over the query molecules. More...
 
typedef std::function< void(const Chem::MolecularGraph &, const Chem::MolecularGraph &, const AlignmentResult &)> HitCallbackFunction
 Type of the callback invoked for each alignment hit (arguments: query, hit, alignment result). More...
 

Public Member Functions

 ScreeningProcessor ()
 Constructs an empty ScreeningProcessor instance. More...
 
 ScreeningProcessor (const Chem::MolecularGraph &query)
 Constructs a ScreeningProcessor instance with query as the single query molecule. More...
 
 ScreeningProcessor (const ScreeningProcessor &proc)=delete
 
 ~ScreeningProcessor ()
 Destructor. More...
 
ScreeningProcessoroperator= (const ScreeningProcessor &proc)=delete
 
void setHitCallback (const HitCallbackFunction &func)
 Sets the callback that is invoked for every alignment hit produced by process(). More...
 
const HitCallbackFunctiongetHitCallback () const
 Returns the currently configured hit callback. More...
 
const ScreeningSettingsgetSettings () const
 Returns the current screening settings. More...
 
ScreeningSettingsgetSettings ()
 Returns the current screening settings (mutable). More...
 
void clearQuerySet ()
 Removes all query molecules. More...
 
void addQuery (const Chem::MolecularGraph &molgraph)
 Adds molgraph to the query set. More...
 
std::size_t getQuerySetSize () const
 Returns the number of query molecules. More...
 
const Chem::MolecularGraphgetQuery (std::size_t idx) const
 Returns the query molecule at index idx. More...
 
ConstMolecularGraphIterator getQuerySetBegin () const
 Returns a constant iterator pointing to the first query molecule. More...
 
ConstMolecularGraphIterator getQuerySetEnd () const
 Returns a constant iterator pointing one past the last query molecule. More...
 
bool process (const Chem::MolecularGraph &molgraph)
 Processes the database molecule molgraph, aligning it against all query molecules. More...
 

Detailed Description

High-level driver for shape-based virtual screening of molecular databases.

The processor maintains a set of query molecules and aligns each incoming database molecule against all of them, reporting alignment hits through a user-supplied callback. The behaviour (similarity score type, shape generation, alignment options, etc.) is configured via the embedded Shape::ScreeningSettings instance.

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningProcessor instances.

◆ ConstMolecularGraphIterator

typedef boost::indirect_iterator<MolecularGraphList::const_iterator, const Chem::MolecularGraph> CDPL::Shape::ScreeningProcessor::ConstMolecularGraphIterator

A constant iterator over the query molecules.

◆ HitCallbackFunction

Type of the callback invoked for each alignment hit (arguments: query, hit, alignment result).

Constructor & Destructor Documentation

◆ ScreeningProcessor() [1/3]

CDPL::Shape::ScreeningProcessor::ScreeningProcessor ( )

Constructs an empty ScreeningProcessor instance.

◆ ScreeningProcessor() [2/3]

CDPL::Shape::ScreeningProcessor::ScreeningProcessor ( const Chem::MolecularGraph query)

Constructs a ScreeningProcessor instance with query as the single query molecule.

Parameters
queryThe query molecule.

◆ ScreeningProcessor() [3/3]

CDPL::Shape::ScreeningProcessor::ScreeningProcessor ( const ScreeningProcessor proc)
delete

◆ ~ScreeningProcessor()

CDPL::Shape::ScreeningProcessor::~ScreeningProcessor ( )

Destructor.

Member Function Documentation

◆ operator=()

ScreeningProcessor& CDPL::Shape::ScreeningProcessor::operator= ( const ScreeningProcessor proc)
delete

◆ setHitCallback()

void CDPL::Shape::ScreeningProcessor::setHitCallback ( const HitCallbackFunction func)

Sets the callback that is invoked for every alignment hit produced by process().

Parameters
funcThe hit-callback function.

◆ getHitCallback()

const HitCallbackFunction& CDPL::Shape::ScreeningProcessor::getHitCallback ( ) const

Returns the currently configured hit callback.

Returns
A const reference to the hit-callback function.

◆ getSettings() [1/2]

const ScreeningSettings& CDPL::Shape::ScreeningProcessor::getSettings ( ) const

Returns the current screening settings.

Returns
A const reference to the screening settings.

◆ getSettings() [2/2]

ScreeningSettings& CDPL::Shape::ScreeningProcessor::getSettings ( )

Returns the current screening settings (mutable).

Returns
A reference to the screening settings.

◆ clearQuerySet()

void CDPL::Shape::ScreeningProcessor::clearQuerySet ( )

Removes all query molecules.

◆ addQuery()

void CDPL::Shape::ScreeningProcessor::addQuery ( const Chem::MolecularGraph molgraph)

Adds molgraph to the query set.

Parameters
molgraphThe query molecule.

◆ getQuerySetSize()

std::size_t CDPL::Shape::ScreeningProcessor::getQuerySetSize ( ) const

Returns the number of query molecules.

Returns
The number of query molecules.

◆ getQuery()

const Chem::MolecularGraph& CDPL::Shape::ScreeningProcessor::getQuery ( std::size_t  idx) const

Returns the query molecule at index idx.

Parameters
idxThe zero-based index of the query molecule.
Returns
A const reference to the query molecule.
Exceptions
Base::IndexErrorif the number of query molecules is zero or idx is not in the range [0, getQuerySetSize() - 1].

◆ getQuerySetBegin()

ConstMolecularGraphIterator CDPL::Shape::ScreeningProcessor::getQuerySetBegin ( ) const

Returns a constant iterator pointing to the first query molecule.

Returns
A constant iterator pointing to the first query molecule.

◆ getQuerySetEnd()

ConstMolecularGraphIterator CDPL::Shape::ScreeningProcessor::getQuerySetEnd ( ) const

Returns a constant iterator pointing one past the last query molecule.

Returns
A constant iterator pointing one past the last query molecule.

◆ process()

bool CDPL::Shape::ScreeningProcessor::process ( const Chem::MolecularGraph molgraph)

Processes the database molecule molgraph, aligning it against all query molecules.

Parameters
molgraphThe database molecule.
Returns
true if at least one alignment hit was produced for molgraph, and false otherwise.

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