Embedder.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 #ifndef _RD_EMBEDDER_H_
00008 #define _RD_EMBEDDER_H_
00009 
00010 #include <GraphMol/ROMol.h>
00011 
00012 namespace RDKit {
00013   namespace DGeomHelpers {
00014     
00015     //! Compute an embedding (in 3D) for the specified molecule using Distance Geometry
00016     /*!
00017       The following operations are performed (in order) here:
00018        -# Build a distance bounds matrix based on the topology, including 1-5
00019           distances but not VDW scaling
00020        -# Triangle smooth this bounds matrix
00021        -# If step 2 fails - repeat step 1, this time without 1-5 bounds and with vdW
00022           scaling, and repeat step 2
00023        -# Pick a distance matrix at random using the bounds matrix
00024        -# Compute initial coordinates from the distance matrix
00025        -# Repeat steps 3 and 4 until maxIterations is reached or embedding is successful
00026        -# Adjust initial coordinates by minimizing a Distance Violation error function
00027       
00028       \param mol            Molecule of interest
00029       \param maxIterations  Max. number of times the embedding will be tried if coordinates are 
00030                             not obtained successfully
00031       \param seed           provides a seed for the random number generator (so that the same
00032                             coordinates can be obtained for a molecule on multiple runs)
00033                             If negative, the RNG will not be seeded.
00034       \param clearConfs     Clear all existing conformations on the molecule
00035       \param useRandomCoords  Start the embedding from random coordinates instead of
00036                               using eigenvalues of the distance matrix.
00037       \param boxSizeMult    Determines the size of the box that is used for
00038                             random coordinates. If this is a positive number, the 
00039                             side length will equal the largest element of the distance
00040                             matrix times \c boxSizeMult. If this is a negative number,
00041                             the side length will equal \c -boxSizeMult (i.e. independent
00042                             of the elements of the distance matrix).
00043       \param randNegEig     Picks coordinates at random when a embedding process produces
00044                             negative eigenvalues
00045       \param numZeroFail    Fail embedding if we find this many or more zero eigenvalues
00046                             (within a tolerance)
00047       \param optimizerForceTol set the tolerance on forces in the distgeom optimizer
00048                                (this shouldn't normally be altered in client code).
00049 
00050       \param basinThresh    set the basin threshold for the DGeom force field,
00051                             (this shouldn't normally be altered in client code).
00052 
00053       \return ID of the conformations added to the molecule, -1 if the emdedding failed
00054     */
00055     int EmbedMolecule(ROMol &mol, unsigned int maxIterations=30, int seed=-1,
00056                       bool clearConfs=true,
00057                       bool useRandomCoords=false,double boxSizeMult=2.0,
00058                       bool randNegEig=true,
00059                       unsigned int numZeroFail=1,double optimizerForceTol=1e-3,
00060                       double basinThresh=5.0);
00061 
00062     //*! Embed multiple conformations for a molecule
00063     /*!
00064       This is kind of equivalent to calling EmbedMolecule multiple times - just that the bounds
00065       matrix is computed only once from the topology
00066 
00067       \param mol            Molecule of interest
00068       \param numConfs       Number of conformations to be generated
00069       \param maxIterations  Max. number of times the embedding will be tried if coordinates are 
00070                             not obtained successfully
00071       \param seed           provides a seed for the random number generator (so that the same
00072                             coordinates can be obtained for a molecule on multiple runs).
00073                             If negative, the RNG will not be seeded.
00074       \param clearConfs     Clear all existing conformations on the molecule
00075       \param useRandomCoords  Start the embedding from random coordinates instead of
00076                               using eigenvalues of the distance matrix.
00077       \param boxSizeMult    Determines the size of the box that is used for
00078                             random coordinates. If this is a positive number, the 
00079                             side length will equal the largest element of the distance
00080                             matrix times \c boxSizeMult. If this is a negative number,
00081                             the side length will equal \c -boxSizeMult (i.e. independent
00082                             of the elements of the distance matrix).
00083       \param randNegEig     Picks coordinates at random when a embedding process produces
00084                             negative eigenvalues
00085       \param numZeroFail    Fail embedding if we find this many or more zero eigenvalues
00086                             (within a tolerance)
00087       \param optimizerForceTol set the tolerance on forces in the DGeom optimizer
00088                                (this shouldn't normally be altered in client code).
00089       \param basinThresh    set the basin threshold for the DGeom force field,
00090                             (this shouldn't normally be altered in client code).
00091 
00092       \param pruneRmsThresh Retain only the conformations out of 'numConfs' after embedding that are
00093                             at least this far apart from each other. RMSD is computed on the heavy atoms.
00094                             Prunining is greedy; i.e. the first embedded conformation is retained and from
00095                             then on only those that are atleast pruneRmsThresh away from already 
00096                             retained conformations are kept. The pruning is done after embedding and 
00097                             bounds violation minimization. No pruning by default.
00098 
00099       \return an INT_VECT of conformer ids
00100 
00101     */
00102     INT_VECT EmbedMultipleConfs(ROMol &mol, unsigned int numConfs=10,
00103                                 unsigned int maxIterations=30, 
00104                                 int seed=-1, bool clearConfs=true, 
00105                                 bool useRandomCoords=false,double boxSizeMult=2.0,
00106                                 bool randNegEig=true, unsigned int numZeroFail=1,
00107                                 double optimizerForceTol=1e-3,double basinThresh=5.0,
00108                                 double pruneRmsThresh=-1.0);
00109   }
00110 }
00111 
00112 #endif

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