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