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 //! singleton class for retrieving Crippen parameters
86 /*!
87  Use the singleton like this:
88 
89  \verbatim
90  CrippenParamCollection *params=CrippenParamCollection::getParams();
91  \endverbatim
92 
93  If you have your own parameter data, it can be supplied as a string:
94  \verbatim
95  CrippenParamCollection *params=CrippenParamCollection::getParams(myParamData);
96  \endverbatim
97  You are responsible for making sure that the data is in the correct
98  format (see Crippen.cpp for an example).
99 
100 */
102  public:
103  typedef std::vector<CrippenParams> ParamsVect;
104  static const CrippenParamCollection *getParams(
105  const std::string &paramData = "");
106  ParamsVect::const_iterator begin() const { return d_params.begin(); };
107  ParamsVect::const_iterator end() const { return d_params.end(); };
108 
109  CrippenParamCollection(const std::string &paramData);
110 
111  private:
112  ParamsVect d_params; //!< the parameters
113 };
114 } // end of namespace Descriptors
115 }
116 
117 #endif
a class used to store Crippen parameters
Definition: Crippen.h:74
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:103
singleton class for retrieving Crippen parameters
Definition: Crippen.h:101
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:102
std::string paramData
ParamsVect::const_iterator begin() const
Definition: Crippen.h:106
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
ParamsVect::const_iterator end() const
Definition: Crippen.h:107
const std::string crippenVersion
Definition: Crippen.h:26