Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Shape.ScreeningProcessor Class Reference

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

+ Inheritance diagram for CDPL.Shape.ScreeningProcessor:

Public Member Functions

None __init__ ()
 Constructs an empty ScreeningProcessor instance.
 
None __init__ (Chem.MolecularGraph query)
 Constructs a ScreeningProcessor instance with query as the single query molecule. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None setHitCallback (VoidMolecularGraph2AlignmentResultFunctor func)
 Sets the callback that is invoked for every alignment hit produced by process(). More...
 
VoidMolecularGraph2AlignmentResultFunctor getHitCallback ()
 Returns the currently configured hit callback. More...
 
ScreeningSettings getSettings ()
 Returns the current screening settings (mutable). More...
 
None clearQuerySet ()
 Removes all query molecules.
 
None addQuery (Chem.MolecularGraph molgraph)
 Adds molgraph to the query set. More...
 
int getQuerySetSize ()
 Returns the number of query molecules. More...
 
Chem.MolecularGraph getQuery (int idx)
 Returns the query molecule at index idx. More...
 
bool process (Chem.MolecularGraph molgraph)
 Processes the database molecule molgraph, aligning it against all query molecules. More...
 

Properties

 objectID = property(getObjectID)
 
 hitCallback = property(getHitCallback, setHitCallback)
 
 settings = property(getSettings)
 
 querySetSize = property(getQuerySetSize)
 

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.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Shape.ScreeningProcessor.__init__ ( Chem.MolecularGraph  query)

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

Parameters
queryThe query molecule.

Member Function Documentation

◆ getObjectID()

int CDPL.Shape.ScreeningProcessor.getObjectID ( )

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

Different Python ScreeningProcessor 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 ScreeningProcessor 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.

◆ setHitCallback()

None CDPL.Shape.ScreeningProcessor.setHitCallback ( VoidMolecularGraph2AlignmentResultFunctor  func)

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

Parameters
funcThe hit-callback function.

◆ getHitCallback()

VoidMolecularGraph2AlignmentResultFunctor CDPL.Shape.ScreeningProcessor.getHitCallback ( )

Returns the currently configured hit callback.

Returns
A reference to the hit-callback function.

◆ getSettings()

ScreeningSettings CDPL.Shape.ScreeningProcessor.getSettings ( )

Returns the current screening settings (mutable).

Returns
A reference to the screening settings.

◆ addQuery()

None CDPL.Shape.ScreeningProcessor.addQuery ( Chem.MolecularGraph  molgraph)

Adds molgraph to the query set.

Parameters
molgraphThe query molecule.

◆ getQuerySetSize()

int CDPL.Shape.ScreeningProcessor.getQuerySetSize ( )

Returns the number of query molecules.

Returns
The number of query molecules.

◆ getQuery()

Chem.MolecularGraph CDPL.Shape.ScreeningProcessor.getQuery ( int  idx)

Returns the query molecule at index idx.

Parameters
idxThe zero-based index of the query molecule.
Returns
A 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].

◆ process()

bool CDPL.Shape.ScreeningProcessor.process ( 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.