Chemical Data Processing Library C++ API - Version 1.2.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 
55  {
56 
57  public:
58  static constexpr double DEF_HYD_THRESHOLD_RING = 2.0;
59  static constexpr double DEF_HYD_THRESHOLD_CHAIN = 0.8;
60  static constexpr double DEF_HYD_THRESHOLD_GROUP = 0.8;
61 
62  static constexpr double DEF_FEATURE_TOL = 1.5;
63  static constexpr unsigned int DEF_FEATURE_TYPE = FeatureType::HYDROPHOBIC;
64  static constexpr unsigned int DEF_FEATURE_GEOM = FeatureGeometry::SPHERE;
65 
66  typedef std::shared_ptr<HydrophobicFeatureGenerator> SharedPointer;
67 
72 
78 
86 
91 
98  void setFeatureType(unsigned int type);
99 
105  unsigned int getFeatureType() const;
106 
113  void setFeatureTolerance(double tol);
114 
120  double getFeatureTolerance() const;
121 
128  void setFeatureGeometry(unsigned int geom);
129 
135  unsigned int getFeatureGeometry() const;
136 
143  void setRingHydrophobicityThreshold(double thresh);
144 
151 
158  void setChainHydrophobicityThreshold(double thresh);
159 
166 
173  void setGroupHydrophobicityThreshold(double thresh);
174 
181 
188 
190 
191  private:
192  void addNonPatternFeatures(const Chem::MolecularGraph&, Pharmacophore&);
193 
194  void init(const Chem::MolecularGraph&);
195 
196  void genRingFeatures(Pharmacophore&);
197  void genGroupFeatures(Pharmacophore&);
198  void genChainFeatures(Pharmacophore&);
199 
200  void extractChain(const Chem::Atom&);
201  void processChain(Pharmacophore&);
202 
203  Feature& emitFeature(const AtomList&, Pharmacophore&, const Chem::Fragment::SharedPointer&,
204  bool = true) const;
205 
206  bool isHydrophobicRing(const Chem::Fragment&);
207  bool hasSubstWithMoreThan2Atoms(const Chem::Atom&, const Chem::Fragment&, bool) const;
208 
209  double calcHydWeightedCentroid(const AtomList&, Math::Vector3D&) const;
210 
211  void getAtomHydrophobicities();
212 
213  void createAtomMask(const AtomList&, Util::BitSet&) const;
214  double calcSummedHydrophobicity(const AtomList& alist) const;
215 
216  Chem::Fragment::SharedPointer makeFragment(const AtomList&) const;
217 
218  bool isChainEndAtom(const Chem::Atom&) const;
219 
220  const Chem::MolecularGraph* molGraph;
221  Util::BitSet procAtomMask;
222  Util::BitSet hAtomMask;
223  Util::BitSet tmpAtomMask;
224  unsigned int featureType;
225  double featureTol;
226  unsigned int featureGeom;
227  double hydThreshRing;
228  double hydThreshChain;
229  double hydThreshGroup;
230  Util::DArray atomHydTable;
231  AtomList featureAtoms;
232  AtomList chainAtoms;
233  };
234  } // namespace Pharm
235 } // namespace CDPL
236 
237 #endif // CDPL_PHARM_HYDROPHOBICFEATUREGENERATOR_HPP
Definition of the class CDPL::Util::Array.
Definition of the type CDPL::Util::BitSet.
Definition of constants in namespace CDPL::Pharm::FeatureGeometry.
Definition of the class CDPL::Chem::Fragment.
Definition of the 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.
Atom.
Definition: Atom.hpp:52
Fragment.
Definition: Fragment.hpp:52
std::shared_ptr< Fragment > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Fragment instances.
Definition: Fragment.hpp:61
MolecularGraph.
Definition: MolecularGraph.hpp:52
std::shared_ptr< FeatureGenerator > SharedPointer
Definition: FeatureGenerator.hpp:60
Feature.
Definition: Feature.hpp:48
HydrophobicFeatureGenerator.
Definition: HydrophobicFeatureGenerator.hpp:55
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
Definition: HydrophobicFeatureGenerator.hpp:66
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 a\ molgraph and adds them to the pharmaco...
FeatureGenerator::SharedPointer clone() const
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.
PatternBasedFeatureGenerator.
Definition: PatternBasedFeatureGenerator.hpp:58
std::vector< const Chem::Atom * > AtomList
Definition: PatternBasedFeatureGenerator.hpp:134
Pharmacophore.
Definition: Pharmacophore.hpp:48
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
constexpr unsigned int SPHERE
Definition: FeatureGeometry.hpp:47
constexpr unsigned int HYDROPHOBIC
Definition: Pharm/FeatureType.hpp:47
Array< double > DArray
An array of double precision floating-point numbers.
Definition: Array.hpp:587
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.