ShapeUtils.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005-2006 Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved  @@
00005 //
00006 #ifndef _RD_SHAPE_UTILS_H_20050128_
00007 #define _RD_SHAPE_UTILS_H_20050128_
00008 #include <DataStructs/DiscreteValueVect.h>
00009 #include <vector>
00010 
00011 namespace RDGeom {
00012   class Point3D;
00013   class Transform3D;
00014 }
00015 
00016 namespace RDKit {
00017   class ROMol;
00018   class Conformer;
00019 
00020   namespace MolShapes {
00021 
00022     //! Compute the size of the box that can fit the conformation, and offset of the box
00023     //! from the origin
00024     void computeConfDimsAndOffset(const Conformer &conf, RDGeom::Point3D &dims, 
00025                               RDGeom::Point3D &offSet, const RDGeom::Transform3D *trans=0,
00026                               double padding=2.5);
00027     
00028     //! Compute the a box that will fit the confomer
00029     /*!
00030       \param conf            The conformer of interest
00031       \param leftBottom      Storage for one extremity of the box
00032       \param rightTop        Storage for other extremity of the box
00033       \param trans           Optional transformation to be applied to the atom coordinates
00034       \param padding         Padding added on the sides around the conformer
00035     */
00036     void computeConfBox(const Conformer &conf, RDGeom::Point3D &leftBottom, 
00037                          RDGeom::Point3D &rightTop, const RDGeom::Transform3D *trans=0,
00038                         double padding=2.5);
00039 
00040     //! Compute the union of two boxes
00041     void computeUnionBox(const RDGeom::Point3D &leftBottom1, const RDGeom::Point3D &rightTop1, 
00042                          const RDGeom::Point3D &leftBottom2, const RDGeom::Point3D &rightTop2, 
00043                          RDGeom::Point3D &uLeftBottom, RDGeom::Point3D &uRightTop);
00044 
00045     //! Compute dimensions of a conformer
00046     /*!
00047       \param conf     Conformer of interest
00048       \param padding  Padding added to the atom coordinates on all sides
00049       \param center   Optionally specify the center 
00050       \param ignoreHs if true, ignore the hydrogen atoms in computing the centroid
00051     */
00052     std::vector<double> getConfDimensions(const Conformer &conf, double padding=2.5, 
00053                                           const RDGeom::Point3D *center=0, bool ignoreHs=true);
00054 
00055     //! Compute the shape tanimoto distance between two molecule based on a predefined alignment
00056     /*!
00057       \param mol1         The first molecule of interest
00058       \param mol2         The second molecule of interest
00059       \param confId1      Conformer in the first molecule (defaults to first conformer)
00060       \param confId2      Conformer in the second molecule (defaults to first conformer)
00061       \param gridSpacing  resolution of the grid used to encode the molecular shapes
00062       \param bitsPerPoint number of bit used to encode the occupancy at each grid point
00063                           defaults to two bits per grid point
00064       \param vdwScale     Scaling factor for the radius of the atoms to determine the base radius 
00065                           used in the encoding - grid points inside this sphere carry the maximum occupany
00066       \param stepSize     thickness of the each layer outside the base radius, the occupancy value is decreased 
00067                           from layer to layer from the maximum value
00068       \param maxLayers    the maximum number of layers - defaults to the number allowed the number of bits 
00069                           use per grid point - e.g. two bits per grid point will allow 3 layers
00070       \param ignoreHs     if true, ignore the hydrogen atoms in the shape encoding process
00071      */
00072 
00073     double tanimotoDistance(const ROMol &mol1, const ROMol &mol2, int confId1=-1, int confId2=-1,
00074                             double gridSpacing=0.5, 
00075                             DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE, 
00076                             double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1,
00077                             bool ignoreHs=true);
00078 
00079 
00080     //! Compute the shape tanimoto distance between two conformers based on a predefined alignment
00081     /*!
00082       \param conf1        The first conformer of interest
00083       \param conf2        The second conformer of interest
00084       \param gridSpacing  resolution of the grid used to encode the molecular shapes
00085       \param bitsPerPoint number of bit used to encode the occupancy at each grid point
00086       \param vdwScale     Scaling factor for the radius of the atoms to determine the base radius 
00087                           used in the encoding - grid points inside this sphere carry the maximum occupany
00088       \param stepSize     thickness of the each layer outside the base radius, the occupancy value is decreased 
00089                           from layer to layer from the maximum value
00090       \param maxLayers    the maximum number of layers - defaults to the number allowed the number of bits 
00091                           use per grid point - e.g. two bits per grid point will allow 3 layers
00092       \param ignoreHs     if true, ignore the hydrogen atoms in the shape encoding process
00093      */
00094 
00095     double tanimotoDistance(const Conformer &conf1, const Conformer &conf2, double gridSpacing=0.5, 
00096                             DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE,
00097                             double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1, bool ignoreHs=true);
00098 
00099 
00100     //! Compute the shape protrusion distance between two molecule based on a predefined alignment
00101     /*!
00102       \param mol1         The first molecule of interest
00103       \param mol2         The second molecule of interest
00104       \param confId1      Conformer in the first molecule (defaults to first conformer)
00105       \param confId2      Conformer in the second molecule (defaults to first conformer)
00106       \param gridSpacing  resolution of the grid used to encode the molecular shapes
00107       \param bitsPerPoint number of bit used to encode the occupancy at each grid point
00108                           defaults to two bits per grid point
00109       \param vdwScale     Scaling factor for the radius of the atoms to determine the base radius 
00110                           used in the encoding - grid points inside this sphere carry the maximum occupany
00111       \param stepSize     thickness of the each layer outside the base radius, the occupancy value is decreased 
00112                           from layer to layer from the maximum value
00113       \param maxLayers    the maximum number of layers - defaults to the number allowed the number of bits 
00114                           use per grid point - e.g. two bits per grid point will allow 3 layers
00115       \param ignoreHs     if true, ignore the hydrogen atoms in the shape encoding process
00116       \param allowReordering  if set the order will be automatically updated so that the value calculated
00117                               is the protrusion of the smaller shape from the larger one.
00118      */
00119 
00120     double protrudeDistance(const ROMol &mol1, const ROMol &mol2, int confId1=-1, int confId2=-1,
00121                             double gridSpacing=0.5, 
00122                             DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE, 
00123                             double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1,
00124                             bool ignoreHs=true, bool allowReordering=true);
00125 
00126 
00127     //! Compute the shape protrusion distance between two conformers based on a predefined alignment
00128     /*!
00129       \param conf1        The first conformer of interest
00130       \param conf2        The second conformer of interest
00131       \param gridSpacing  resolution of the grid used to encode the molecular shapes
00132       \param bitsPerPoint number of bit used to encode the occupancy at each grid point
00133       \param vdwScale     Scaling factor for the radius of the atoms to determine the base radius 
00134                           used in the encoding - grid points inside this sphere carry the maximum occupany
00135       \param stepSize     thickness of the each layer outside the base radius, the occupancy value is decreased 
00136                           from layer to layer from the maximum value
00137       \param maxLayers    the maximum number of layers - defaults to the number allowed the number of bits 
00138                           use per grid point - e.g. two bits per grid point will allow 3 layers
00139       \param ignoreHs     if true, ignore the hydrogen atoms in the shape encoding process
00140       \param allowReordering  if set the order will be automatically updated so that the value calculated
00141                               is the protrusion of the smaller shape from the larger one.
00142      */
00143 
00144     double protrudeDistance(const Conformer &conf1, const Conformer &conf2, double gridSpacing=0.5, 
00145                             DiscreteValueVect::DiscreteValueType bitsPerPoint=DiscreteValueVect::TWOBITVALUE,
00146                             double vdwScale=0.8, double stepSize=0.25, int maxLayers=-1, bool ignoreHs=true,
00147                             bool allowReordering=true);
00148     
00149   }
00150 
00151 }
00152 
00153 #endif

Generated on Sat May 24 08:36:32 2008 for RDCode by  doxygen 1.5.3