Chemical Data Processing Library C++ API - Version 1.4.0
ScreeningDBAccessor.hpp
Go to the documentation of this file.
1 /*
2  * ScreeningDBAccessor.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_SCREENINGDBACCESSOR_HPP
30 #define CDPL_PHARM_SCREENINGDBACCESSOR_HPP
31 
32 #include <string>
33 #include <cstddef>
34 #include <memory>
35 
36 #include "CDPL/Pharm/APIPrefix.hpp"
37 
38 
39 namespace CDPL
40 {
41 
42  namespace Chem
43  {
44 
45  class Molecule;
46  }
47 
48  namespace Pharm
49  {
50 
51  class Pharmacophore;
52  class FeatureTypeHistogram;
53 
58  {
59 
60  public:
62  typedef std::shared_ptr<ScreeningDBAccessor> SharedPointer;
63 
67  virtual ~ScreeningDBAccessor() {}
68 
73  virtual void open(const std::string& name) = 0;
74 
78  virtual void close() = 0;
79 
84  virtual const std::string& getDatabaseName() const = 0;
85 
90  virtual std::size_t getNumMolecules() const = 0;
91 
96  virtual std::size_t getNumPharmacophores() const = 0;
97 
103  virtual std::size_t getNumPharmacophores(std::size_t mol_idx) const = 0;
104 
111  virtual void getMolecule(std::size_t mol_idx, Chem::Molecule& mol, bool overwrite = true) const = 0;
112 
119  virtual void getPharmacophore(std::size_t pharm_idx, Pharmacophore& pharm, bool overwrite = true) const = 0;
120 
128  virtual void getPharmacophore(std::size_t mol_idx, std::size_t mol_conf_idx, Pharmacophore& pharm, bool overwrite = true) const = 0;
129 
135  virtual std::size_t getMoleculeIndex(std::size_t pharm_idx) const = 0;
136 
142  virtual std::size_t getConformationIndex(std::size_t pharm_idx) const = 0;
143 
149  virtual const FeatureTypeHistogram& getFeatureCounts(std::size_t pharm_idx) const = 0;
150 
157  virtual const FeatureTypeHistogram& getFeatureCounts(std::size_t mol_idx, std::size_t mol_conf_idx) const = 0;
158 
159  protected:
161  {
162  return *this;
163  }
164  };
165  } // namespace Pharm
166 } // namespace CDPL
167 
168 #endif // CDPL_PHARM_SCREENINGDBACCESSOR_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.
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
Data type for the storage of feature type histograms of pharmacophores.
Definition: FeatureTypeHistogram.hpp:50
Abstract base class for mutable containers of Pharm::Feature instances representing a pharmacophore m...
Definition: Pharmacophore.hpp:53
Abstract base class for accessors that read the data stored in pharmacophore screening databases.
Definition: ScreeningDBAccessor.hpp:58
ScreeningDBAccessor & operator=(const ScreeningDBAccessor &)
Definition: ScreeningDBAccessor.hpp:160
virtual std::size_t getConformationIndex(std::size_t pharm_idx) const =0
Returns the conformer index within the parent molecule of the pharmacophore at index pharm_idx.
virtual const FeatureTypeHistogram & getFeatureCounts(std::size_t pharm_idx) const =0
Returns the cached per Pharm::FeatureType frequency histogram of the pharmacophore at index pharm_idx...
virtual void getPharmacophore(std::size_t mol_idx, std::size_t mol_conf_idx, Pharmacophore &pharm, bool overwrite=true) const =0
Reads the pharmacophore corresponding to conformer mol_conf_idx of molecule mol_idx into pharm.
virtual void close()=0
Closes the currently open database.
virtual std::size_t getMoleculeIndex(std::size_t pharm_idx) const =0
Returns the molecule index of the pharmacophore at index pharm_idx.
std::shared_ptr< ScreeningDBAccessor > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningDBAccessor instances.
Definition: ScreeningDBAccessor.hpp:62
virtual std::size_t getNumPharmacophores() const =0
Returns the total number of pharmacophores stored in the database (one per molecule conformer).
virtual std::size_t getNumMolecules() const =0
Returns the total number of molecules stored in the database.
virtual void getPharmacophore(std::size_t pharm_idx, Pharmacophore &pharm, bool overwrite=true) const =0
Reads the pharmacophore at index pharm_idx into pharm.
virtual const std::string & getDatabaseName() const =0
Returns the name of the currently open database.
virtual ~ScreeningDBAccessor()
Virtual destructor.
Definition: ScreeningDBAccessor.hpp:67
virtual const FeatureTypeHistogram & getFeatureCounts(std::size_t mol_idx, std::size_t mol_conf_idx) const =0
Returns the cached per Pharm::FeatureType frequency histogram of conformer mol_conf_idx of molecule m...
virtual std::size_t getNumPharmacophores(std::size_t mol_idx) const =0
Returns the number of pharmacophores stored for the molecule at index mol_idx.
virtual void open(const std::string &name)=0
Opens the screening database identified by name.
virtual void getMolecule(std::size_t mol_idx, Chem::Molecule &mol, bool overwrite=true) const =0
Reads the molecule at index mol_idx into mol.
The namespace of the Chemical Data Processing Library.