RDKit
Open-source cheminformatics and machine learning.
UFF/Builder.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 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 #ifndef _RD_UFFBUILDER_H_
11 #define _RD_UFFBUILDER_H_
12 
13 #include <vector>
14 #include <string>
15 #include <boost/shared_array.hpp>
16 
17 namespace ForceFields {
18  class ForceField;
19  namespace UFF {
20  class AtomicParams;
21  }
22 }
23 
24 namespace RDKit {
25  class ROMol;
26  namespace UFF {
27  typedef std::vector<const ForceFields::UFF::AtomicParams *> AtomicParamVect;
28 
29  //! Builds and returns a UFF force field for a molecule
30  /*!
31 
32  \param mol the molecule to use
33  \param vdwThresh the threshold to be used in adding van der Waals terms
34  to the force field. Any non-bonded contact whose current
35  distance is greater than \c vdwThresh * the minimum value
36  for that contact will not be included.
37  \param confId the optional conformer id, if this isn't provided, the molecule's
38  default confId will be used.
39  \param ignoreInterfragInteractions if true, nonbonded terms will not be added between
40  fragments
41 
42  \return the new force field. The client is responsible for free'ing this.
43  */
45  double vdwThresh=100.0,
46  int confId=-1,
47  bool ignoreInterfragInteractions=true);
48 
49  //! Builds and returns a UFF force field for a molecule
50  /*!
51 
52  \param mol the molecule to use
53  \param params a vector with pointers to the ForceFields::UFF::AtomicParams
54  structures to be used
55  \param vdwThresh the threshold to be used in adding van der Waals terms
56  to the force field. Any non-bonded contact whose current
57  distance is greater than \c vdwThresh * the minimum value
58  for that contact will not be included.
59  \param confId the optional conformer id, if this isn't provided, the molecule's
60  default confId will be used.
61  \param ignoreInterfragInteractions if true, nonbonded terms will not be added between
62  fragments
63 
64  \return the new force field. The client is responsible for free'ing this.
65  */
67  const AtomicParamVect &params,
68  double vdwThresh=100.0,
69  int confId=-1,
70  bool ignoreInterfragInteractions=true);
71 
72  namespace Tools {
73  enum {
78  };
79  // these functions are primarily exposed so they can be tested.
80  void setTwoBitCell(boost::shared_array<boost::uint8_t> &res,
81  unsigned int pos, boost::uint8_t value);
82  boost::uint8_t getTwoBitCell
83  (boost::shared_array<boost::uint8_t> &res, unsigned int pos);
84  boost::shared_array<boost::uint8_t> buildNeighborMatrix(const ROMol &mol);
85  void addBonds(const ROMol &mol,const AtomicParamVect &params,
87  void addAngles(const ROMol &mol,const AtomicParamVect &params,
89  void addNonbonded(const ROMol &mol,int confId, const AtomicParamVect &params,
90  ForceFields::ForceField *field,boost::shared_array<boost::uint8_t> neighborMatrix,
91  double vdwThresh=100.0,bool ignoreInterfragInteractions=true);
92  void addTorsions(const ROMol &mol,const AtomicParamVect &params,
94  std::string torsionBondSmarts="[!$(*#*)&!D1]~[!$(*#*)&!D1]");
95  void addInversions(const ROMol &mol,const AtomicParamVect &params,
97  }
98  }
99 }
100 
101 
102 #endif
void addInversions(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
boost::shared_array< boost::uint8_t > buildNeighborMatrix(const ROMol &mol)
ForceFields::ForceField * constructForceField(ROMol &mol, const AtomicParamVect &params, double vdwThresh=100.0, int confId=-1, bool ignoreInterfragInteractions=true)
Builds and returns a UFF force field for a molecule.
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:105
boost::uint8_t getTwoBitCell(boost::shared_array< boost::uint8_t > &res, unsigned int pos)
void addBonds(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
void addTorsions(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field, std::string torsionBondSmarts="[!$(*#*)&!D1]~[!$(*#*)&!D1]")
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
void addNonbonded(const ROMol &mol, int confId, const AtomicParamVect &params, ForceFields::ForceField *field, boost::shared_array< boost::uint8_t > neighborMatrix, double vdwThresh=100.0, bool ignoreInterfragInteractions=true)
std::vector< const ForceFields::UFF::AtomicParams * > AtomicParamVect
Definition: UFF/AtomTyper.h:27
void setTwoBitCell(boost::shared_array< boost::uint8_t > &res, unsigned int pos, boost::uint8_t value)
A class to store forcefields and handle minimization.
Definition: ForceField.h:56
void addAngles(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)