RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MMFF/AtomTyper.h
Go to the documentation of this file.
1//
2// Copyright (C) 2013-2016 Paolo Tosco
3//
4// Copyright (C) 2004-2006 Rational Discovery LLC
5//
6// @@ All Rights Reserved @@
7// This file is part of the RDKit.
8// The contents are covered by the terms of the BSD license
9// which is included in the file license.txt, found at the root
10// of the RDKit source tree.
11//
12#include <RDGeneral/export.h>
13#ifndef _RD_MMFFATOMTYPER_H__
14#define _RD_MMFFATOMTYPER_H__
15
16#include <vector>
17#include <string>
19#include <cstdint>
20
21namespace RDKit {
22class ROMol;
23class RWMol;
24class Atom;
25class Bond;
26
27namespace MMFF {
28
54
55class RingMembershipSize;
56using namespace ForceFields::MMFF;
65
66typedef boost::shared_ptr<MMFFAtomProperties> MMFFAtomPropertiesPtr;
67enum {
70};
71enum {
75};
77 public:
78 MMFFMolProperties(ROMol &mol, const std::string &mmffVariant = "MMFF94",
79 std::uint8_t verbosity = MMFF_VERBOSITY_NONE,
80 std::ostream &oStream = std::cout);
81 ~MMFFMolProperties() = default;
82 unsigned int getMMFFBondType(const Bond *bond);
83 unsigned int getMMFFAngleType(const ROMol &mol, const unsigned int idx1,
84 const unsigned int idx2,
85 const unsigned int idx3);
86 const std::pair<unsigned int, unsigned int> getMMFFTorsionType(
87 const ROMol &mol, const unsigned int idx1, const unsigned int idx2,
88 const unsigned int idx3, const unsigned int idx4);
89 void computeMMFFCharges(const ROMol &mol);
91 const ROMol &mol, unsigned int idx2, unsigned int idx3);
93 const ROMol &mol, const Bond *bond);
94 std::uint8_t getMMFFAtomType(const unsigned int idx) {
95 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
96
97 return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffAtomType;
98 }
99 double getMMFFFormalCharge(const unsigned int idx) {
100 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
101
102 return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffFormalCharge;
103 }
104 double getMMFFPartialCharge(const unsigned int idx) {
105 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
106
107 return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffPartialCharge;
108 }
109 void setMMFFBondTerm(const bool state) { this->d_bondTerm = state; }
110 bool getMMFFBondTerm() { return this->d_bondTerm; }
111 void setMMFFAngleTerm(const bool state) { this->d_angleTerm = state; }
112 bool getMMFFAngleTerm() { return this->d_angleTerm; }
113 void setMMFFStretchBendTerm(const bool state) {
114 this->d_stretchBendTerm = state;
115 }
116 bool getMMFFStretchBendTerm() { return this->d_stretchBendTerm; }
117 void setMMFFOopTerm(const bool state) { this->d_oopTerm = state; }
118 bool getMMFFOopTerm() { return this->d_oopTerm; }
119 void setMMFFTorsionTerm(const bool state) { this->d_torsionTerm = state; }
120 bool getMMFFTorsionTerm() { return this->d_torsionTerm; }
121 void setMMFFVdWTerm(const bool state) { this->d_vdWTerm = state; }
122 bool getMMFFVdWTerm() { return this->d_vdWTerm; }
123 void setMMFFEleTerm(const bool state) { this->d_eleTerm = state; }
124 bool getMMFFEleTerm() { return this->d_eleTerm; }
125 void setMMFFVariant(const std::string &mmffVariant) {
126 PRECONDITION((mmffVariant == "MMFF94") || (mmffVariant == "MMFF94s"),
127 "bad MMFF variant");
128
129 this->d_mmffs = mmffVariant == "MMFF94s";
130 }
131 const std::string getMMFFVariant() {
132 return (this->d_mmffs ? "MMFF94s" : "MMFF94");
133 }
134 void setMMFFDielectricConstant(const double dielConst) {
135 PRECONDITION(dielConst > 0.0, "bad dielectric constant");
136
137 this->d_dielConst = dielConst;
138 }
139 double getMMFFDielectricConstant() { return this->d_dielConst; }
140 void setMMFFDielectricModel(std::uint8_t dielModel) {
141 this->d_dielModel = dielModel;
142 }
143 std::uint8_t getMMFFDielectricModel() { return this->d_dielModel; }
144 void setMMFFVerbosity(std::uint8_t verbosity) {
145 this->d_verbosity = verbosity;
146 }
147 std::uint8_t getMMFFVerbosity() { return this->d_verbosity; }
148 void setMMFFOStream(std::ostream *oStream) { this->d_oStream = oStream; }
149 std::ostream &getMMFFOStream() { return *(this->d_oStream); }
150 bool isValid() { return d_valid; }
151 bool getMMFFBondStretchParams(const ROMol &mol, const unsigned int idx1,
152 const unsigned int idx2, unsigned int &bondType,
153 MMFFBond &mmffBondStretchParams);
154 bool getMMFFAngleBendParams(const ROMol &mol, const unsigned int idx1,
155 const unsigned int idx2, const unsigned int idx3,
156 unsigned int &angleType,
157 MMFFAngle &mmffAngleBendParams);
158 bool getMMFFStretchBendParams(const ROMol &mol, const unsigned int idx1,
159 const unsigned int idx2,
160 const unsigned int idx3,
161 unsigned int &stretchBendType,
162 MMFFStbn &mmffStretchBendParams,
163 MMFFBond mmffBondStretchParams[2],
164 MMFFAngle &mmffAngleBendParams);
165 bool getMMFFTorsionParams(const ROMol &mol, const unsigned int idx1,
166 const unsigned int idx2, const unsigned int idx3,
167 const unsigned int idx4, unsigned int &torsionType,
168 MMFFTor &mmffTorsionParams);
169 bool getMMFFOopBendParams(const ROMol &mol, const unsigned int idx1,
170 const unsigned int idx2, const unsigned int idx3,
171 const unsigned int idx4,
172 MMFFOop &mmffOopBendParams);
173 bool getMMFFVdWParams(const unsigned int idx1, const unsigned int idx2,
174 MMFFVdWRijstarEps &mmffVdWParams);
175
176 private:
177 void setMMFFHeavyAtomType(const RingMembershipSize &rmSize, const Atom *atom);
178 void setMMFFHydrogenType(const Atom *atom);
179 void setMMFFFormalCharge(const unsigned int idx, const double fChg) {
180 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
181
182 this->d_MMFFAtomPropertiesPtrVect[idx]->mmffFormalCharge = fChg;
183 }
184 void setMMFFPartialCharge(const unsigned int idx, const double pChg) {
185 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
186
187 this->d_MMFFAtomPropertiesPtrVect[idx]->mmffPartialCharge = pChg;
188 }
189 bool d_valid;
190 bool d_mmffs;
191 bool d_bondTerm;
192 bool d_angleTerm;
193 bool d_stretchBendTerm;
194 bool d_oopTerm;
195 bool d_torsionTerm;
196 bool d_vdWTerm;
197 bool d_eleTerm;
198 double d_dielConst; //!< the dielectric constant
199 std::uint8_t d_dielModel; //!< the dielectric model (1 = constant, 2 =
200 // distance-dependent)
201 std::uint8_t d_verbosity;
202 std::ostream *d_oStream;
203 std::vector<MMFFAtomPropertiesPtr> d_MMFFAtomPropertiesPtrVect;
204};
206 const ROMol &mol, const unsigned int idx1, const unsigned int idx2,
207 const unsigned int idx3);
209 const ROMol &mol, const unsigned int idx1, const unsigned int idx2,
210 const unsigned int idx3, const unsigned int idx4);
212 const ROMol &mol, const INT_VECT &ringIndxVect);
214 const Atom *atom, const unsigned int ringSize);
217 const ROMol &mol, const unsigned int idx1, const unsigned int idx2);
219 const ROMol &mol, const unsigned int ringSize, const unsigned int numAtoms,
220 ...);
223 const unsigned int angleType, const unsigned int bondType1,
224 const unsigned int bondType2);
226 const int atomicNum);
229 const ROMol &mol, const ForceFields::MMFF::MMFFAngle *oldMMFFAngleParams,
230 const ForceFields::MMFF::MMFFProp *mmffPropParamsCentralAtom,
231 const ForceFields::MMFF::MMFFBond *mmffBondParams1,
232 const ForceFields::MMFF::MMFFBond *mmffBondParams2, unsigned int idx1,
233 unsigned int idx2, unsigned int idx3);
234} // namespace MMFF
235} // namespace RDKit
236
237#endif
#define URANGE_CHECK(x, hi)
Definition Invariant.h:141
#define PRECONDITION(expr, mess)
Definition Invariant.h:108
class to store MMFF parameters for angle bending
class to store MMFF parameters for bond stretching
Definition MMFF/Params.h:80
class to store MMFF parameters for out-of-plane bending
class to store MMFF Properties
Definition MMFF/Params.h:53
class to store MMFF parameters for stretch-bending
class to store MMFF parameters for torsions
The class for representing atoms.
Definition Atom.h:74
class for representing a bond
Definition Bond.h:46
bool getMMFFStretchBendParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, unsigned int &stretchBendType, MMFFStbn &mmffStretchBendParams, MMFFBond mmffBondStretchParams[2], MMFFAngle &mmffAngleBendParams)
void setMMFFStretchBendTerm(const bool state)
void setMMFFOopTerm(const bool state)
bool getMMFFVdWParams(const unsigned int idx1, const unsigned int idx2, MMFFVdWRijstarEps &mmffVdWParams)
void setMMFFVariant(const std::string &mmffVariant)
void setMMFFDielectricModel(std::uint8_t dielModel)
bool getMMFFBondStretchParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, unsigned int &bondType, MMFFBond &mmffBondStretchParams)
bool getMMFFAngleBendParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, unsigned int &angleType, MMFFAngle &mmffAngleBendParams)
unsigned int getMMFFAngleType(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3)
std::uint8_t getMMFFAtomType(const unsigned int idx)
unsigned int getMMFFBondType(const Bond *bond)
void setMMFFBondTerm(const bool state)
void setMMFFVerbosity(std::uint8_t verbosity)
const ForceFields::MMFF::MMFFBond * getMMFFBondStretchEmpiricalRuleParams(const ROMol &mol, const Bond *bond)
void computeMMFFCharges(const ROMol &mol)
void setMMFFTorsionTerm(const bool state)
void setMMFFEleTerm(const bool state)
void setMMFFDielectricConstant(const double dielConst)
void setMMFFVdWTerm(const bool state)
bool getMMFFOopBendParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const unsigned int idx4, MMFFOop &mmffOopBendParams)
const std::string getMMFFVariant()
double getMMFFPartialCharge(const unsigned int idx)
double getMMFFFormalCharge(const unsigned int idx)
void setMMFFAngleTerm(const bool state)
MMFFMolProperties(ROMol &mol, const std::string &mmffVariant="MMFF94", std::uint8_t verbosity=MMFF_VERBOSITY_NONE, std::ostream &oStream=std::cout)
void setMMFFOStream(std::ostream *oStream)
const ForceFields::MMFF::MMFFTor * getMMFFTorsionEmpiricalRuleParams(const ROMol &mol, unsigned int idx2, unsigned int idx3)
bool getMMFFTorsionParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const unsigned int idx4, unsigned int &torsionType, MMFFTor &mmffTorsionParams)
const std::pair< unsigned int, unsigned int > getMMFFTorsionType(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const unsigned int idx4)
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
#define RDKIT_FORCEFIELDHELPERS_EXPORT
Definition export.h:209
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFTorCollection * getMMFFTor(const bool isMMFFs)
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFOopCollection * getMMFFOop(const bool isMMFFs)
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFDefCollection * getMMFFDef()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFAromCollection * getMMFFArom()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFPBCICollection * getMMFFPBCI()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFAngleCollection * getMMFFAngle()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFHerschbachLaurieCollection * getMMFFHerschbachLaurie()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFVdWCollection * getMMFFVdW()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFPropCollection * getMMFFProp()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFStbnCollection * getMMFFStbn()
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFDfsbCollection * getMMFFDfsb()
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int getPeriodicTableRow(const int atomicNum)
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int sanitizeMMFFMol(RWMol &mol)
RDKIT_FORCEFIELDHELPERS_EXPORT bool areAtomsInSameAromaticRing(const ROMol &mol, const unsigned int idx1, const unsigned int idx2)
boost::shared_ptr< MMFFAtomProperties > MMFFAtomPropertiesPtr
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int getMMFFStretchBendType(const unsigned int angleType, const unsigned int bondType1, const unsigned int bondType2)
RDKIT_FORCEFIELDHELPERS_EXPORT bool isRingAromatic(const ROMol &mol, const INT_VECT &ringIndxVect)
RDKIT_FORCEFIELDHELPERS_EXPORT bool isAtomInAromaticRingOfSize(const Atom *atom, const unsigned int ringSize)
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int isAngleInRingOfSize3or4(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3)
RDKIT_FORCEFIELDHELPERS_EXPORT bool areAtomsInSameRingOfSize(const ROMol &mol, const unsigned int ringSize, const unsigned int numAtoms,...)
RDKIT_FORCEFIELDHELPERS_EXPORT const ForceFields::MMFF::MMFFAngle * getMMFFAngleBendEmpiricalRuleParams(const ROMol &mol, const ForceFields::MMFF::MMFFAngle *oldMMFFAngleParams, const ForceFields::MMFF::MMFFProp *mmffPropParamsCentralAtom, const ForceFields::MMFF::MMFFBond *mmffBondParams1, const ForceFields::MMFF::MMFFBond *mmffBondParams2, unsigned int idx1, unsigned int idx2, unsigned int idx3)
RDKIT_FORCEFIELDHELPERS_EXPORT bool isAtomNOxide(const Atom *atom)
RDKIT_FORCEFIELDHELPERS_EXPORT unsigned int isTorsionInRingOfSize4or5(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const unsigned int idx4)
Std stuff.
std::vector< int > INT_VECT
Definition types.h:303