Chemical Data Processing Library C++ API - Version 1.4.0
PSDScreeningDBAccessor.hpp
Go to the documentation of this file.
1 /*
2  * PSDScreeningDBAccessor.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_PSDSCREENINGDBACCESSOR_HPP
30 #define CDPL_PHARM_PSDSCREENINGDBACCESSOR_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 PSDScreeningDBAccessorImpl;
45 
51  {
52 
53  public:
55  typedef std::shared_ptr<PSDScreeningDBAccessor> SharedPointer;
56 
61 
67  PSDScreeningDBAccessor(const std::string& name);
68 
70 
75 
77 
82  void open(const std::string& name);
83 
87  void close();
88 
93  const std::string& getDatabaseName() const;
94 
99  std::size_t getNumMolecules() const;
100 
105  std::size_t getNumPharmacophores() const;
106 
112  std::size_t getNumPharmacophores(std::size_t mol_idx) const;
113 
120  void getMolecule(std::size_t mol_idx, Chem::Molecule& mol, bool overwrite = true) const;
121 
128  void getPharmacophore(std::size_t pharm_idx, Pharmacophore& pharm, bool overwrite = true) const;
129 
137  void getPharmacophore(std::size_t mol_idx, std::size_t mol_conf_idx, Pharmacophore& pharm, bool overwrite = true) const;
138 
144  std::size_t getMoleculeIndex(std::size_t pharm_idx) const;
145 
151  std::size_t getConformationIndex(std::size_t pharm_idx) const;
152 
158  const FeatureTypeHistogram& getFeatureCounts(std::size_t pharm_idx) const;
159 
166  const FeatureTypeHistogram& getFeatureCounts(std::size_t mol_idx, std::size_t mol_conf_idx) const;
167 
168  private:
169  typedef std::unique_ptr<PSDScreeningDBAccessorImpl> ImplementationPointer;
170 
171  ImplementationPointer impl;
172  };
173  } // namespace Pharm
174 } // namespace CDPL
175 
176 #endif // CDPL_PHARM_PSDSCREENINGDBACCESSOR_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::ScreeningDBAccessor.
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
Pharm::ScreeningDBAccessor implementation that reads pharmacophore screening databases stored in the ...
Definition: PSDScreeningDBAccessor.hpp:51
void getPharmacophore(std::size_t mol_idx, std::size_t mol_conf_idx, Pharmacophore &pharm, bool overwrite=true) const
Retrieves the pharmacophore for the given (molecule, conformer) pair and stores it in pharm.
PSDScreeningDBAccessor()
Constructs a PSDScreeningDBAccessor instance without an associated database.
void open(const std::string &name)
Opens the database-file specified by name.
std::size_t getConformationIndex(std::size_t pharm_idx) const
Returns the conformer index (within its owning molecule) of the pharmacophore at index pharm_idx.
void getMolecule(std::size_t mol_idx, Chem::Molecule &mol, bool overwrite=true) const
Retrieves the molecule at index mol_idx and stores it in mol.
std::shared_ptr< PSDScreeningDBAccessor > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PSDScreeningDBAccessor instances.
Definition: PSDScreeningDBAccessor.hpp:55
std::size_t getNumPharmacophores(std::size_t mol_idx) const
Returns the number of pharmacophores (conformers) stored for the molecule at index mol_idx.
void getPharmacophore(std::size_t pharm_idx, Pharmacophore &pharm, bool overwrite=true) const
Retrieves the pharmacophore at index pharm_idx and stores it in pharm.
PSDScreeningDBAccessor(const std::string &name)
Constructs a PSDScreeningDBAccessor instance that will read data from the database-file specified by ...
std::size_t getNumPharmacophores() const
Returns the total number of pharmacophores stored in the database.
void close()
Closes the currently associated database-file (if any).
std::size_t getNumMolecules() const
Returns the total number of molecules stored in the database.
const FeatureTypeHistogram & getFeatureCounts(std::size_t pharm_idx) const
Returns the per-feature-type counts of the pharmacophore at index pharm_idx.
const std::string & getDatabaseName() const
Returns the name of the currently associated database-file.
const FeatureTypeHistogram & getFeatureCounts(std::size_t mol_idx, std::size_t mol_conf_idx) const
Returns the per-feature-type counts of the pharmacophore for the given (molecule, conformer) pair.
PSDScreeningDBAccessor(const PSDScreeningDBAccessor &)=delete
std::size_t getMoleculeIndex(std::size_t pharm_idx) const
Returns the molecule index of the pharmacophore at index pharm_idx.
PSDScreeningDBAccessor & operator=(const PSDScreeningDBAccessor &)=delete
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
The namespace of the Chemical Data Processing Library.