RDKit: UFF.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
UFF.h
Go to the documentation of this file.
1//
2// Copyright (C) 2015-2018 Greg Landrum
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_UFFCONVENIENCE_H
12#define RD_UFFCONVENIENCE_H
13#include <ForceField/ForceField.h>
14#include <GraphMol/ForceFieldHelpers/FFConvenience.h>
15#include <RDGeneral/RDThreads.h>
16#include "Builder.h"
17
18namespace RDKit {
19class ROMol;
20namespace UFF {
21//! Convenience function for optimizing a molecule using UFF
22/*
23 \param mol the molecule to use
24 \param maxIters the maximum number of force-field iterations
25 \param vdwThresh the threshold to be used in adding van der Waals terms
26 to the force field. Any non-bonded contact whose current
27 distance is greater than \c vdwThresh * the minimum value
28 for that contact will not be included.
29 \param confId the optional conformer id, if this isn't provided, the
30 molecule's
31 default confId will be used.
32 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
33 between
34 fragments
35
36 \return a pair with:
37 first: 0 if the optimization converged, 1 if more iterations are required.
38 second: the energy
39*/
40 inline std::pair<int, double> UFFOptimizeMolecule(
41 ROMol &mol, int maxIters = 1000, double vdwThresh = 10.0, int confId = -1,
42 bool ignoreInterfragInteractions = true) {
43 std::unique_ptr<ForceFields::ForceField> ff(UFF::constructForceField(
44 mol, vdwThresh, confId, ignoreInterfragInteractions));
45 std::pair<int, double> res =
46 ForceFieldsHelper::OptimizeMolecule(*ff, maxIters);
47 return res;
48}
49
50//! Convenience function for optimizing all of a molecule's conformations using
51/// UFF
52/*
53 \param mol the molecule to use
54 \param res vector of (needsMore,energy)
55 \param numThreads the number of simultaneous threads to use (only has an
56 effect if the RDKit is compiled with thread support).
57 If set to zero, the max supported by the system will be
58 used.
59 \param maxIters the maximum number of force-field iterations
60 \param vdwThresh the threshold to be used in adding van der Waals terms
61 to the force field. Any non-bonded contact whose current
62 distance is greater than \c vdwThresh * the minimum value
63 for that contact will not be included.
64 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
65 between
66 fragments
67
68*/
69 inline void UFFOptimizeMoleculeConfs(ROMol &mol,
70 std::vector<std::pair<int, double>> &res,
71 int numThreads = 1, int maxIters = 1000,
72 double vdwThresh = 10.0,
73 bool ignoreInterfragInteractions = true) {
74 std::unique_ptr<ForceFields::ForceField> ff(UFF::constructForceField(
75 mol, vdwThresh, -1, ignoreInterfragInteractions));
76 ForceFieldsHelper::OptimizeMoleculeConfs(mol, *ff, res, numThreads, maxIters);
77}
78} // end of namespace UFF
79} // end of namespace RDKit
80#endif
FFConvenience.h
ForceField.h
RDThreads.h
Builder.h
RDKit::ROMol
Definition ROMol.h:199
export.h
RDKit::ForceFieldsHelper::OptimizeMoleculeConfs
void OptimizeMoleculeConfs(ROMol &mol, ForceFields::ForceField &ff, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000)
Definition FFConvenience.h:115
RDKit::ForceFieldsHelper::OptimizeMolecule
std::pair< int, double > OptimizeMolecule(ForceFields::ForceField &ff, int maxIters=1000)
Definition FFConvenience.h:94
RDKit::UFF
Definition UFF/AtomTyper.h:27
RDKit::UFF::constructForceField
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.
RDKit::UFF::UFFOptimizeMoleculeConfs
void UFFOptimizeMoleculeConfs(ROMol &mol, std::vector< std::pair< int, double > > &res, int numThreads=1, int maxIters=1000, double vdwThresh=10.0, bool ignoreInterfragInteractions=true)
Definition UFF.h:69
RDKit::UFF::UFFOptimizeMolecule
std::pair< int, double > UFFOptimizeMolecule(ROMol &mol, int maxIters=1000, double vdwThresh=10.0, int confId=-1, bool ignoreInterfragInteractions=true)
Convenience function for optimizing a molecule using UFF.
Definition UFF.h:40
RDKit
Std stuff.
Definition Abbreviations.h:19