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 <boost/noncopyable.hpp>
22#include <tuple>
23#include <cstdint>
24
25namespace ForceFields {
26class ForceField;
27}
28
29namespace RDKit {
30class ROMol;
31namespace MMFF {
32class MMFFMolProperties;
33
34//! Builds and returns a MMFF force field for a molecule
35/*!
36
37 \param mol the molecule to use
38 \param nonBondedThresh the threshold to be used in adding non-bonded terms
39 to the force field. Any non-bonded contact whose
40 current
41 distance is greater than \c nonBondedThresh * the minimum
42 value
43 for that contact will not be included.
44 \param confId the optional conformer id, if this isn't provided, the
45 molecule's
46 default confId will be used.
47 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
48 between
49 fragments
50
51 \return the new force field. The client is responsible for free'ing this.
52*/
54 ROMol &mol, double nonBondedThresh = 100.0, int confId = -1,
55 bool ignoreInterfragInteractions = true);
56
57//! Builds and returns a MMFF force field for a molecule
58/*!
59
60 \param mol the molecule to use
61 \param mmffMolProperties pointer to a MMFFMolProperties object
62 \param nonBondedThresh the threshold to be used in adding non-bonded terms
63 to the force field. Any non-bonded contact whose current
64 distance is greater than \c nonBondedThresh * the minimum
65 value
66 for that contact will not be included.
67 \param confId the optional conformer id, if this isn't provided, the
68 molecule's
69 default confId will be used.
70 \param ignoreInterfragInteractions if true, nonbonded terms will not be added
71 between
72 fragments
73
74 \return the new force field. The client is responsible for free'ing this.
75*/
78 double nonBondedThresh = 100.0, int confId = -1,
79 bool ignoreInterfragInteractions = true);
80
81namespace Tools {
83 : private boost::noncopyable {
84 public:
85 static const std::string &string() { return ds_string; }
86 static const ROMol *query();
87
88 private:
90 static void create();
91 static const std::string ds_string;
92 static boost::scoped_ptr<const ROMol> ds_instance;
93#ifdef RDK_BUILD_THREADSAFE_SSS
94 static std::once_flag ds_flag;
95#endif
96};
97
99// these functions are primarily exposed so they can be tested.
101 int i, int j);
103 boost::shared_array<std::uint8_t> &res, unsigned int pos,
104 std::uint8_t value);
106 boost::shared_array<std::uint8_t> &res, unsigned int pos);
107RDKIT_FORCEFIELDHELPERS_EXPORT boost::shared_array<std::uint8_t>
126 const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
128 boost::shared_array<std::uint8_t> neighborMatrix,
129 double nonBondedThresh = 100.0, bool ignoreInterfragInteractions = true);
131 const ROMol &mol, int confId, MMFFMolProperties *mmffMolProperties,
133 boost::shared_array<std::uint8_t> neighborMatrix,
134 double nonBondedThresh = 100.0, bool ignoreInterfragInteractions = true);
135} // namespace Tools
136} // namespace MMFF
137} // namespace RDKit
138
139#endif
A class to store forcefields and handle minimization.
Definition ForceField.h:79
static const std::string & string()
#define RDKIT_FORCEFIELDHELPERS_EXPORT
Definition export.h:193
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.
bool rdvalue_is(const RDValue_cast_t)