RDCode: Crippen.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories

# Crippen.h

Go to the documentation of this file.

    00001 //
    00002 //  Copyright (C) 2004-2007 Greg Landrum and Rational Discovery LLC
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006
    00007 /*! \file Crippen.h
    00008
    00009   \brief Use MolDescriptors.h in client code.
    00010
    00011 */
    00012 #ifndef __RD_CRIPPEN_H__
    00013 #define __RD_CRIPPEN_H__
    00014
    00015 #include <string>
    00016 #include <vector>
    00017 #include <boost/smart_ptr.hpp>
    00018
    00019 namespace RDKit {
    00020   class ROMol;
    00021   namespace Descriptors {
    00022     const std::string crippenVersion="1.1.0";
    00023
    00024     //! generate atomic contributions to the Wildman-Crippen LogP and MR
    00025     //! estimates for a molecule
    00026     /*!
    00027       Uses an atom-based scheme based on the values in the paper:
    00028         S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
    00029
    00030       \param mol           the molecule of interest
    00031       \param logpContribs  used to return the logp contributions, must
    00032                            be equal in length to the number of atoms
    00033       \param mrContribs    used to return the MR contributions, must
    00034                            be equal in length to the number of atoms
    00035       \param force         forces the value to be recalculated instead
    00036                            of pulled from the cache
    00037
    00038     */
    00039     void getCrippenAtomContribs(const ROMol &mol,
    00040                                 std::vector<double> &logpContribs,
    00041                                 std::vector<double> &mrContribs,
    00042                                 bool force=false);
    00043
    00044
    00045     //! generate Wildman-Crippen LogP and MR estimates for a molecule
    00046     /*!
    00047       Uses an atom-based scheme based on the values in the paper:
    00048         S. A. Wildman and G. M. Crippen JCICS 39 868-873 (1999)
    00049
    00050       \param mol        the molecule of interest
    00051       \param logp       used to return the logp estimate
    00052       \param mr         used to return the MR estimate
    00053       \param includeHs  (optional) if this is true (the default), a
    00054           copy of \c mol is made and Hs are added to it.  If false,
    00055           Hs that are not explicitly present in the graph will not
    00056           be included.
    00057       \param force      forces the value to be recalculated instead of
    00058                         pulled from the cache
    00059
    00060     */
    00061     void CalcCrippenDescriptors(const ROMol &mol,double &logp,double &mr,
    00062                                 bool includeHs=true,bool force=false);
    00063
    00064     //! a class used to store Crippen parameters
    00065     class CrippenParams {
    00066     public:
    00067       boost::shared_ptr<const ROMol> dp_pattern;
    00068       std::string label;
    00069       std::string smarts;
    00070       double logp;
    00071       double mr;
    00072       ~CrippenParams();
    00073     };
    00074
    00075     //! singleton class for retrieving Crippen parameters
    00076     /*!
    00077       Use the singleton like this:
    00078
    00079       \verbatim
    00080       CrippenParamCollection *params=CrippenParamCollection::getParams();
    00081       \endverbatim
    00082
    00083       If you have your own parameter data, it can be supplied as a string:
    00084       \verbatim
    00085       CrippenParamCollection *params=CrippenParamCollection::getParams(myParamData);
    00086       \endverbatim
    00087       You are responsible for making sure that the data is in the correct
    00088       format (see Crippen.cpp for an example).
    00089
    00090     */
    00091     class CrippenParamCollection {
    00092     public:
    00093       typedef std::vector<CrippenParams> ParamsVect;
    00094       static CrippenParamCollection *getParams(const std::string &paramData="");
    00095       ParamsVect::const_iterator begin() const { return d_params.begin(); };
    00096       ParamsVect::const_iterator end() const { return d_params.end(); };
    00097
    00098     private:
    00099       //! to force this to be a singleton, the constructor must be private
    00100       CrippenParamCollection(const std::string &paramData);
    00101       static class CrippenParamCollection *ds_instance;    //!< the singleton
    00102       ParamsVect d_params;                                 //!< the parameters
    00103     };
    00104   } // end of namespace Descriptors
    00105 }
    00106
    00107 #endif