RDKit: Builder.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 #include <boost/scoped_ptr.hpp>
17 #include <boost/thread/once.hpp>
18 #include <boost/noncopyable.hpp>
19
20 namespace ForceFields {
21 class ForceField;
22 namespace UFF {
23 class AtomicParams;
24 }
25 }
26
27 namespace RDKit {
28 class ROMol;
29 namespace UFF {
30 typedef std::vector<const ForceFields::UFF::AtomicParams *> AtomicParamVect;
31
32 //! Builds and returns a UFF force field for a molecule
33 /*!
34
35 \param mol the molecule to use
36 \param vdwThresh the threshold to be used in adding van der Waals terms
37 to the force field. Any non-bonded contact whose current
38 distance is greater than \c vdwThresh * the minimum 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 */
49 ForceFields::ForceField *constructForceField(
50 ROMol &mol, double vdwThresh = 100.0, int confId = -1,
51 bool ignoreInterfragInteractions = true);
52
53 //! Builds and returns a UFF force field for a molecule
54 /*!
55
56 \param mol the molecule to use
57 \param params a vector with pointers to the ForceFields::UFF::AtomicParams
58 structures to be used
59 \param vdwThresh the threshold to be used in adding van der Waals terms
60 to the force field. Any non-bonded contact whose current
61 distance is greater than \c vdwThresh * the minimum 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 */
72 ForceFields::ForceField *constructForceField(
73 ROMol &mol, const AtomicParamVect &params, double vdwThresh = 100.0,
74 int confId = -1, bool ignoreInterfragInteractions = true);
75
76 namespace Tools {
77 class DefaultTorsionBondSmarts : private boost::noncopyable
78 {
79 public:
80 static const std::string &string() {
81 return ds_string;
82 }
83 static const ROMol *query();
84 private:
85 DefaultTorsionBondSmarts() {}
86 static void create();
87 static const std::string ds_string;
88 static boost::scoped_ptr<const ROMol> ds_instance;
89 static boost::once_flag ds_flag;
90 };
91
92 enum { RELATION_1_2 = 0, RELATION_1_3 = 1, RELATION_1_4 = 2, RELATION_1_X = 3 };
93 // these functions are primarily exposed so they can be tested.
94 unsigned int twoBitCellPos(unsigned int nAtoms, int i, int j);
95 void setTwoBitCell(boost::shared_array<boost::uint8_t> &res, unsigned int pos,
96 boost::uint8_t value);
97 boost::uint8_t getTwoBitCell(boost::shared_array<boost::uint8_t> &res,
98 unsigned int pos);
99 boost::shared_array<boost::uint8_t> buildNeighborMatrix(const ROMol &mol);
100 void addBonds(const ROMol &mol, const AtomicParamVect &params,
101 ForceFields::ForceField *field);
102 void addAngles(const ROMol &mol, const AtomicParamVect &params,
103 ForceFields::ForceField *field);
104 void addNonbonded(const ROMol &mol, int confId, const AtomicParamVect &params,
105 ForceFields::ForceField *field,
106 boost::shared_array<boost::uint8_t> neighborMatrix,
107 double vdwThresh = 100.0,
108 bool ignoreInterfragInteractions = true);
109 void addTorsions(const ROMol &mol, const AtomicParamVect &params,
110 ForceFields::ForceField *field,
111 const std::string &torsionBondSmarts =
112 DefaultTorsionBondSmarts::string());
113 void addInversions(const ROMol &mol, const AtomicParamVect &params,
114 ForceFields::ForceField *field);
115 }
116 }
117 }
118
119 #endif
RDKit::UFF::Tools::RELATION_1_X
Definition: UFF/Builder.h:92
RDKit::UFF::Tools::addInversions
void addInversions(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
RDKit::UFF::Tools::buildNeighborMatrix
boost::shared_array< boost::uint8_t > buildNeighborMatrix(const ROMol &mol)
RDKit::UFF::Tools::RELATION_1_3
Definition: UFF/Builder.h:92
RDKit::UFF::constructForceField
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.
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:103
RDKit::UFF::Tools::getTwoBitCell
boost::uint8_t getTwoBitCell(boost::shared_array< boost::uint8_t > &res, unsigned int pos)
RDKit::UFF::Tools::addBonds
void addBonds(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
ForceFields
Definition: TorsionAngleM6.h:23
RDKit::UFF::Tools::RELATION_1_2
Definition: UFF/Builder.h:92
RDKit::UFF::Tools::DefaultTorsionBondSmarts
Definition: UFF/Builder.h:77
RDKit
Std stuff.
Definition: Atom.h:29
RDKit::UFF::Tools::twoBitCellPos
unsigned int twoBitCellPos(unsigned int nAtoms, int i, int j)
RDKit::UFF::Tools::DefaultTorsionBondSmarts::string
static const std::string & string()
Definition: UFF/Builder.h:80
RDKit::UFF::Tools::addNonbonded
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)
RDKit::UFF::AtomicParamVect
std::vector< const ForceFields::UFF::AtomicParams * > AtomicParamVect
Definition: UFF/AtomTyper.h:27
RDKit::UFF::Tools::setTwoBitCell
void setTwoBitCell(boost::shared_array< boost::uint8_t > &res, unsigned int pos, boost::uint8_t value)
RDKit::UFF::Tools::addTorsions
void addTorsions(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field, const std::string &torsionBondSmarts=DefaultTorsionBondSmarts::string())
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition: ForceField.h:57
RDKit::UFF::Tools::addAngles
void addAngles(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
RDKit::UFF::Tools::RELATION_1_4
Definition: UFF/Builder.h:92