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

High-level driver for pharmacophore-based screening of a Pharm::ScreeningDBAccessor-backed database against a query feature container, reporting alignment hits via a user-supplied callback. More...

#include <ScreeningProcessor.hpp>

Classes

class  SearchHit
 Data structure representing a single alignment hit produced by the screening processor, bundling the source pharmacophore/molecule, the alignment transformation and the source-database indices. More...
 

Public Types

enum  HitReportMode {
  FIRST_MATCHING_CONF ,
  BEST_MATCHING_CONF ,
  ALL_MATCHING_CONFS
}
 Specifies which conformer-level hits are reported per molecule. More...
 
typedef std::shared_ptr< ScreeningProcessorSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningProcessor instances. More...
 
typedef std::function< bool(const SearchHit &, double)> HitCallbackFunction
 Type of the callback invoked for every alignment hit (return: true to continue, false to abort the search). More...
 
typedef std::function< double(const SearchHit &)> ScoringFunction
 Type of the function used to score a search hit. More...
 
typedef std::function< bool(std::size_t, std::size_t)> ProgressCallbackFunction
 Type of the progress-reporting callback (arguments: current molecule index, total molecule count; return: true to continue, false to abort). More...
 

Public Member Functions

 ScreeningProcessor (ScreeningDBAccessor &db_acc)
 Constructs the ScreeningProcessor instance for the given screening database accessor db_acc. More...
 
 ScreeningProcessor (const ScreeningProcessor &proc)=delete
 
 ~ScreeningProcessor ()
 Destructor. More...
 
ScreeningProcessoroperator= (const ScreeningProcessor &proc)=delete
 
void setDBAccessor (ScreeningDBAccessor &db_acc)
 Specifies the screening database accessor. More...
 
ScreeningDBAccessorgetDBAccessor () const
 Returns the currently configured screening database accessor. More...
 
void setHitReportMode (HitReportMode mode)
 Sets the hit-report mode. More...
 
HitReportMode getHitReportMode () const
 Returns the currently configured hit-report mode. More...
 
void setMaxNumOmittedFeatures (std::size_t max_num)
 Sets the maximum number of query features that may remain unmatched in a valid hit. More...
 
std::size_t getMaxNumOmittedFeatures () const
 Returns the currently configured maximum number of omitted features. More...
 
void checkXVolumeClashes (bool check)
 Specifies whether the alignment shall check exclusion volume clashes between the query and the hit molecule. More...
 
bool xVolumeClashesChecked () const
 Tells whether exclusion volume clashes are checked during alignment. More...
 
void seekBestAlignments (bool seek_best)
 Specifies whether the alignment shall search for the best-scoring rather than the first valid alignment per pose. More...
 
bool bestAlignmentsSeeked () const
 Tells whether the alignment seeks the best-scoring rather than the first valid alignment. More...
 
void setHitCallback (const HitCallbackFunction &func)
 Specifies the hit-callback function. More...
 
const HitCallbackFunctiongetHitCallback () const
 Returns the currently configured hit-callback function. More...
 
void setProgressCallback (const ProgressCallbackFunction &func)
 Specifies the progress-reporting callback. More...
 
const ProgressCallbackFunctiongetProgressCallback () const
 Returns the currently configured progress-reporting callback. More...
 
void setScoringFunction (const ScoringFunction &func)
 Specifies the function used to score a search hit. More...
 
const ScoringFunctiongetScoringFunction () const
 Returns the currently configured scoring function. More...
 
std::size_t searchDB (const FeatureContainer &query, std::size_t mol_start_idx=0, std::size_t mol_end_idx=0)
 Screens the database with the supplied query pharmacophore. More...
 

Detailed Description

High-level driver for pharmacophore-based screening of a Pharm::ScreeningDBAccessor-backed database against a query feature container, reporting alignment hits via a user-supplied callback.

Member Typedef Documentation

◆ SharedPointer

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

◆ HitCallbackFunction

Type of the callback invoked for every alignment hit (return: true to continue, false to abort the search).

◆ ScoringFunction

typedef std::function<double(const SearchHit&)> CDPL::Pharm::ScreeningProcessor::ScoringFunction

Type of the function used to score a search hit.

◆ ProgressCallbackFunction

typedef std::function<bool(std::size_t, std::size_t)> CDPL::Pharm::ScreeningProcessor::ProgressCallbackFunction

Type of the progress-reporting callback (arguments: current molecule index, total molecule count; return: true to continue, false to abort).

Member Enumeration Documentation

◆ HitReportMode

Specifies which conformer-level hits are reported per molecule.

Enumerator
FIRST_MATCHING_CONF 

Report the first conformer that matches the query.

BEST_MATCHING_CONF 

Report only the best-scoring matching conformer.

ALL_MATCHING_CONFS 

