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:
57  typedef std::shared_ptr<PSDScreeningDBAccessor> SharedPointer;
58 
63 
69  PSDScreeningDBAccessor(const std::string& name);
70 
72 
77 
79 
84  void open(const std::string& name);
85 
89  void close();
90 
95  const std::string& getDatabaseName() const;
96 
101  std::size_t getNumMolecules() const;
102 
107  std::size_t getNumPharmacophores() const;
108 
114  std::size_t getNumPharmacophores(std::size_t mol_idx) const;
115 
122  void getMolecule(std::size_t mol_idx, Chem::Molecule& mol, bool overwrite = true) const;
123 
130  void getPharmacophore(std::size_t pharm_idx, Pharmacophore& pharm, bool overwrite = true) const;
131 
139  void getPharmacophore(std::size_t mol_idx, std::size_t mol_conf_idx, Pharmacophore& pharm, bool overwrite = true) const;
140 
146  std::size_t getMoleculeIndex(std::size_t pharm_idx) const;
147 
153  std::size_t getConformationIndex(std::size_t pharm_idx) const;
154 
160  const FeatureTypeHistogram& getFeatureCounts(std::size_t pharm_idx) const;
161 
168  const FeatureTypeHistogram& getFeatureCounts(std::size_t mol_idx, std::size_t mol_conf_idx) const;
169 
170  private:
171  typedef std::unique_ptr<PSDScreeningDBAccessorImpl> ImplementationPointer;
172 
173  ImplementationPointer impl;
174  };
175  } // namespace Pharm
176 } // namespace CDPL
177 
178 #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:57
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.