Chemical Data Processing Library C++ API - Version 1.2.0
LogSCalculator.hpp
Go to the documentation of this file.
1 /*
2  * LogSCalculator.hpp
3  *
4  * Prediction of aqueous solubility by an atom contribution approach
5  * (T. J. Hou, K. Xia, W. Zhang, X. J. Xu, J. Chem. Inf. Comput. Sci. 2004, 44, 266-275)
6  *
7  * This file is part of the Chemical Data Processing Toolkit
8  *
9  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this library; see the file COPYING. If not, write to
23  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  * Boston, MA 02111-1307, USA.
25  */
26 
32 #ifndef CDPL_MOLPROP_LOGSCALCULATOR_HPP
33 #define CDPL_MOLPROP_LOGSCALCULATOR_HPP
34 
35 #include <cstddef>
36 
39 #include "CDPL/Math/Vector.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Chem
46  {
47 
48  class Atom;
49  }
50 
51  namespace MolProp
52  {
53 
59  {
60 
61  public:
65  static constexpr std::size_t FEATURE_VECTOR_SIZE = 79;
66 
71 
81 
87  double calculate(const Chem::MolecularGraph& molgraph);
88 
94  double getResult() const;
95 
107 
108  private:
109  void init(const Chem::MolecularGraph& molgraph);
110 
111  void countHydrophicCarbons(const Chem::MolecularGraph& molgraph);
112 
113  bool hasTopDistanceBelow4(const Chem::Atom& curr_atom, const Chem::Atom& tgt_atom, const Chem::MolecularGraph& molgraph,
114  const Chem::Atom& prev_atom, std::size_t curr_dist);
115 
116  void calcLogS(const Chem::MolecularGraph& molgraph);
117 
118  Chem::PatternAtomTyper atomTyper;
119  Math::DVector featureVector;
120  double logS;
121  };
122  } // namespace MolProp
123 } // namespace CDPL
124 
125 #endif // CDPL_MOLPROP_LOGSCALCULATOR_HPP
Definition of the preprocessor macro CDPL_MOLPROP_API.
#define CDPL_MOLPROP_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Chem::PatternAtomTyper.
Definition of vector data types.
Atom.
Definition: Atom.hpp:52
MolecularGraph.
Definition: MolecularGraph.hpp:52
PatternAtomTyper.
Definition: PatternAtomTyper.hpp:52
LogSCalculator.
Definition: LogSCalculator.hpp:59
LogSCalculator(const Chem::MolecularGraph &molgraph)
Constructs the LogSCalculator instance and calculates the of the molecular graph molgraph.
double getResult() const
Returns the result of the last calculation.
LogSCalculator()
Constructs the LogSCalculator instance.
double calculate(const Chem::MolecularGraph &molgraph)
Calculates the of the molecular graph molgraph.
const Math::DVector & getFeatureVector() const
Returns the feature count vector of the last calculation.
CDPL_MOLPROP_API double calcLogS(const Chem::MolecularGraph &molgraph)
The namespace of the Chemical Data Processing Library.