Chemical Data Processing Library C++ API - Version 1.1.1
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
APIPrefix.hpp
Definition of the preprocessor macro CDPL_PHARM_API.
CDPL_PHARM_API
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Pharm::HydrophobicFeatureGenerator::~HydrophobicFeatureGenerator
~HydrophobicFeatureGenerator()
CDPL::Pharm::FeatureGeometry::SPHERE
const unsigned int SPHERE
Definition: FeatureGeometry.hpp:47
CDPL::Pharm::FeatureGenerator::SharedPointer
std::shared_ptr< FeatureGenerator > SharedPointer
Definition: FeatureGenerator.hpp:60
CDPL::Pharm::HydrophobicFeatureGenerator::setChainHydrophobicityThreshold
void setChainHydrophobicityThreshold(double thresh)
Specifies the minimum summed hydrophobicity of the atoms in chain fragments that is required for the ...
CDPL::Pharm::HydrophobicFeatureGenerator::SharedPointer
std::shared_ptr< HydrophobicFeatureGenerator > SharedPointer
Definition: HydrophobicFeatureGenerator.hpp:66
CDPL::Math::Vector3D
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
CDPL::Pharm::HydrophobicFeatureGenerator::setFeatureTolerance
void setFeatureTolerance(double tol)
Specifies the value of the feature tolerance property that has to be set on newly generated features.
CDPL::Pharm::HydrophobicFeatureGenerator::operator=
HydrophobicFeatureGenerator & operator=(const HydrophobicFeatureGenerator &gen)
Copies the HydrophobicFeatureGenerator instance gen.
CDPL::Pharm::HydrophobicFeatureGenerator::setFeatureType
void setFeatureType(unsigned int type)
Specifies the value of the feature type property that has to be set on newly generated features.
CDPL::Pharm::HydrophobicFeatureGenerator::HydrophobicFeatureGenerator
HydrophobicFeatureGenerator()
Constructs the HydrophobicFeatureGenerator instance.
CDPL::Util::BitSet
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
CDPL::Pharm::HydrophobicFeatureGenerator::setGroupHydrophobicityThreshold
void setGroupHydrophobicityThreshold(double thresh)
Specifies the minimum summed hydrophobicity of the atoms in group fragments that is required for the ...
CDPL::Chem::Fragment
Fragment.
Definition: Fragment.hpp:52
CDPL::Pharm::HydrophobicFeatureGenerator::getRingHydrophobicityThreshold
double getRingHydrophobicityThreshold() const
Returns the minimum summed hydrophobicity of the atoms in small rings that is required for the genera...
CDPL::Pharm::HydrophobicFeatureGenerator::setRingHydrophobicityThreshold
void setRingHydrophobicityThreshold(double thresh)
Specifies the minimum summed hydrophobicity of the atoms in small rings that is required for the gene...
CDPL::Pharm::PatternBasedFeatureGenerator
PatternBasedFeatureGenerator.
Definition: PatternBasedFeatureGenerator.hpp:58
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
BitSet.hpp
Definition of the type CDPL::Util::BitSet.
Array.hpp
Definition of the class CDPL::Util::Array.
CDPL::Pharm::HydrophobicFeatureGenerator::getFeatureGeometry
unsigned int getFeatureGeometry() const
Returns the value of the feature geometry property that gets set on newly generated features.
FeatureGeometry.hpp
Definition of constants in namespace CDPL::Pharm::FeatureGeometry.
CDPL::Pharm::HydrophobicFeatureGenerator::HydrophobicFeatureGenerator
HydrophobicFeatureGenerator(const HydrophobicFeatureGenerator &gen)
Constructs a copy of the HydrophobicFeatureGenerator instance gen.
CDPL::Pharm::HydrophobicFeatureGenerator::HydrophobicFeatureGenerator
HydrophobicFeatureGenerator(const Chem::MolecularGraph &molgraph, Pharmacophore &pharm)
Perceives hydrophobic group features of the molecular graph a\ molgraph and adds them to the pharmaco...
CDPL::Chem::Fragment::SharedPointer
std::shared_ptr< Fragment > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Fragment instances.
Definition: Fragment.hpp:61
CDPL::Pharm::Pharmacophore
Pharmacophore.
Definition: Pharmacophore.hpp:48
CDPL::Pharm::HydrophobicFeatureGenerator::clone
FeatureGenerator::SharedPointer clone() const
Fragment.hpp
Definition of the class CDPL::Chem::Fragment.
CDPL::Pharm::HydrophobicFeatureGenerator::getGroupHydrophobicityThreshold
double getGroupHydrophobicityThreshold() const
Returns the minimum summed hydrophobicity of the atoms in group fragments that is required for the ge...
CDPL::Pharm::HydrophobicFeatureGenerator::setFeatureGeometry
void setFeatureGeometry(unsigned int geom)
Specifies the value of the feature geometry property that has to be set on newly generated features.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Pharm::HydrophobicFeatureGenerator::getFeatureTolerance
double getFeatureTolerance() const
Returns the value of the feature tolerance property that gets set on newly generated features.
PatternBasedFeatureGenerator.hpp
Definition of the class CDPL::Pharm::PatternBasedFeatureGenerator.
CDPL::Pharm::HydrophobicFeatureGenerator::getFeatureType
unsigned int getFeatureType() const
Returns the value of the feature type property that gets set on newly generated features.
CDPL::Util::DArray
Array< double > DArray
An array of double precision floating-point numbers.
Definition: Array.hpp:587
CDPL::Pharm::FeatureType::HYDROPHOBIC
const unsigned int HYDROPHOBIC
Definition: Pharm/FeatureType.hpp:47
CDPL::Pharm::HydrophobicFeatureGenerator
HydrophobicFeatureGenerator.
Definition: HydrophobicFeatureGenerator.hpp:55
CDPL::Pharm::Feature
Feature.
Definition: Feature.hpp:48
CDPL::Pharm::HydrophobicFeatureGenerator::getChainHydrophobicityThreshold
double getChainHydrophobicityThreshold() const
Returns the minimum summed hydrophobicity of the atoms in chain fragments that is required for the ge...
FeatureType.hpp
Definition of constants in namespace CDPL::Pharm::FeatureType.
Vector.hpp
Definition of vector data types.