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 object
58  \param nonBondedThresh the threshold to be used in adding non-bonded terms
59  to the force field. Any non-bonded contact whose current
60  distance is greater than \c nonBondedThresh * the minimum
61  value
62  for that contact will not be included.
63  \param confId the optional conformer id, if this isn't provided, the
64  molecule's
65  default confId will be used.
66  \param ignoreInterfragInteractions if true, nonbonded terms will not be added
67  between
68  fragments
69 
70  \return the new force field. The client is responsible for free'ing this.
71 */
73  ROMol &mol, MMFFMolProperties *mmffMolProperties,
74  double nonBondedThresh = 100.0, int confId = -1,
75  bool ignoreInterfragInteractions = true);
76 
77 namespace Tools {
78 enum { RELATION_1_2 = 0, RELATION_1_3 = 1, RELATION_1_4 = 2, RELATION_1_X = 3 };
79 // these functions are primarily exposed so they can be tested.
80 void setTwoBitCell(boost::shared_array<boost::uint8_t> &res, unsigned int pos,
81  boost::uint8_t value);
82 boost::uint8_t getTwoBitCell(boost::shared_array<boost::uint8_t> &res,
83  unsigned int pos);
84 boost::shared_array<boost::uint8_t> buildNeighborMatrix(const ROMol &mol);
85 void addBonds(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
87 void addAngles(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
89 void addStretchBend(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
91 void addOop(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
93 void addTorsions(const ROMol &mol, MMFFMolProperties *mmffMolProperties,
95  std::string torsionBondSmarts = "[!$(*#*)&!D1]~[!$(*#*)&!D1]");
96 void addVdW(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
98  boost::shared_array<boost::uint8_t> neighborMatrix,
99  double nonBondedThresh = 100.0,
100  bool ignoreInterfragInteractions = true);
101 void addEle(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
103  boost::shared_array<boost::uint8_t> neighborMatrix,
104  double nonBondedThresh = 100.0,
105  bool ignoreInterfragInteractions = true);
106 }
107 }
108 }
109 
110 #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:103
boost::shared_array< boost::uint8_t > buildNeighborMatrix(const ROMol &mol)
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:29
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:57
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)