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

Abstract base class for creators that build optimized pharmacophore screening databases. More...

+ Inheritance diagram for CDPL.Pharm.ScreeningDBCreator:

Classes

class  Mode
 Specifies how an existing database file is treated by open(). More...
 

Public Member Functions

None __init__ ()
 Initializes the ScreeningDBCreator instance.
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None open (str name, Mode mode=CDPL.Pharm.Mode.CREATE, bool allow_dup_entries=True)
 Opens the database identified by name in the specified mode. More...
 
None close ()
 Closes the currently open database.
 
Mode getMode ()
 Returns the mode in which the currently open database was opened. More...
 
bool allowDuplicateEntries ()
 Tells whether duplicate molecule entries are allowed. More...
 
bool process (Chem.MolecularGraph molgraph)
 Processes molgraph and adds it (or its derived pharmacophores) to the database. More...
 
bool merge (ScreeningDBAccessor db_acc, BoolDoubleFunctor func)
 Merges the contents of db_acc into the currently open database. More...
 
int getNumProcessed ()
 Returns the number of molecules processed since the database was opened. More...
 
int getNumRejected ()
 Returns the number of molecules that were rejected (e.g. More...
 
int getNumDeleted ()
 Returns the number of entries that were deleted since the database was opened. More...
 
int getNumInserted ()
 Returns the number of entries that were inserted since the database was opened. More...
 
str getDatabaseName ()
 Returns the name of the currently open database. More...
 

Properties

 objectID = property(getObjectID)
 
 mode = property(getMode)
 
 allowDuplicates = property(allowDuplicateEntries)
 
 numProcessed = property(getNumProcessed)
 
 numRejected = property(getNumRejected)
 
 numDeleted = property(getNumDeleted)
 
 numInserted = property(getNumInserted)
 
 databaseName = property(getDatabaseName)
 

Detailed Description

Abstract base class for creators that build optimized pharmacophore screening databases.

Member Function Documentation

◆ getObjectID()

int CDPL.Pharm.ScreeningDBCreator.getObjectID ( )

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

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

◆ open()

None CDPL.Pharm.ScreeningDBCreator.open ( str  name,
Mode   mode = CDPL.Pharm.Mode.CREATE,
bool   allow_dup_entries = True 
)

Opens the database identified by name in the specified mode.

Parameters
nameThe database name (path, URI, etc., interpreted by the concrete subclass).
modeThe open mode (see Mode).
allow_dup_entriesIf True, duplicate molecule entries are allowed. If False, duplicates are rejected.

◆ getMode()

Mode CDPL.Pharm.ScreeningDBCreator.getMode ( )

Returns the mode in which the currently open database was opened.

Returns
The open mode.

◆ allowDuplicateEntries()

bool CDPL.Pharm.ScreeningDBCreator.allowDuplicateEntries ( )

Tells whether duplicate molecule entries are allowed.

Returns
True if duplicates are allowed, and False otherwise.

◆ process()

bool CDPL.Pharm.ScreeningDBCreator.process ( Chem.MolecularGraph  molgraph)

Processes molgraph and adds it (or its derived pharmacophores) to the database.

Parameters
molgraphThe molecular graph to process.
Returns
True if at least one entry was inserted, and False otherwise (e.g. when duplicates are rejected).

◆ merge()

bool CDPL.Pharm.ScreeningDBCreator.merge ( ScreeningDBAccessor  db_acc,
BoolDoubleFunctor  func 
)

Merges the contents of db_acc into the currently open database.

Parameters
db_accThe source database accessor.
funcAn optional progress-reporting callback (called repeatedly with a fraction in [0, 1]).
Returns
True if the merge completed successfully, and False if it was aborted by the callback.

◆ getNumProcessed()

int CDPL.Pharm.ScreeningDBCreator.getNumProcessed ( )

Returns the number of molecules processed since the database was opened.

Returns
The processed-molecule count.

◆ getNumRejected()

int CDPL.Pharm.ScreeningDBCreator.getNumRejected ( )

Returns the number of molecules that were rejected (e.g.

as duplicates) since the database was opened.

Returns
The rejected-molecule count.

◆ getNumDeleted()

int CDPL.Pharm.ScreeningDBCreator.getNumDeleted ( )

Returns the number of entries that were deleted since the database was opened.

Returns
The deleted-entry count.

◆ getNumInserted()

int CDPL.Pharm.ScreeningDBCreator.getNumInserted ( )

Returns the number of entries that were inserted since the database was opened.

Returns
The inserted-entry count.

◆ getDatabaseName()

str CDPL.Pharm.ScreeningDBCreator.getDatabaseName ( )

Returns the name of the currently open database.

Returns
A reference to the database name.