Builder.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2004-2006 Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef _RD_UFFBUILDER_H_
00011 #define _RD_UFFBUILDER_H_
00012 
00013 #include <vector>
00014 #include <string>
00015 #include <boost/shared_array.hpp>
00016 
00017 namespace ForceFields {
00018   class ForceField;
00019   namespace UFF {
00020     class AtomicParams;
00021   }
00022 }
00023 
00024 namespace RDKit {
00025   class ROMol;
00026   namespace UFF {
00027     typedef std::vector<const ForceFields::UFF::AtomicParams *> AtomicParamVect;
00028 
00029     //! Builds and returns a UFF force field for a molecule
00030     /*!
00031       
00032       \param mol        the molecule to use
00033       \param vdwThresh  the threshold to be used in adding van der Waals terms
00034                         to the force field. Any non-bonded contact whose current
00035                         distance is greater than \c vdwThresh * the minimum value
00036                         for that contact will not be included.
00037       \param confId     the optional conformer id, if this isn't provided, the molecule's
00038                         default confId will be used.
00039       \param ignoreInterfragInteractions if true, nonbonded terms will not be added between
00040                                          fragments
00041 
00042       \return the new force field. The client is responsible for free'ing this.
00043     */
00044     ForceFields::ForceField *constructForceField(ROMol &mol,
00045                                                  double vdwThresh=100.0,
00046                                                  int confId=-1,
00047                                                  bool ignoreInterfragInteractions=true);
00048 
00049     //! Builds and returns a UFF force field for a molecule
00050     /*!
00051       
00052       \param mol        the molecule to use
00053       \param params     a vector with pointers to the ForceFields::UFF::AtomicParams
00054                         structures to be used
00055       \param vdwThresh  the threshold to be used in adding van der Waals terms
00056                         to the force field. Any non-bonded contact whose current
00057                         distance is greater than \c vdwThresh * the minimum value
00058                         for that contact will not be included.
00059       \param confId     the optional conformer id, if this isn't provided, the molecule's
00060                         default confId will be used.
00061       \param ignoreInterfragInteractions if true, nonbonded terms will not be added between
00062                                          fragments
00063     
00064       \return the new force field. The client is responsible for free'ing this.
00065     */
00066     ForceFields::ForceField *constructForceField(ROMol &mol,
00067                                                  const AtomicParamVect &params,
00068                                                  double vdwThresh=100.0,
00069                                                  int confId=-1,
00070                                                  bool ignoreInterfragInteractions=true);
00071 
00072     namespace Tools {
00073       // these functions are primarily exposed so they can be tested.
00074       void addBonds(const ROMol &mol,const AtomicParamVect &params,
00075                     ForceFields::ForceField *field);
00076       boost::shared_array<int> buildNeighborMatrix(const ROMol &mol);
00077       void addAngles(const ROMol &mol,const AtomicParamVect &params,
00078                      ForceFields::ForceField *field,boost::shared_array<int> neighborMatrix);
00079       void addNonbonded(const ROMol &mol,int confId, const AtomicParamVect &params,
00080                         ForceFields::ForceField *field,boost::shared_array<int> neighborMatrix,
00081                         double vdwThresh=100.0,bool ignoreInterfragInteractions=true);
00082       void addTorsions(const ROMol &mol,const AtomicParamVect &params,
00083                        ForceFields::ForceField *field,
00084                        std::string torsionBondSmarts="[!$(*#*)&!D1]~[!$(*#*)&!D1]");
00085       //void addInversions(const ROMol &mol,const AtomicParamVect &params,
00086       //ForceFields::ForceField *field);
00087     }
00088   }
00089 }
00090 
00091 
00092 #endif