RDKit
Open-source cheminformatics and machine learning.
Crippen.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2007 Greg Landrum and Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 
11 /*! \file Crippen.h
12 
13  \brief Use MolDescriptors.h in client code.
14 
15 */
16 #ifndef __RD_CRIPPEN_H__
17 #define __RD_CRIPPEN_H__
18 
19 #include <string>
20 #include <vector>
21 #include <boost/smart_ptr.hpp>
22 
23 namespace RDKit {
24  class ROMol;
25  namespace Descriptors {
26  const std::string crippenVersion="1.2.0";
27 
28  //! generate atomic contributions to the Wildman-Crippen LogP and MR
29  //! estimates for a molecule
30  /*!
31  Uses an atom-based scheme based on the values in the paper:
32  S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
33 
34  \param mol the molecule of interest
35  \param logpContribs used to return the logp contributions, must
36  be equal in length to the number of atoms
37  \param mrContribs used to return the MR contributions, must
38  be equal in length to the number of atoms
39  \param force forces the value to be recalculated instead
40  of pulled from the cache
41  \param atomTypes if provided will be used to return the indices
42  of the atom types, should be as long as the
43  number of atoms
44  \param atomTypeLabels if provided will be used to return the labels
45  of the atom types, should be as long as the
46  number of atoms
47 
48  */
49  void getCrippenAtomContribs(const ROMol &mol,
50  std::vector<double> &logpContribs,
51  std::vector<double> &mrContribs,
52  bool force=false,
53  std::vector<unsigned int> *atomTypes=0,
54  std::vector<std::string> *atomTypeLabels=0
55  );
56 
57 
58  //! generate Wildman-Crippen LogP and MR estimates for a molecule
59  /*!
60  Uses an atom-based scheme based on the values in the paper:
61  S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
62 
63  \param mol the molecule of interest
64  \param logp used to return the logp estimate
65  \param mr used to return the MR estimate
66  \param includeHs (optional) if this is true (the default), a
67  copy of \c mol is made and Hs are added to it. If false,
68  Hs that are not explicitly present in the graph will not
69  be included.
70  \param force forces the value to be recalculated instead of
71  pulled from the cache
72 
73  */
74  void calcCrippenDescriptors(const ROMol &mol,double &logp,double &mr,
75  bool includeHs=true,bool force=false);
76 
77  //! a class used to store Crippen parameters
78  class CrippenParams {
79  public:
80  boost::shared_ptr<const ROMol> dp_pattern;
81  unsigned int idx;
82  std::string label;
83  std::string smarts;
84  double logp;
85  double mr;
87  };
88 
89  //! singleton class for retrieving Crippen parameters
90  /*!
91  Use the singleton like this:
92 
93  \verbatim
94  CrippenParamCollection *params=CrippenParamCollection::getParams();
95  \endverbatim
96 
97  If you have your own parameter data, it can be supplied as a string:
98  \verbatim
99  CrippenParamCollection *params=CrippenParamCollection::getParams(myParamData);
100  \endverbatim
101  You are responsible for making sure that the data is in the correct
102  format (see Crippen.cpp for an example).
103 
104  */
106  public:
107  typedef std::vector<CrippenParams> ParamsVect;
108  static const CrippenParamCollection *getParams(const std::string &paramData="");
109  ParamsVect::const_iterator begin() const { return d_params.begin(); };
110  ParamsVect::const_iterator end() const { return d_params.end(); };
111 
112  CrippenParamCollection(const std::string &paramData);
113  private:
114  ParamsVect d_params; //!< the parameters
115  };
116  } // end of namespace Descriptors
117 }
118 
119 #endif
a class used to store Crippen parameters
Definition: Crippen.h:78
ParamsVect::const_iterator begin() const
Definition: Crippen.h:109
boost::shared_ptr< const ROMol > dp_pattern
Definition: Crippen.h:80
void getCrippenAtomContribs(const ROMol &mol, std::vector< double > &logpContribs, std::vector< double > &mrContribs, bool force=false, std::vector< unsigned int > *atomTypes=0, std::vector< std::string > *atomTypeLabels=0)
void calcCrippenDescriptors(const ROMol &mol, double &logp, double &mr, bool includeHs=true, bool force=false)
generate Wildman-Crippen LogP and MR estimates for a molecule
std::vector< CrippenParams > ParamsVect
Definition: Crippen.h:107
singleton class for retrieving Crippen parameters
Definition: Crippen.h:105
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:105
std::string paramData
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
ParamsVect::const_iterator end() const
Definition: Crippen.h:110
const std::string crippenVersion
Definition: Crippen.h:26