RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
UFF/Builder.h
Go to the documentation of this file.
1//
2// Copyright (C) 2004-2018 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#include <RDGeneral/export.h>
11#ifndef RD_UFFBUILDER_H
12#define RD_UFFBUILDER_H
13
14#include <vector>
15#include <string>
16#include <boost/shared_array.hpp>
17#include <boost/scoped_ptr.hpp>
18#ifdef RDK_BUILD_THREADSAFE_SSS
19#include <mutex>
20#endif
21
22namespace ForceFields {
23class ForceField;
24namespace UFF {
25class AtomicParams;
26}
27} // namespace ForceFields
28
29namespace RDKit {
30class ROMol;
31namespace UFF {
32typedef std::vector<const ForceFields::UFF::AtomicParams *> AtomicParamVect;
33
34//! Builds and returns a UFF force field for a molecule
35/*!
36
37 \param mol the molecule to use
38 \param vdwThresh the threshold to be used in adding van der Waals terms
39 to the force field. Any non-bonded contact whose current
40 distance is greater than \c vdwThresh * the minimum value
41 for that contact will not be included.
42 \param confId the optional conformer id, if this isn't provided, the
43 molecule's
44 default confId will be used.
45 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
46 between
47 fragments
48
49 \return the new force field. The client is responsible for free'ing this.
50*/
52 ROMol &mol, double vdwThresh = 100.0, int confId = -1,
53 bool ignoreInterfragInteractions = true);
54
55//! Builds and returns a UFF force field for a molecule
56/*!
57
58 \param mol the molecule to use
59 \param params a vector with pointers to the ForceFields::UFF::AtomicParams
60 structures to be used
61 \param vdwThresh the threshold to be used in adding van der Waals terms
62 to the force field. Any non-bonded contact whose current
63 distance is greater than \c vdwThresh * the minimum 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, const AtomicParamVect &params, double vdwThresh = 100.0,
76 int confId = -1, bool ignoreInterfragInteractions = true);
77
78namespace Tools {
80 public:
83 delete;
84 static const std::string &string() { return ds_string; }
85 static const ROMol *query();
86
87 private:
89 static void create();
90 static const std::string ds_string;
91 static boost::scoped_ptr<const ROMol> ds_instance;
92#ifdef RDK_BUILD_THREADSAFE_SSS
93 static std::once_flag ds_flag;
94#endif
95};
96
98// these functions are primarily exposed so they can be tested.
99RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int twoBitCellPos(unsigned int nAtoms,
100 int i, int j);
102 boost::shared_array<std::uint8_t> &res, unsigned int pos,
103 std::uint8_t value);
105 boost::shared_array<std::uint8_t> &res, unsigned int pos);
106RDKIT_FORCEFIELDHELPERS_EXPORT boost::shared_array<std::uint8_t>
109 const AtomicParamVect &params,
112 const AtomicParamVect &params,
115 const ROMol &mol, int confId, const AtomicParamVect &params,
117 boost::shared_array<std::uint8_t> neighborMatrix, double vdwThresh = 100.0,
118 bool ignoreInterfragInteractions = true);
120 const ROMol &mol, const AtomicParamVect &params,
122 const std::string &torsionBondSmarts = DefaultTorsionBondSmarts::string());
124 const ROMol &mol, const AtomicParamVect &params,
126} // namespace Tools
127} // namespace UFF
128} // namespace RDKit
129
130#endif
A class to store forcefields and handle minimization.
Definition ForceField.h:79
class to store atomic parameters for the Universal Force Field
Definition UFF/Params.h:68
DefaultTorsionBondSmarts(const DefaultTorsionBondSmarts &)=delete
DefaultTorsionBondSmarts & operator=(const DefaultTorsionBondSmarts &)=delete
static const std::string & string()
Definition UFF/Builder.h:84
#define RDKIT_FORCEFIELDHELPERS_EXPORT
Definition export.h:261
RDKIT_FORCEFIELDHELPERS_EXPORT boost::shared_array< std::uint8_t > buildNeighborMatrix(const ROMol &mol)
RDKIT_FORCEFIELDHELPERS_EXPORT void addNonbonded(const ROMol &mol, int confId, const AtomicParamVect &params, ForceFields::ForceField *field, boost::shared_array< std::uint8_t > neighborMatrix, double vdwThresh=100.0, bool ignoreInterfragInteractions=true)
RDKIT_FORCEFIELDHELPERS_EXPORT void setTwoBitCell(boost::shared_array< std::uint8_t > &res, unsigned int pos, std::uint8_t value)
RDKIT_FORCEFIELDHELPERS_EXPORT std::uint8_t getTwoBitCell(boost::shared_array< std::uint8_t > &res, unsigned int pos)
RDKIT_FORCEFIELDHELPERS_EXPORT void addTorsions(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field, const std::string &torsionBondSmarts=DefaultTorsionBondSmarts::string())
RDKIT_FORCEFIELDHELPERS_EXPORT void addAngles(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int twoBitCellPos(unsigned int nAtoms, int i, int j)
RDKIT_FORCEFIELDHELPERS_EXPORT void addInversions(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT void addBonds(const ROMol &mol, const AtomicParamVect &params, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT ForceFields::ForceField * constructForceField(ROMol &mol, double vdwThresh=100.0, int confId=-1, bool ignoreInterfragInteractions=true)
Builds and returns a UFF force field for a molecule.
std::vector< const ForceFields::UFF::AtomicParams * > AtomicParamVect
Std stuff.