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

Hit-callback functor for use with Pharm::ScreeningProcessor that writes each accepted hit molecule (optionally aligned and annotated with score/database properties) to a Base::DataWriter sink. More...

#include <FileScreeningHitCollector.hpp>

Public Types

typedef Base::DataWriter< Chem::MolecularGraphMolecularGraphWriter
 Type of the underlying molecular graph data writer. More...
 

Public Member Functions

 FileScreeningHitCollector (MolecularGraphWriter &writer)
 Constructs the FileScreeningHitCollector instance. More...
 
void setDataWriter (MolecularGraphWriter &writer)
 Specifies the molecular graph writer used to output hit molecules. More...
 
MolecularGraphWritergetDataWriter () const
 Returns the currently configured molecular graph writer. More...
 
void alignHitMolecule (bool align)
 Specifies whether the hit molecule's coordinates shall be transformed by the alignment matrix before writing. More...
 
bool alignHitMolecule () const
 Tells whether the hit molecule is aligned before writing. More...
 
void outputScoreProperty (bool output)
 Specifies whether the alignment score shall be written as a molecule property. More...
 
bool outputScoreProperty () const
 Tells whether the alignment score is written as a molecule property. More...
 
void outputDBNameProperty (bool output)
 Specifies whether the source-database name shall be written as a molecule property. More...
 
bool outputDBNameProperty () const
 Tells whether the source-database name is written as a molecule property. More...
 
void outputDBMoleculeIndexProperty (bool output)
 Specifies whether the source-database molecule index shall be written as a molecule property. More...
 
bool outputDBMoleculeIndexProperty () const
 Tells whether the source-database molecule index is written as a molecule property. More...
 
void outputMoleculeConfIndexProperty (bool output)
 Specifies whether the conformer index within the source molecule shall be written as a molecule property. More...
 
bool outputMoleculeConfIndexProperty () const
 Tells whether the conformer index within the source molecule is written as a molecule property. More...
 
void outputZeroBasedIndices (bool zero_based)
 Specifies whether emitted molecule and conformer indices are zero-based (rather than one-based). More...
 
bool outputZeroBasedIndices () const
 Tells whether emitted molecule and conformer indices are zero-based. More...
 
bool operator() (const ScreeningProcessor::SearchHit &hit, double score)
 Writes the search hit hit and its alignment score score to the configured data writer. More...
 

Detailed Description

Hit-callback functor for use with Pharm::ScreeningProcessor that writes each accepted hit molecule (optionally aligned and annotated with score/database properties) to a Base::DataWriter sink.

Member Typedef Documentation

◆ MolecularGraphWriter

Type of the underlying molecular graph data writer.

Constructor & Destructor Documentation

◆ FileScreeningHitCollector()

CDPL::Pharm::FileScreeningHitCollector::FileScreeningHitCollector ( MolecularGraphWriter writer)

Constructs the FileScreeningHitCollector instance.

Parameters
writerThe molecular graph writer used to output hit molecules.

Member Function Documentation

◆ setDataWriter()

void CDPL::Pharm::FileScreeningHitCollector::setDataWriter ( MolecularGraphWriter writer)

Specifies the molecular graph writer used to output hit molecules.

Parameters
writerThe data writer.

◆ getDataWriter()

MolecularGraphWriter& CDPL::Pharm::FileScreeningHitCollector::getDataWriter ( ) const

Returns the currently configured molecular graph writer.

Returns
A reference to the data writer.

◆ alignHitMolecule() [1/2]

void CDPL::Pharm::FileScreeningHitCollector::alignHitMolecule ( bool  align)

Specifies whether the hit molecule's coordinates shall be transformed by the alignment matrix before writing.

Parameters
aligntrue to align the hit molecule, and false to write the original coordinates.

◆ alignHitMolecule() [2/2]

bool CDPL::Pharm::FileScreeningHitCollector::alignHitMolecule ( ) const

Tells whether the hit molecule is aligned before writing.

Returns
true if alignment is performed, and false otherwise.

◆ outputScoreProperty() [1/2]

void CDPL::Pharm::FileScreeningHitCollector::outputScoreProperty ( bool  output)

Specifies whether the alignment score shall be written as a molecule property.

Parameters
outputtrue to write the score property, and false to skip it.

◆ outputScoreProperty() [2/2]

bool CDPL::Pharm::FileScreeningHitCollector::outputScoreProperty ( ) const

Tells whether the alignment score is written as a molecule property.

Returns
true if the score property is written, and false otherwise.

◆ outputDBNameProperty() [1/2]

void CDPL::Pharm::FileScreeningHitCollector::outputDBNameProperty ( bool  output)

Specifies whether the source-database name shall be written as a molecule property.

Parameters
outputtrue to write the database-name property, and false to skip it.

◆ outputDBNameProperty() [2/2]

bool CDPL::Pharm::FileScreeningHitCollector::outputDBNameProperty ( ) const

Tells whether the source-database name is written as a molecule property.

Returns
true if the database-name property is written, and false otherwise.

◆ outputDBMoleculeIndexProperty() [1/2]

void CDPL::Pharm::FileScreeningHitCollector::outputDBMoleculeIndexProperty ( bool  output)

Specifies whether the source-database molecule index shall be written as a molecule property.

Parameters
outputtrue to write the molecule-index property, and false to skip it.

◆ outputDBMoleculeIndexProperty() [2/2]

bool CDPL::Pharm::FileScreeningHitCollector::outputDBMoleculeIndexProperty ( ) const

Tells whether the source-database molecule index is written as a molecule property.

Returns
true if the molecule-index property is written, and false otherwise.

◆ outputMoleculeConfIndexProperty() [1/2]

void CDPL::Pharm::FileScreeningHitCollector::outputMoleculeConfIndexProperty ( bool  output)

Specifies whether the conformer index within the source molecule shall be written as a molecule property.

Parameters
outputtrue to write the conformer-index property, and false to skip it.

◆ outputMoleculeConfIndexProperty() [2/2]

bool CDPL::Pharm::FileScreeningHitCollector::outputMoleculeConfIndexProperty ( ) const

Tells whether the conformer index within the source molecule is written as a molecule property.

Returns
true if the conformer-index property is written, and false otherwise.

◆ outputZeroBasedIndices() [1/2]

void CDPL::Pharm::FileScreeningHitCollector::outputZeroBasedIndices ( bool  zero_based)

Specifies whether emitted molecule and conformer indices are zero-based (rather than one-based).

Parameters
zero_basedtrue to use zero-based indices, and false to use one-based indices.

◆ outputZeroBasedIndices() [2/2]

bool CDPL::Pharm::FileScreeningHitCollector::outputZeroBasedIndices ( ) const

Tells whether emitted molecule and conformer indices are zero-based.

Returns
true if zero-based indices are used, and false otherwise.

◆ operator()()

bool CDPL::Pharm::FileScreeningHitCollector::operator() ( const ScreeningProcessor::SearchHit hit,
double  score 
)

Writes the search hit hit and its alignment score score to the configured data writer.

Parameters
hitThe screening search hit.
scoreThe alignment score of the hit.
Returns
true if the hit was successfully written, and false otherwise.

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