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

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

#include <ScreeningDBCreator.hpp>

+ Inheritance diagram for CDPL::Pharm::ScreeningDBCreator:

Public Types

enum  Mode {
  CREATE ,
  UPDATE ,
  APPEND
}
 Specifies how an existing database file is treated by open(). More...
 
typedef std::shared_ptr< ScreeningDBCreatorSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningDBCreator instances. More...
 
typedef std::function< bool(double)> ProgressCallbackFunction
 Type of the progress-reporting callback (argument: fraction in [0, 1], return: true to continue, false to abort). More...
 

Public Member Functions

virtual ~ScreeningDBCreator ()
 Virtual destructor. More...
 
virtual void open (const std::string &name, Mode mode=CREATE, bool allow_dup_entries=true)=0
 Opens the database identified by name in the specified mode. More...
 
virtual void close ()=0
 Closes the currently open database. More...
 
virtual Mode getMode () const =0
 Returns the mode in which the currently open database was opened. More...
 
virtual bool allowDuplicateEntries () const =0
 Tells whether duplicate molecule entries are allowed. More...
 
virtual bool process (const Chem::MolecularGraph &molgraph)=0
 Processes molgraph and adds it (or its derived pharmacophores) to the database. More...
 
virtual bool merge (const ScreeningDBAccessor &db_acc, const ProgressCallbackFunction &func)=0
 Merges the contents of db_acc into the currently open database. More...
 
virtual const std::string & getDatabaseName () const =0
 Returns the name of the currently open database. More...
 
virtual std::size_t getNumProcessed () const =0
 Returns the number of molecules processed since the database was opened. More...
 
virtual std::size_t getNumRejected () const =0
 Returns the number of molecules that were rejected (e.g. as duplicates) since the database was opened. More...
 
virtual std::size_t getNumDeleted () const =0
 Returns the number of entries that were deleted since the database was opened. More...
 
virtual std::size_t getNumInserted () const =0
 Returns the number of entries that were inserted since the database was opened. More...
 

Protected Member Functions

ScreeningDBCreatoroperator= (const ScreeningDBCreator &)
 

Detailed Description

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

Member Typedef Documentation

◆ SharedPointer

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

◆ ProgressCallbackFunction

Type of the progress-reporting callback (argument: fraction in [0, 1], return: true to continue, false to abort).

Member Enumeration Documentation

◆ Mode

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

Enumerator
CREATE 

Create a new database (replacing any existing file).

UPDATE 

Update an existing database in place.

APPEND 

Append to an existing database.

Constructor & Destructor Documentation

◆ ~ScreeningDBCreator()

virtual CDPL::Pharm::ScreeningDBCreator::~ScreeningDBCreator ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ open()

virtual void CDPL::Pharm::ScreeningDBCreator::open ( const std::string &  name,
Mode  mode = CREATE,
bool  allow_dup_entries = true 
)
pure virtual

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.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ close()

virtual void CDPL::Pharm::ScreeningDBCreator::close ( )
pure virtual

Closes the currently open database.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ getMode()

virtual Mode CDPL::Pharm::ScreeningDBCreator::getMode ( ) const
pure virtual

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

Returns
The open mode.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ allowDuplicateEntries()

virtual bool CDPL::Pharm::ScreeningDBCreator::allowDuplicateEntries ( ) const
pure virtual

Tells whether duplicate molecule entries are allowed.

Returns
true if duplicates are allowed, and false otherwise.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ process()

virtual bool CDPL::Pharm::ScreeningDBCreator::process ( const Chem::MolecularGraph molgraph)
pure virtual

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).

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ merge()

virtual bool CDPL::Pharm::ScreeningDBCreator::merge ( const ScreeningDBAccessor db_acc,
const ProgressCallbackFunction func 
)
pure virtual

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.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ getDatabaseName()

virtual const std::string& CDPL::Pharm::ScreeningDBCreator::getDatabaseName ( ) const
pure virtual

Returns the name of the currently open database.

Returns
A const reference to the database name.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ getNumProcessed()

virtual std::size_t CDPL::Pharm::ScreeningDBCreator::getNumProcessed ( ) const
pure virtual

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

Returns
The processed-molecule count.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ getNumRejected()

virtual std::size_t CDPL::Pharm::ScreeningDBCreator::getNumRejected ( ) const
pure virtual

Returns the number of molecules that were rejected (e.g. as duplicates) since the database was opened.

Returns
The rejected-molecule count.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ getNumDeleted()

virtual std::size_t CDPL::Pharm::ScreeningDBCreator::getNumDeleted ( ) const
pure virtual

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

Returns
The deleted-entry count.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ getNumInserted()

virtual std::size_t CDPL::Pharm::ScreeningDBCreator::getNumInserted ( ) const
pure virtual

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

Returns
The inserted-entry count.

Implemented in CDPL::Pharm::PSDScreeningDBCreator.

◆ operator=()

ScreeningDBCreator& CDPL::Pharm::ScreeningDBCreator::operator= ( const ScreeningDBCreator )
inlineprotected

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