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, std::vector<double> &logpContribs,
50  std::vector<double> &mrContribs, bool force = false,
51  std::vector<unsigned int> *atomTypes = 0,
52  std::vector<std::string> *atomTypeLabels = 0);
53 
54 //! generate Wildman-Crippen LogP and MR estimates for a molecule
55 /*!
56  Uses an atom-based scheme based on the values in the paper:
57  S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
58 
59  \param mol the molecule of interest
60  \param logp used to return the logp estimate
61  \param mr used to return the MR estimate
62  \param includeHs (optional) if this is true (the default), a
63  copy of \c mol is made and Hs are added to it. If false,
64  Hs that are not explicitly present in the graph will not
65  be included.
66  \param force forces the value to be recalculated instead of
67  pulled from the cache
68 
69 */
70 void calcCrippenDescriptors(const ROMol &mol, double &logp, double &mr,
71  bool includeHs = true, bool force = false);
72 
73 //! a class used to store Crippen parameters
75  public:
76  boost::shared_ptr<const ROMol> dp_pattern;
77  unsigned int idx;
78  std::string label;
79  std::string smarts;
80  double logp;
81  double mr;
83 };
84 
85 const std::string CrippenClogPVersion = crippenVersion;
86 //! calculate the default Wildman-Crippen LogP for a molecule
87 /*!
88  See calcCrippenDescriptors
89  \param mol the molecule of interest
90  */
91 double calcClogP(const ROMol &mol);
92 
93 const std::string CrippenMRVersion = crippenVersion;
94 //! calculate the default Wildman-Crippen MR Estimate for a molecule
95 /*!
96  See calcCrippenDescriptors
97  \param mol the molecule of interest
98  */
99 double calcMR(const ROMol &mol);
100 
101 
102 //! singleton class for retrieving Crippen parameters
103 /*!
104  Use the singleton like this:
105 
106  \verbatim
107  CrippenParamCollection *params=CrippenParamCollection::getParams();
108  \endverbatim
109 
110  If you have your own parameter data, it can be supplied as a string:
111  \verbatim
112  CrippenParamCollection *params=CrippenParamCollection::getParams(myParamData);
113  \endverbatim
114  You are responsible for making sure that the data is in the correct
115  format (see Crippen.cpp for an example).
116 
117 */
119  public:
120  typedef std::vector<CrippenParams> ParamsVect;
121  static const CrippenParamCollection *getParams(
122  const std::string &paramData = "");
123  ParamsVect::const_iterator begin() const { return d_params.begin(); };
124  ParamsVect::const_iterator end() const { return d_params.end(); };
125 
126  CrippenParamCollection(const std::string &paramData);
127 
128  private:
129  ParamsVect d_params; //!< the parameters
130 };
131 } // end of namespace Descriptors
132 }
133 
134 #endif
a class used to store Crippen parameters
Definition: Crippen.h:74
ParamsVect::const_iterator begin() const
Definition: Crippen.h:123
boost::shared_ptr< const ROMol > dp_pattern
Definition: Crippen.h:76
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:120
singleton class for retrieving Crippen parameters
Definition: Crippen.h:118
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:103
double calcClogP(const ROMol &mol)
calculate the default Wildman-Crippen LogP for a molecule
std::string paramData
const std::string CrippenClogPVersion
Definition: Crippen.h:85
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:29
ParamsVect::const_iterator end() const
Definition: Crippen.h:124
double calcMR(const ROMol &mol)
calculate the default Wildman-Crippen MR Estimate for a molecule
const std::string crippenVersion
Definition: Crippen.h:26
const std::string CrippenMRVersion
Definition: Crippen.h:93