RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MMFF/Builder.h
Go to the documentation of this file.
1//
2// Copyright (C) 2013-2022 Paolo Tosco and other RDKit contributors
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_MMFFBUILDER_H
12#define RD_MMFFBUILDER_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#include <tuple>
22#include <cstdint>
23
24namespace ForceFields {
25class ForceField;
26}
27
28namespace RDKit {
29class ROMol;
30namespace MMFF {
32
33//! Builds and returns a MMFF force field for a molecule
34/*!
35
36 \param mol the molecule to use
37 \param nonBondedThresh the threshold to be used in adding non-bonded terms
38 to the force field. Any non-bonded contact whose
39 current
40 distance is greater than \c nonBondedThresh * the minimum
41 value
42 for that contact will not be included.
43 \param confId the optional conformer id, if this isn't provided, the
44 molecule's
45 default confId will be used.
46 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
47 between
48 fragments
49
50 \return the new force field. The client is responsible for free'ing this.
51*/
53 ROMol &mol, double nonBondedThresh = 100.0, int confId = -1,
54 bool ignoreInterfragInteractions = true);
55
56//! Builds and returns a MMFF force field for a molecule
57/*!
58
59 \param mol the molecule to use
60 \param mmffMolProperties pointer to a MMFFMolProperties object
61 \param nonBondedThresh the threshold to be used in adding non-bonded terms
62 to the force field. Any non-bonded contact whose current
63 distance is greater than \c nonBondedThresh * the minimum
64 value
65 for that contact will not be included.
66 \param confId the optional conformer id, if this isn't provided, the
67 molecule's
68 default confId will be used.
69 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
70 between
71 fragments
72
73 \return the new force field. The client is responsible for free'ing this.
74*/
76 ROMol &mol, MMFFMolProperties *mmffMolProperties,
77 double nonBondedThresh = 100.0, int confId = -1,
78 bool ignoreInterfragInteractions = true);
79
80namespace Tools {
82 public:
85 delete;
86 static const std::string &string() { return ds_string; }
87 static const ROMol *query();
88
89 private:
91 static void create();
92 static const std::string ds_string;
93 static boost::scoped_ptr<const ROMol> ds_instance;
94#ifdef RDK_BUILD_THREADSAFE_SSS
95 static std::once_flag ds_flag;
96#endif
97};
98
100// these functions are primarily exposed so they can be tested.
101RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int twoBitCellPos(unsigned int nAtoms,
102 int i, int j);
104 boost::shared_array<std::uint8_t> &res, unsigned int pos,
105 std::uint8_t value);
107 boost::shared_array<std::uint8_t> &res, unsigned int pos);
108RDKIT_FORCEFIELDHELPERS_EXPORT boost::shared_array<std::uint8_t>
111 const ROMol &mol, MMFFMolProperties *mmffMolProperties,
114 const ROMol &mol, MMFFMolProperties *mmffMolProperties,
117 const ROMol &mol, MMFFMolProperties *mmffMolProperties,
120 MMFFMolProperties *mmffMolProperties,
123 const ROMol &mol, MMFFMolProperties *mmffMolProperties,
125 const std::string &torsionBondSmarts = DefaultTorsionBondSmarts::string());
127 const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
129 boost::shared_array<std::uint8_t> neighborMatrix,
130 double nonBondedThresh = 100.0, bool ignoreInterfragInteractions = true);
132 const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
134 boost::shared_array<std::uint8_t> neighborMatrix,
135 double nonBondedThresh = 100.0, bool ignoreInterfragInteractions = true);
136} // namespace Tools
137} // namespace MMFF
138} // namespace RDKit
139
140#endif
A class to store forcefields and handle minimization.
Definition ForceField.h:79
static const std::string & string()
DefaultTorsionBondSmarts & operator=(const DefaultTorsionBondSmarts &)=delete
DefaultTorsionBondSmarts(const DefaultTorsionBondSmarts &)=delete
#define RDKIT_FORCEFIELDHELPERS_EXPORT
Definition export.h:261
RDKIT_FORCEFIELDHELPERS_EXPORT void setTwoBitCell(boost::shared_array< std::uint8_t > &res, unsigned int pos, std::uint8_t value)
RDKIT_FORCEFIELDHELPERS_EXPORT void addStretchBend(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT void addTorsions(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field, const std::string &torsionBondSmarts=DefaultTorsionBondSmarts::string())
RDKIT_FORCEFIELDHELPERS_EXPORT void addBonds(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT std::uint8_t getTwoBitCell(boost::shared_array< std::uint8_t > &res, unsigned int pos)
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int twoBitCellPos(unsigned int nAtoms, int i, int j)
RDKIT_FORCEFIELDHELPERS_EXPORT void addOop(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT void addAngles(const ROMol &mol, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field)
RDKIT_FORCEFIELDHELPERS_EXPORT void addVdW(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field, boost::shared_array< std::uint8_t > neighborMatrix, double nonBondedThresh=100.0, bool ignoreInterfragInteractions=true)
RDKIT_FORCEFIELDHELPERS_EXPORT void addEle(const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties, ForceFields::ForceField *field, boost::shared_array< std::uint8_t > neighborMatrix, double nonBondedThresh=100.0, bool ignoreInterfragInteractions=true)
RDKIT_FORCEFIELDHELPERS_EXPORT boost::shared_array< std::uint8_t > buildNeighborMatrix(const ROMol &mol)
RDKIT_FORCEFIELDHELPERS_EXPORT ForceFields::ForceField * constructForceField(ROMol &mol, double nonBondedThresh=100.0, int confId=-1, bool ignoreInterfragInteractions=true)
Builds and returns a MMFF force field for a molecule.
Std stuff.