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
38  molecule's
39  default confId will be used.
40  \param ignoreInterfragInteractions if true, nonbonded terms will not be added
41  between
42  fragments
43 
44  \return the new force field. The client is responsible for free'ing this.
45 */
47  ROMol &mol, double vdwThresh = 100.0, int confId = -1,
48  bool ignoreInterfragInteractions = true);
49 
50 //! Builds and returns a UFF force field for a molecule
51 /*!
52 
53  \param mol the molecule to use
54  \param params a vector with pointers to the ForceFields::UFF::AtomicParams
55  structures to be used
56  \param vdwThresh the threshold to be used in adding van der Waals terms
57  to the force field. Any non-bonded contact whose current
58  distance is greater than \c vdwThresh * the minimum value
59  for that contact will not be included.
60  \param confId the optional conformer id, if this isn't provided, the
61  molecule's
62  default confId will be used.
63  \param ignoreInterfragInteractions if true, nonbonded terms will not be added
64  between
65  fragments
66 
67  \return the new force field. The client is responsible for free'ing this.
68 */
70  ROMol &mol, const AtomicParamVect &params, double vdwThresh = 100.0,
71  int confId = -1, bool ignoreInterfragInteractions = true);
72 
73 namespace Tools {
74 enum { RELATION_1_2 = 0, RELATION_1_3 = 1, RELATION_1_4 = 2, RELATION_1_X = 3 };
75 // these functions are primarily exposed so they can be tested.
76 void setTwoBitCell(boost::shared_array<boost::uint8_t> &res, unsigned int pos,
77  boost::uint8_t value);
78 boost::uint8_t getTwoBitCell(boost::shared_array<boost::uint8_t> &res,
79  unsigned int pos);
80 boost::shared_array<boost::uint8_t> buildNeighborMatrix(const ROMol &mol);
81 void addBonds(const ROMol &mol, const AtomicParamVect &params,
83 void addAngles(const ROMol &mol, const AtomicParamVect &params,
85 void addNonbonded(const ROMol &mol, int confId, const AtomicParamVect &params,
87  boost::shared_array<boost::uint8_t> neighborMatrix,
88  double vdwThresh = 100.0,
89  bool ignoreInterfragInteractions = true);
90 void addTorsions(const ROMol &mol, const AtomicParamVect &params,
92  std::string torsionBondSmarts = "[!$(*#*)&!D1]~[!$(*#*)&!D1]");
93 void addInversions(const ROMol &mol, const AtomicParamVect &params,
95 }
96 }
97 }
98 
99 #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:103
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:29
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:57
void addAngles(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)