Report every conformer that matches the query.

Constructor & Destructor Documentation

◆ ScreeningProcessor() [1/2]

CDPL::Pharm::ScreeningProcessor::ScreeningProcessor ( ScreeningDBAccessor db_acc)

Constructs the ScreeningProcessor instance for the given screening database accessor db_acc.

Parameters
db_accAn accessor for the database to screen.

◆ ScreeningProcessor() [2/2]

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

◆ ~ScreeningProcessor()

CDPL::Pharm::ScreeningProcessor::~ScreeningProcessor ( )

Destructor.

Member Function Documentation

◆ operator=()

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

◆ setDBAccessor()

void CDPL::Pharm::ScreeningProcessor::setDBAccessor ( ScreeningDBAccessor db_acc)

Specifies the screening database accessor.

Parameters
db_accThe new database accessor.

◆ getDBAccessor()

ScreeningDBAccessor& CDPL::Pharm::ScreeningProcessor::getDBAccessor ( ) const

Returns the currently configured screening database accessor.

Returns
A reference to the database accessor.

◆ setHitReportMode()

void CDPL::Pharm::ScreeningProcessor::setHitReportMode ( HitReportMode  mode)

Sets the hit-report mode.

Parameters
modeThe new hit-report mode.

◆ getHitReportMode()

HitReportMode CDPL::Pharm::ScreeningProcessor::getHitReportMode ( ) const

Returns the currently configured hit-report mode.

Returns
The hit-report mode.

◆ setMaxNumOmittedFeatures()

void CDPL::Pharm::ScreeningProcessor::setMaxNumOmittedFeatures ( std::size_t  max_num)

Sets the maximum number of query features that may remain unmatched in a valid hit.

Parameters
max_numThe new maximum number of omitted features.

◆ getMaxNumOmittedFeatures()

std::size_t CDPL::Pharm::ScreeningProcessor::getMaxNumOmittedFeatures ( ) const

Returns the currently configured maximum number of omitted features.

Returns
The maximum number of omitted features.

◆ checkXVolumeClashes()

void CDPL::Pharm::ScreeningProcessor::checkXVolumeClashes ( bool  check)

Specifies whether the alignment shall check exclusion volume clashes between the query and the hit molecule.

Parameters
checktrue to enable the clash check, and false to disable it.

◆ xVolumeClashesChecked()

bool CDPL::Pharm::ScreeningProcessor::xVolumeClashesChecked ( ) const

Tells whether exclusion volume clashes are checked during alignment.

Returns
true if the clash check is enabled, and false otherwise.

◆ seekBestAlignments()

void CDPL::Pharm::ScreeningProcessor::seekBestAlignments ( bool  seek_best)

Specifies whether the alignment shall search for the best-scoring rather than the first valid alignment per pose.

Parameters
seek_besttrue to seek the best alignment, and false to accept the first valid alignment.

◆ bestAlignmentsSeeked()

bool CDPL::Pharm::ScreeningProcessor::bestAlignmentsSeeked ( ) const

Tells whether the alignment seeks the best-scoring rather than the first valid alignment.

Returns
true if best-alignment seeking is enabled, and false otherwise.

◆ setHitCallback()

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

Specifies the hit-callback function.

Parameters
funcThe hit-callback function.

◆ getHitCallback()

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

Returns the currently configured hit-callback function.

Returns
A const reference to the hit-callback function.

◆ setProgressCallback()

void CDPL::Pharm::ScreeningProcessor::setProgressCallback ( const ProgressCallbackFunction func)

Specifies the progress-reporting callback.

Parameters
funcThe progress-callback function.

◆ getProgressCallback()

const ProgressCallbackFunction& CDPL::Pharm::ScreeningProcessor::getProgressCallback ( ) const

Returns the currently configured progress-reporting callback.

Returns
A const reference to the progress-callback function.

◆ setScoringFunction()

void CDPL::Pharm::ScreeningProcessor::setScoringFunction ( const ScoringFunction func)

Specifies the function used to score a search hit.

Parameters
funcThe scoring function.

◆ getScoringFunction()

const ScoringFunction& CDPL::Pharm::ScreeningProcessor::getScoringFunction ( ) const

Returns the currently configured scoring function.

Returns
A const reference to the scoring function.

◆ searchDB()

std::size_t CDPL::Pharm::ScreeningProcessor::searchDB ( const FeatureContainer query,
std::size_t  mol_start_idx = 0,
std::size_t  mol_end_idx = 0 
)

Screens the database with the supplied query pharmacophore.

Parameters
queryThe query feature container.
mol_start_idxThe zero-based index of the first molecule to screen.
mol_end_idxThe exclusive upper bound of the molecule range. If 0, the search runs through the end of the database.
Returns
The number of accepted hits produced by the search.

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