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 namespace ForceFields {
22 class ForceField;
23 }
24 
25 namespace RDKit {
26 class ROMol;
27 namespace MMFF {
28 class MMFFMolProperties;
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
36  current
37  distance is greater than \c nonBondedThresh * the minimum
38  value
39  for that contact will not be included.
40  \param confId the optional conformer id, if this isn't provided, the
41  molecule's
42  default confId will be used.
43  \param ignoreInterfragInteractions if true, nonbonded terms will not be added
44  between
45  fragments
46 
47  \return the new force field. The client is responsible for free'ing this.
48 */
50  ROMol &mol, double nonBondedThresh = 100.0, int confId = -1,
51  bool ignoreInterfragInteractions = true);
52 
53 //! Builds and returns a MMFF force field for a molecule
54 /*!
55 
56  \param mol the molecule to use
57  \param mmffMolProperties pointer to a MMFFMolProperties (as obtained by
58  a
59  call to setupMMFFForceField())
60  \param nonBondedThresh the threshold to be used in adding non-bonded terms
61  to the force field. Any non-bonded contact whose current
62  distance is greater than \c nonBondedThresh * the minimum
63  value
64  for that contact will not be included.
65  \param confId the optional conformer id, if this isn't provided, the
66  molecule's
67  default confId will be used.
68  \param ignoreInterfragInteractions if true, nonbonded terms will not be added
69  between
70  fragments
71 
72  \return the new force field. The client is responsible for free'ing this.
73 */
75  ROMol &mol, MMFFMolProperties *mmffMolProperties,
76  double nonBondedThresh = 100.0, int confId = -1,
77  bool ignoreInterfragInteractions = true);
78 
79 namespace Tools {
80 enum { RELATION_1_2 = 0, RELATION_1_3 = 1, RELATION_1_4 = 2, RELATION_1_X = 3 };
81 // these functions are primarily exposed so they can be tested.
82 void setTwoBitCell(boost::shared_array<boost::uint8_t> &res, unsigned int pos,
83  boost::uint8_t value);
84 boost::uint8_t getTwoBitCell(boost::shared_array<boost::uint8_t> &res,
85  unsigned int pos);
86 boost::shared_array<boost::uint8_t> buildNeighborMatrix(const ROMol &mol);
87 void addBonds(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
89 void addAngles(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
91 void addStretchBend(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
93 void addOop(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
95 void addTorsions(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
97  std::string torsionBondSmarts = "[!$(*#*)&!D1]~[!$(*#*)&!D1]");
98 void addVdW(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
100  boost::shared_array<boost::uint8_t> neighborMatrix,
101  double nonBondedThresh = 100.0,
102  bool ignoreInterfragInteractions = true);
103 void addEle(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
105  boost::shared_array<boost::uint8_t> neighborMatrix,
106  double nonBondedThresh = 100.0,
107  bool ignoreInterfragInteractions = true);
108 }
109 }
110 }
111 
112 #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:102
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)