Chemical Data Processing Library C++ API - Version 1.4.0
PSDScreeningDBCreator.hpp
Go to the documentation of this file.
1 /*
2  * PSDScreeningDBCreator.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_PHARM_PSDSCREENINGDBCREATOR_HPP
30 #define CDPL_PHARM_PSDSCREENINGDBCREATOR_HPP
31 
32 #include <memory>
33 
34 #include "CDPL/Pharm/APIPrefix.hpp"
36 
37 
38 namespace CDPL
39 {
40 
41  namespace Pharm
42  {
43 
44  class PSDScreeningDBCreatorImpl;
45 
51  {
52 
53  public:
55  typedef std::shared_ptr<PSDScreeningDBCreator> SharedPointer;
56 
61 
70  PSDScreeningDBCreator(const std::string& name, Mode mode = CREATE, bool allow_dup_entries = true);
71 
73 
78 
80 
88  void open(const std::string& name, Mode mode = CREATE, bool allow_dup_entries = true);
89 
93  void close();
94 
99  Mode getMode() const;
100 
105  bool allowDuplicateEntries() const;
106 
112  bool process(const Chem::MolecularGraph& molgraph);
113 
120  bool merge(const ScreeningDBAccessor& db_acc, const ProgressCallbackFunction& func);
121 
126  const std::string& getDatabaseName() const;
127 
132  std::size_t getNumProcessed() const;
133 
138  std::size_t getNumRejected() const;
139 
144  std::size_t getNumDeleted() const;
145 
150  std::size_t getNumInserted() const;
151 
152  private:
153  typedef std::unique_ptr<PSDScreeningDBCreatorImpl> ImplementationPointer;
154 
155  ImplementationPointer impl;
156  };
157  } // namespace Pharm
158 } // namespace CDPL
159 
160 #endif // CDPL_PHARM_PSDSCREENINGDBCREATOR_HPP
Definition of the preprocessor macro CDPL_PHARM_API.
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Pharm::ScreeningDBCreator.
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Pharm::ScreeningDBCreator implementation that builds optimized pharmacophore screening databases in t...
Definition: PSDScreeningDBCreator.hpp:51
const std::string & getDatabaseName() const
Returns the name of the currently associated database-file.
bool allowDuplicateEntries() const
Tells whether duplicate database entries are currently allowed.
std::size_t getNumDeleted() const
Returns the number of pre-existing database entries that were deleted (under Mode::UPDATE/CREATE).
PSDScreeningDBCreator()
Constructs a PSDScreeningDBCreator instance without an associated database.
void close()
Closes the currently associated database-file (if any).
bool merge(const ScreeningDBAccessor &db_acc, const ProgressCallbackFunction &func)
Merges all molecule/pharmacophore records of db_acc into the currently open database.
std::size_t getNumProcessed() const
Returns the total number of input molecules processed since the database was opened.
void open(const std::string &name, Mode mode=CREATE, bool allow_dup_entries=true)
Opens the database-file specified by name in the given insert mode.
bool process(const Chem::MolecularGraph &molgraph)
Processes molgraph and inserts the resulting molecule (with derived conformer pharmacophores) into th...
PSDScreeningDBCreator & operator=(const PSDScreeningDBCreator &)=delete
std::size_t getNumRejected() const
Returns the number of processed molecules that were rejected (e.g. as duplicates).
Mode getMode() const
Returns the currently configured insert mode.
std::shared_ptr< PSDScreeningDBCreator > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PSDScreeningDBCreator instances.
Definition: PSDScreeningDBCreator.hpp:55
PSDScreeningDBCreator(const std::string &name, Mode mode=CREATE, bool allow_dup_entries=true)
Constructs a PSDScreeningDBCreator instance that will write data to the database-file specified by na...
std::size_t getNumInserted() const
Returns the number of new database entries that were inserted.
PSDScreeningDBCreator(const PSDScreeningDBCreator &)=delete
Abstract base class for accessors that read the data stored in pharmacophore screening databases.
Definition: ScreeningDBAccessor.hpp:58
Abstract base class for creators that build optimized pharmacophore screening databases.
Definition: ScreeningDBCreator.hpp:58
Mode
Specifies how an existing database file is treated by open().
Definition: ScreeningDBCreator.hpp:71
std::function< bool(double)> ProgressCallbackFunction
Type of the progress-reporting callback (argument: fraction in [0, 1], return: true to continue,...
Definition: ScreeningDBCreator.hpp:65
The namespace of the Chemical Data Processing Library.