RDKit
Open-source cheminformatics and machine learning.
MMFF/Builder.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2013 Paolo Tosco
3 //
4 // Copyright (C) 2004-2006 Rational Discovery LLC
5 //
6 // @@ All Rights Reserved @@
7 // This file is part of the RDKit.
8 // The contents are covered by the terms of the BSD license
9 // which is included in the file license.txt, found at the root
10 // of the RDKit source tree.
11 //
12 #ifndef _RD_MMFFBUILDER_H_
13 #define _RD_MMFFBUILDER_H_
14 
15 #include <vector>
16 #include <string>
17 #include <boost/shared_array.hpp>
18 #include <boost/tuple/tuple.hpp>
19 #include <boost/cstdint.hpp>
20 
21 
22 namespace ForceFields {
23  class ForceField;
24 }
25 
26 namespace RDKit {
27  class ROMol;
28  namespace MMFF {
29 
30  //! Builds and returns a MMFF force field for a molecule
31  /*!
32 
33  \param mol the molecule to use
34  \param nonBondedThresh the threshold to be used in adding non-bonded terms
35  to the force field. Any non-bonded contact whose current
36  distance is greater than \c nonBondedThresh * the minimum value
37  for that contact will not be included.
38  \param confId the optional conformer id, if this isn't provided, the molecule's
39  default confId will be used.
40  \param ignoreInterfragInteractions if true, nonbonded terms will not be added between
41  fragments
42 
43  \return the new force field. The client is responsible for free'ing this.
44  */
46  double nonBondedThresh = 100.0, int confId = -1, bool ignoreInterfragInteractions = true);
47 
48 
49  //! Builds and returns a MMFF force field for a molecule
50  /*!
51 
52  \param mol the molecule to use
53  \param mmffMolProperties pointer to a MMFFMolProperties (as obtained by a
54  call to setupMMFFForceField())
55  \param nonBondedThresh the threshold to be used in adding non-bonded terms
56  to the force field. Any non-bonded contact whose current
57  distance is greater than \c nonBondedThresh * 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  */
66  ForceFields::ForceField *constructForceField(ROMol &mol, MMFFMolProperties *mmffMolProperties,
67  double nonBondedThresh = 100.0, int confId = -1, bool ignoreInterfragInteractions = true);
68 
69  namespace Tools {
70  enum {
75  };
76  // these functions are primarily exposed so they can be tested.
77  void setTwoBitCell(boost::shared_array<boost::uint8_t> &res,
78  unsigned int pos, boost::uint8_t value);
79  boost::uint8_t getTwoBitCell
80  (boost::shared_array<boost::uint8_t> &res, unsigned int pos);
81  boost::shared_array<boost::uint8_t> buildNeighborMatrix(const ROMol &mol);
82  void addBonds(const ROMol &mol,
83  MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field);
84  void addAngles(const ROMol &mol,
85  MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field);
86  void addStretchBend(const ROMol &mol,
87  MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field);
88  void addOop(const ROMol &mol,
89  MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field);
90  void addTorsions(const ROMol &mol,
91  MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field,
92  std::string torsionBondSmarts = "[!$(*#*)&!D1]~[!$(*#*)&!D1]");
93  void addVdW(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
94  ForceFields::ForceField *field, boost::shared_array<boost::uint8_t> neighborMatrix,
95  double nonBondedThresh = 100.0, bool ignoreInterfragInteractions = true);
96  void addEle(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
97  ForceFields::ForceField *field, boost::shared_array<boost::uint8_t> neighborMatrix,
98  double nonBondedThresh = 100.0, bool ignoreInterfragInteractions = true);
99  }
100  }
101 }
102 
103 
104 #endif
boost::uint8_t getTwoBitCell(boost::shared_array< boost::uint8_t > &res, unsigned int pos)
void addOop(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
void addTorsions(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field, std::string torsionBondSmarts="[!$(*#*)&!D1]~[!$(*#*)&!D1]")
void setTwoBitCell(boost::shared_array< boost::uint8_t > &res, unsigned int pos, boost::uint8_t value)
void addStretchBend(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:105
boost::shared_array< boost::uint8_t > buildNeighborMatrix(const ROMol &mol)
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
void addAngles(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
void addEle(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field, boost::shared_array< boost::uint8_t > neighborMatrix, double nonBondedThresh=100.0, bool ignoreInterfragInteractions=true)
ForceFields::ForceField * constructForceField(ROMol &mol, MMFFMolProperties *mmffMolProperties, double nonBondedThresh=100.0, int confId=-1, bool ignoreInterfragInteractions=true)
Builds and returns a MMFF force field for a molecule.
A class to store forcefields and handle minimization.
Definition: ForceField.h:56
void addVdW(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field, boost::shared_array< boost::uint8_t > neighborMatrix, double nonBondedThresh=100.0, bool ignoreInterfragInteractions=true)
void addBonds(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)