Chemical Data Processing Library C++ API - Version 1.4.0
HydrophobicFeatureGenerator.hpp
Go to the documentation of this file.
1 /*
2  * HydrophobicFeatureGenerator.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_HYDROPHOBICFEATUREGENERATOR_HPP
30 #define CDPL_PHARM_HYDROPHOBICFEATUREGENERATOR_HPP
31 
32 #include "CDPL/Pharm/APIPrefix.hpp"
36 #include "CDPL/Chem/Fragment.hpp"
37 #include "CDPL/Math/Vector.hpp"
38 #include "CDPL/Util/BitSet.hpp"
39 #include "CDPL/Util/Array.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Pharm
46  {
47 
48  class Feature;
49 
57  {
58 
59  public:
63  static constexpr double DEF_HYD_THRESHOLD_RING = 2.0;
64 
68  static constexpr double DEF_HYD_THRESHOLD_CHAIN = 0.8;
69 
73  static constexpr double DEF_HYD_THRESHOLD_GROUP = 0.8;
74 
78  static constexpr double DEF_FEATURE_TOL = 1.5;
79 
83  static constexpr unsigned int DEF_FEATURE_TYPE = FeatureType::HYDROPHOBIC;
84 
88  static constexpr unsigned int DEF_FEATURE_GEOM = FeatureGeometry::SPHERE;
89 
93  typedef std::shared_ptr<HydrophobicFeatureGenerator> SharedPointer;
94 
99 
105 
113 
118 
125  void setFeatureType(unsigned int type);
126 
132  unsigned int getFeatureType() const;
133 
140  void setFeatureTolerance(double tol);
141 
147  double getFeatureTolerance() const;
148 
155  void setFeatureGeometry(unsigned int geom);
156 
162  unsigned int getFeatureGeometry() const;
163 
170  void setRingHydrophobicityThreshold(double thresh);
171 
178 
185  void setChainHydrophobicityThreshold(double thresh);
186 
193 
200  void setGroupHydrophobicityThreshold(double thresh);
201 
208 
215 
221 
222  private:
223  void addNonPatternFeatures(const Chem::MolecularGraph&, Pharmacophore&);
224 
225  void init(const Chem::MolecularGraph&);
226 
227  void genRingFeatures(Pharmacophore&);
228  void genGroupFeatures(Pharmacophore&);
229  void genChainFeatures(Pharmacophore&);
230 
231  void extractChain(const Chem::Atom&);
232  void processChain(Pharmacophore&);
233 
234  Feature& emitFeature(const AtomList&, Pharmacophore&, const Chem::Fragment::SharedPointer&,
235  bool = true) const;
236 
237  bool isHydrophobicRing(const Chem::Fragment&);
238  bool hasSubstWithMoreThan2Atoms(const Chem::Atom&, const Chem::Fragment&, bool) const;
239 
240  double calcHydWeightedCentroid(const AtomList&, Math::Vector3D&) const;
241 
242  void getAtomHydrophobicities();
243 
244  void createAtomMask(const AtomList&, Util::BitSet&) const;
245  double calcSummedHydrophobicity(const AtomList& alist) const;
246 
247  Chem::Fragment::SharedPointer makeFragment(const AtomList&) const;
248 
249  bool isChainEndAtom(const Chem::Atom&) const;
250 
251  const Chem::MolecularGraph* molGraph;
252  Util::BitSet procAtomMask;
253  Util::BitSet hAtomMask;
254  Util::BitSet tmpAtomMask;
255  unsigned int featureType;
256  double featureTol;
257  unsigned int featureGeom;
258  double hydThreshRing;
259  double hydThreshChain;
260  double hydThreshGroup;
261  Util::DArray atomHydTable;
262  AtomList featureAtoms;
263  AtomList chainAtoms;
264  };
265  } // namespace Pharm
266 } // namespace CDPL
267 
268 #endif // CDPL_PHARM_HYDROPHOBICFEATUREGENERATOR_HPP
Definition of class CDPL::Util::Array.
Declaration of type CDPL::Util::BitSet.
Definition of constants in namespace CDPL::Pharm::FeatureGeometry.
Definition of class CDPL::Chem::Fragment.
Definition of class CDPL::Pharm::PatternBasedFeatureGenerator.
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 constants in namespace CDPL::Pharm::FeatureType.
Definition of vector data types.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
std::shared_ptr< Fragment > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Fragment instances.
Definition: Fragment.hpp:66
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
std::shared_ptr< FeatureGenerator > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FeatureGenerator instances.
Definition: FeatureGenerator.hpp:64
Abstract base class representing a single pharmacophore feature within a parent Pharm::Pharmacophore.
Definition: Feature.hpp:48
Pharm::FeatureGenerator implementation that perceives hydrophobic features by grouping atoms into rin...
Definition: HydrophobicFeatureGenerator.hpp:57
void setFeatureGeometry(unsigned int geom)
Specifies the value of the feature geometry property that has to be set on newly generated features.
HydrophobicFeatureGenerator()
Constructs the HydrophobicFeatureGenerator instance.
std::shared_ptr< HydrophobicFeatureGenerator > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated HydrophobicFeatureGenerator insta...
Definition: HydrophobicFeatureGenerator.hpp:93
void setFeatureTolerance(double tol)
Specifies the value of the feature tolerance property that has to be set on newly generated features.
HydrophobicFeatureGenerator & operator=(const HydrophobicFeatureGenerator &gen)
Copies the HydrophobicFeatureGenerator instance gen.
HydrophobicFeatureGenerator(const Chem::MolecularGraph &molgraph, Pharmacophore &pharm)
Perceives hydrophobic group features of the molecular graph molgraph and adds them to the pharmacopho...
FeatureGenerator::SharedPointer clone() const
Creates a deep copy of the HydrophobicFeatureGenerator instance.
void setChainHydrophobicityThreshold(double thresh)
Specifies the minimum summed hydrophobicity of the atoms in chain fragments that is required for the ...
void setRingHydrophobicityThreshold(double thresh)
Specifies the minimum summed hydrophobicity of the atoms in small rings that is required for the gene...
void setGroupHydrophobicityThreshold(double thresh)
Specifies the minimum summed hydrophobicity of the atoms in group fragments that is required for the ...
double getChainHydrophobicityThreshold() const
Returns the minimum summed hydrophobicity of the atoms in chain fragments that is required for the ge...
HydrophobicFeatureGenerator(const HydrophobicFeatureGenerator &gen)
Constructs a copy of the HydrophobicFeatureGenerator instance gen.
void setFeatureType(unsigned int type)
Specifies the value of the feature type property that has to be set on newly generated features.
unsigned int getFeatureGeometry() const
Returns the value of the feature geometry property that gets set on newly generated features.
double getRingHydrophobicityThreshold() const
Returns the minimum summed hydrophobicity of the atoms in small rings that is required for the genera...
double getGroupHydrophobicityThreshold() const
Returns the minimum summed hydrophobicity of the atoms in group fragments that is required for the ge...
unsigned int getFeatureType() const
Returns the value of the feature type property that gets set on newly generated features.
double getFeatureTolerance() const
Returns the value of the feature tolerance property that gets set on newly generated features.
Pharm::FeatureGenerator implementation that perceives pharmacophore features by substructure pattern ...
Definition: PatternBasedFeatureGenerator.hpp:59
std::vector< const Chem::Atom * > AtomList
Definition: PatternBasedFeatureGenerator.hpp:162
Abstract base class for mutable containers of Pharm::Feature instances representing a pharmacophore m...
Definition: Pharmacophore.hpp:53
CVector< double, 3 > Vector3D
Bounded 3 element vector holding floating-point values of type double.
Definition: Vector.hpp:3218
constexpr unsigned int SPHERE
Specifies a spherical feature geometry.
Definition: FeatureGeometry.hpp:53
constexpr unsigned int HYDROPHOBIC
Specifies a hydrophobic feature.
Definition: Pharm/FeatureType.hpp:53
Array< double > DArray
Array storing floating-point values of type double.
Definition: Array.hpp:598
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.