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#include <boost/shared_ptr.hpp>
16#include <iostream>
17
18#include <vector>
19#include <string>
21#include <RDGeneral/types.h>
22#include <cstdint>
23
24namespace RDKit {
25class ROMol;
26class RWMol;
27class Atom;
28class Bond;
29
30namespace MMFF {
31
57
58class RingMembershipSize;
59using namespace ForceFields::MMFF;
68
69typedef boost::shared_ptr<MMFFAtomProperties> MMFFAtomPropertiesPtr;
70enum {
73};
80 public:
81 MMFFMolProperties(ROMol &mol, const std::string &mmffVariant = "MMFF94",
82 std::uint8_t verbosity = MMFF_VERBOSITY_NONE,
83 std::ostream &oStream = std::cout);
84 ~MMFFMolProperties() = default;
85 unsigned int getMMFFBondType(const Bond *bond) const;
86 unsigned int getMMFFAngleType(const ROMol &mol, const unsigned int idx1,
87 const unsigned int idx2,
88 const unsigned int idx3) const;
89 const std::pair<unsigned int, unsigned int> getMMFFTorsionType(
90 const ROMol &mol, const unsigned int idx1, const unsigned int idx2,
91 const unsigned int idx3, const unsigned int idx4) const;
92 void computeMMFFCharges(const ROMol &mol);
94 const ROMol &mol, unsigned int idx2, unsigned int idx3) const;
96 const ROMol &mol, const Bond *bond) const;
97 std::uint8_t getMMFFAtomType(const unsigned int idx) const {
98 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
99
100 return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffAtomType;
101 }
102 double getMMFFFormalCharge(const unsigned int idx) const {
103 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
104
105 return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffFormalCharge;
106 }
107 double getMMFFPartialCharge(const unsigned int idx) const {
108 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
109
110 return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffPartialCharge;
111 }
112 void setMMFFBondTerm(const bool state) { this->d_bondTerm = state; }
113 bool getMMFFBondTerm() const { return this->d_bondTerm; }
114 void setMMFFAngleTerm(const bool state) { this->d_angleTerm = state; }
115 bool getMMFFAngleTerm() const { return this->d_angleTerm; }
116 void setMMFFStretchBendTerm(const bool state) {
117 this->d_stretchBendTerm = state;
118 }
119 bool getMMFFStretchBendTerm() const { return this->d_stretchBendTerm; }
120 void setMMFFOopTerm(const bool state) { this->d_oopTerm = state; }
121 bool getMMFFOopTerm() const { return this->d_oopTerm; }
122 void setMMFFTorsionTerm(const bool state) { this->d_torsionTerm = state; }
123 bool getMMFFTorsionTerm() const { return this->d_torsionTerm; }
124 void setMMFFVdWTerm(const bool state) { this->d_vdWTerm = state; }
125 bool getMMFFVdWTerm() const { return this->d_vdWTerm; }
126 void setMMFFEleTerm(const bool state) { this->d_eleTerm = state; }
127 bool getMMFFEleTerm() const { return this->d_eleTerm; }
128 void setMMFFVariant(const std::string &mmffVariant) {
129 PRECONDITION((mmffVariant == "MMFF94") || (mmffVariant == "MMFF94s"),
130 "bad MMFF variant");
131
132 this->d_mmffs = mmffVariant == "MMFF94s";
133 }
134 const std::string getMMFFVariant() const {
135 return (this->d_mmffs ? "MMFF94s" : "MMFF94");
136 }
137 void setMMFFDielectricConstant(const double dielConst) {
138 PRECONDITION(dielConst > 0.0, "bad dielectric constant");
139
140 this->d_dielConst = dielConst;
141 }
142 double getMMFFDielectricConstant() const { return this->d_dielConst; }
143 void setMMFFDielectricModel(std::uint8_t dielModel) {
144 this->d_dielModel = dielModel;
145 }
146 std::uint8_t getMMFFDielectricModel() const { return this->d_dielModel; }
147 void setMMFFVerbosity(std::uint8_t verbosity) {
148 this->d_verbosity = verbosity;
149 }
150 std::uint8_t getMMFFVerbosity() const { return this->d_verbosity; }
151 void setMMFFOStream(std::ostream *oStream) { this->d_oStream = oStream; }
152 std::ostream &getMMFFOStream() { return *(this->d_oStream); }
153 bool isValid() const { return d_valid; }
154 bool getMMFFBondStretchParams(const ROMol &mol, const unsigned int idx1,
155 const unsigned int idx2, unsigned int &bondType,
156 MMFFBond &mmffBondStretchParams) const;
157 bool getMMFFAngleBendParams(const ROMol &mol, const unsigned int idx1,
158 const unsigned int idx2, const unsigned int idx3,
159 unsigned int &angleType,
160 MMFFAngle &mmffAngleBendParams) const;
161 bool getMMFFStretchBendParams(const ROMol &mol, const unsigned int idx1,
162 const unsigned int idx2,
163 const unsigned int idx3,
164 unsigned int &stretchBendType,
165 MMFFStbn &mmffStretchBendParams,
166 MMFFBond mmffBondStretchParams[2],
167 MMFFAngle &mmffAngleBendParams) const;
168 bool getMMFFTorsionParams(const ROMol &mol, const unsigned int idx1,
169 const unsigned int idx2, const unsigned int idx3,
170 const unsigned int idx4, unsigned int &torsionType,
171 MMFFTor &mmffTorsionParams) const;
172 bool getMMFFOopBendParams(const ROMol &mol, const unsigned int idx1,
173 const unsigned int idx2, const unsigned int idx3,
174 const unsigned int idx4,
175 MMFFOop &mmffOopBendParams) const;
176 bool getMMFFVdWParams(const unsigned int idx1, const unsigned int idx2,
177 MMFFVdWRijstarEps &mmffVdWParams) const;
178
179 private:
180 void setMMFFHeavyAtomType(const RingMembershipSize &rmSize, const Atom *atom);
181 void setMMFFHydrogenType(const Atom *atom);
182 void setMMFFFormalCharge(const unsigned int idx, const double fChg) {
183 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
184
185 this->d_MMFFAtomPropertiesPtrVect[idx]->mmffFormalCharge = fChg;
186 }
187 void setMMFFPartialCharge(const unsigned int idx, const double pChg) {
188 URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size());
189
190 this->d_MMFFAtomPropertiesPtrVect[idx]->mmffPartialCharge = pChg;
191 }
192 bool d_valid;
193 bool d_mmffs;
194 bool d_bondTerm;
195 bool d_angleTerm;
196 bool d_stretchBendTerm;
197 bool d_oopTerm;
198 bool d_torsionTerm;
199 bool d_vdWTerm;
200 bool d_eleTerm;
201 double d_dielConst; //!< the dielectric constant
202 std::uint8_t d_dielModel; //!< the dielectric model (1 = constant, 2 =
203 // distance-dependent)
204 std::uint8_t d_verbosity;
205 std::ostream *d_oStream;
206 std::vector<MMFFAtomPropertiesPtr> d_MMFFAtomPropertiesPtrVect;
207};
209 const ROMol &mol, const unsigned int idx1, const unsigned int idx2,
210 const unsigned int idx3);
212 const ROMol &mol, const unsigned int idx1, const unsigned int idx2,
213 const unsigned int idx3, const unsigned int idx4);
215 const ROMol &mol, const INT_VECT &ringIndxVect);
217 const Atom *atom, const unsigned int ringSize);
220 const ROMol &mol, const unsigned int idx1, const unsigned int idx2);
222 const ROMol &mol, const unsigned int ringSize, const unsigned int numAtoms,
223 ...);
226 const unsigned int angleType, const unsigned int bondType1,
227 const unsigned int bondType2);
229 const int atomicNum);
232 const ROMol &mol, const ForceFields::MMFF::MMFFAngle *oldMMFFAngleParams,
233 const ForceFields::MMFF::MMFFProp *mmffPropParamsCentralAtom,
234 const ForceFields::MMFF::MMFFBond *mmffBondParams1,
235 const ForceFields::MMFF::MMFFBond *mmffBondParams2, unsigned int idx1,
236 unsigned int idx2, unsigned int idx3);
237} // namespace MMFF
238} // namespace RDKit
239
240#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:75
class for representing a bond
Definition Bond.h:48
void setMMFFStretchBendTerm(const bool state)
bool getMMFFVdWParams(const unsigned int idx1, const unsigned int idx2, MMFFVdWRijstarEps &mmffVdWParams) const
void setMMFFOopTerm(const bool state)
double getMMFFFormalCharge(const unsigned int idx) const
void setMMFFVariant(const std::string &mmffVariant)
unsigned int getMMFFAngleType(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3) const
void setMMFFDielectricModel(std::uint8_t dielModel)
unsigned int getMMFFBondType(const Bond *bond) const
std::uint8_t getMMFFAtomType(const unsigned int idx) const
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) const
void setMMFFBondTerm(const bool state)
void setMMFFVerbosity(std::uint8_t verbosity)
void computeMMFFCharges(const ROMol &mol)
void setMMFFTorsionTerm(const bool state)
void setMMFFEleTerm(const bool state)
double getMMFFPartialCharge(const unsigned int idx) const
std::uint8_t getMMFFVerbosity() const
void setMMFFDielectricConstant(const double dielConst)
bool getMMFFBondStretchParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, unsigned int &bondType, MMFFBond &mmffBondStretchParams) const
void setMMFFVdWTerm(const bool state)
std::uint8_t getMMFFDielectricModel() const
const std::string getMMFFVariant() const
bool getMMFFOopBendParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const unsigned int idx4, MMFFOop &mmffOopBendParams) const
const ForceFields::MMFF::MMFFBond * getMMFFBondStretchEmpiricalRuleParams(const ROMol &mol, const Bond *bond) const
const ForceFields::MMFF::MMFFTor * getMMFFTorsionEmpiricalRuleParams(const ROMol &mol, unsigned int idx2, unsigned int idx3) const
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) const
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)
bool getMMFFAngleBendParams(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, unsigned int &angleType, MMFFAngle &mmffAngleBendParams) const
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
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
#define RDKIT_FORCEFIELDHELPERS_EXPORT
Definition export.h:261
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:223