Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | 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...

+ Inheritance diagram for CDPL.Pharm.FileScreeningHitCollector:

Public Member Functions

None __init__ (FileScreeningHitCollector collector)
 Initializes a copy of the FileScreeningHitCollector instance collector. More...
 
None __init__ (Chem.MolecularGraphWriterBase writer)
 Constructs the FileScreeningHitCollector instance. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
FileScreeningHitCollector assign (FileScreeningHitCollector collector)
 Replaces the current state of self with a copy of the state of the FileScreeningHitCollector instance collector. More...
 
None setDataWriter (Chem.MolecularGraphWriterBase writer)
 Specifies the molecular graph writer used to output hit molecules. More...
 
Chem.MolecularGraphWriterBase getDataWriter ()
 Returns the currently configured molecular graph writer. More...
 
None alignHitMolecule (bool align)
 Specifies whether the hit molecule's coordinates shall be transformed by the alignment matrix before writing. More...
 
bool alignHitMolecule ()
 Tells whether the hit molecule is aligned before writing. More...
 
None outputScoreProperty (bool output)
 Specifies whether the alignment score shall be written as a molecule property. More...
 
bool outputScoreProperty ()
 Tells whether the alignment score is written as a molecule property. More...
 
None outputDBNameProperty (bool output)
 Specifies whether the source-database name shall be written as a molecule property. More...
 
bool outputDBNameProperty ()
 Tells whether the source-database name is written as a molecule property. More...
 
None outputDBMoleculeIndexProperty (bool output)
 Specifies whether the source-database molecule index shall be written as a molecule property. More...
 
bool outputDBMoleculeIndexProperty ()
 Tells whether the source-database molecule index is written as a molecule property. More...
 
None outputMoleculeConfIndexProperty (bool output)
 Specifies whether the conformer index within the source molecule shall be written as a molecule property. More...
 
bool outputMoleculeConfIndexProperty ()
 Tells whether the conformer index within the source molecule is written as a molecule property. More...
 
None outputZeroBasedIndices (bool zero_based)
 Specifies whether emitted molecule and conformer indices are zero-based (rather than one-based). More...
 
bool outputZeroBasedIndices ()
 Tells whether emitted molecule and conformer indices are zero-based. More...
 
bool __call__ (SearchHit hit, float score)
 Writes the search hit hit and its alignment score score to the configured data writer. More...
 

Properties

 objectID = property(getObjectID)
 
 dataWriter = property(getDataWriter, setDataWriter)
 
 alignHitMol = property(alignHitMolecule, alignHitMolecule)
 
 outputScoreProp = property(outputScoreProperty, outputScoreProperty)
 
 outputDBNameProp = property(outputDBNameProperty, outputDBNameProperty)
 
 outputDBMoleculeIndexProp = property(outputDBMoleculeIndexProperty, outputDBMoleculeIndexProperty)
 
 outputMoleculeConfIndexProp = property(outputMoleculeConfIndexProperty, outputMoleculeConfIndexProperty)
 
 outputZeroBasedInds = property(outputZeroBasedIndices, outputZeroBasedIndices)
 

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.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Pharm.FileScreeningHitCollector.__init__ ( FileScreeningHitCollector  collector)

Initializes a copy of the FileScreeningHitCollector instance collector.

Parameters
collectorThe FileScreeningHitCollector instance to copy.

◆ __init__() [2/2]

None CDPL.Pharm.FileScreeningHitCollector.__init__ ( Chem.MolecularGraphWriterBase  writer)

Constructs the FileScreeningHitCollector instance.

Parameters
writerThe molecular graph writer used to output hit molecules.

Member Function Documentation

◆ getObjectID()

int CDPL.Pharm.FileScreeningHitCollector.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python FileScreeningHitCollector instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two FileScreeningHitCollector instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

FileScreeningHitCollector CDPL.Pharm.FileScreeningHitCollector.assign ( FileScreeningHitCollector  collector)

Replaces the current state of self with a copy of the state of the FileScreeningHitCollector instance collector.

Parameters
collectorThe FileScreeningHitCollector instance to copy.
Returns
self

◆ setDataWriter()

None CDPL.Pharm.FileScreeningHitCollector.setDataWriter ( Chem.MolecularGraphWriterBase  writer)

Specifies the molecular graph writer used to output hit molecules.

Parameters
writerThe data writer.

◆ getDataWriter()

Chem.MolecularGraphWriterBase CDPL.Pharm.FileScreeningHitCollector.getDataWriter ( )

Returns the currently configured molecular graph writer.

Returns
A reference to the data writer.

◆ alignHitMolecule() [1/2]

None 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 ( )

Tells whether the hit molecule is aligned before writing.

Returns
True if alignment is performed, and False otherwise.

◆ outputScoreProperty() [1/2]

None 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 ( )

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]

None 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 ( )

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]

None 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 ( )

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]

None 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 ( )

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]

None 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 ( )

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

Returns
True if zero-based indices are used, and False otherwise.

◆ __call__()

bool CDPL.Pharm.FileScreeningHitCollector.__call__ ( SearchHit  hit,
float  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.