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 #include <RDGeneral/export.h>
17 #ifndef __RD_CRIPPEN_H__
18 #define __RD_CRIPPEN_H__
19 
20 #include <string>
21 #include <vector>
22 #include <boost/smart_ptr.hpp>
23 
24 namespace RDKit {
25 class ROMol;
26 namespace Descriptors {
27 const std::string crippenVersion = "1.2.0";
28 
29 //! generate atomic contributions to the Wildman-Crippen LogP and MR
30 //! estimates for a molecule
31 /*!
32  Uses an atom-based scheme based on the values in the paper:
33  S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
34 
35  \param mol the molecule of interest
36  \param logpContribs used to return the logp contributions, must
37  be equal in length to the number of atoms
38  \param mrContribs used to return the MR contributions, must
39  be equal in length to the number of atoms
40  \param force forces the value to be recalculated instead
41  of pulled from the cache
42  \param atomTypes if provided will be used to return the indices
43  of the atom types, should be as long as the
44  number of atoms
45  \param atomTypeLabels if provided will be used to return the labels
46  of the atom types, should be as long as the
47  number of atoms
48 
49 */
50 RDKIT_DESCRIPTORS_EXPORT void getCrippenAtomContribs(const ROMol &mol, std::vector<double> &logpContribs,
51  std::vector<double> &mrContribs, bool force = false,
52  std::vector<unsigned int> *atomTypes = 0,
53  std::vector<std::string> *atomTypeLabels = 0);
54 
55 //! generate Wildman-Crippen LogP and MR estimates for a molecule
56 /*!
57  Uses an atom-based scheme based on the values in the paper:
58  S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
59 
60  \param mol the molecule of interest
61  \param logp used to return the logp estimate
62  \param mr used to return the MR estimate
63  \param includeHs (optional) if this is true (the default), a
64  copy of \c mol is made and Hs are added to it. If false,
65  Hs that are not explicitly present in the graph will not
66  be included.
67  \param force forces the value to be recalculated instead of
68  pulled from the cache
69 
70 */
71 RDKIT_DESCRIPTORS_EXPORT void calcCrippenDescriptors(const ROMol &mol, double &logp, double &mr,
72  bool includeHs = true, bool force = false);
73 
74 //! a class used to store Crippen parameters
76  public:
77  boost::shared_ptr<const ROMol> dp_pattern;
78  unsigned int idx;
79  std::string label;
80  std::string smarts;
81  double logp;
82  double mr;
83  ~CrippenParams();
84 };
85 
86 const std::string CrippenClogPVersion = crippenVersion;
87 //! calculate the default Wildman-Crippen LogP for a molecule
88 /*!
89  See calcCrippenDescriptors
90  \param mol the molecule of interest
91  */
92 RDKIT_DESCRIPTORS_EXPORT double calcClogP(const ROMol &mol);
93 
94 const std::string CrippenMRVersion = crippenVersion;
95 //! calculate the default Wildman-Crippen MR Estimate for a molecule
96 /*!
97  See calcCrippenDescriptors
98  \param mol the molecule of interest
99  */
100 RDKIT_DESCRIPTORS_EXPORT double calcMR(const ROMol &mol);
101 
102 
103 //! singleton class for retrieving Crippen parameters
104 /*!
105  Use the singleton like this:
106 
107  \verbatim
108  CrippenParamCollection *params=CrippenParamCollection::getParams();
109  \endverbatim
110 
111  If you have your own parameter data, it can be supplied as a string:
112  \verbatim
113  CrippenParamCollection *params=CrippenParamCollection::getParams(myParamData);
114  \endverbatim
115  You are responsible for making sure that the data is in the correct
116  format (see Crippen.cpp for an example).
117 
118 */
120  public:
121  typedef std::vector<CrippenParams> ParamsVect;
122  static const CrippenParamCollection *getParams(
123  const std::string &paramData = "");
124  ParamsVect::const_iterator begin() const { return d_params.begin(); };
125  ParamsVect::const_iterator end() const { return d_params.end(); };
126 
127  CrippenParamCollection(const std::string &paramData);
128 
129  private:
130  ParamsVect d_params; //!< the parameters
131 };
132 } // end of namespace Descriptors
133 }
134 
135 #endif
a class used to store Crippen parameters
Definition: Crippen.h:75
RDKIT_DESCRIPTORS_EXPORT double calcMR(const ROMol &mol)
calculate the default Wildman-Crippen MR Estimate for a molecule
boost::shared_ptr< const ROMol > dp_pattern
Definition: Crippen.h:77
std::vector< CrippenParams > ParamsVect
Definition: Crippen.h:121
singleton class for retrieving Crippen parameters
Definition: Crippen.h:119
#define RDKIT_DESCRIPTORS_EXPORT
Definition: export.h:138
std::string paramData
ParamsVect::const_iterator begin() const
Definition: Crippen.h:124
const std::string CrippenClogPVersion
Definition: Crippen.h:86
Std stuff.
Definition: Atom.h:30
RDKIT_DESCRIPTORS_EXPORT double calcClogP(const ROMol &mol)
calculate the default Wildman-Crippen LogP for a molecule
ParamsVect::const_iterator end() const
Definition: Crippen.h:125
const std::string crippenVersion
Definition: Crippen.h:27
const std::string CrippenMRVersion
Definition: Crippen.h:94
RDKIT_DESCRIPTORS_EXPORT 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
RDKIT_DESCRIPTORS_EXPORT 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)