MMFF/AtomTyper.h
Go to the documentation of this file.
//
// Copyright (C) 2013 Paolo Tosco
//
// Copyright (C) 2004-2006 Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#ifndef _RD_MMFFATOMTYPER_H__
#define _RD_MMFFATOMTYPER_H__
#include <vector>
#include <string>
#include <iostream>
#include <ForceField/MMFF/Params.h>
#include <boost/cstdint.hpp>
namespace RDKit {
class ROMol;
class RWMol;
class Atom;
class Bond;
namespace MMFF {
using namespace ForceFields::MMFF;
class MMFFAtomProperties {
public:
MMFFAtomProperties()
: mmffAtomType(0), mmffFormalCharge(0.0), mmffPartialCharge(0.0){};
~MMFFAtomProperties(){};
boost::uint8_t mmffAtomType;
double mmffFormalCharge;
double mmffPartialCharge;
};
typedef boost::shared_ptr<MMFFAtomProperties> MMFFAtomPropertiesPtr;
enum { CONSTANT = 1, DISTANCE = 2 };
enum {
MMFF_VERBOSITY_NONE = 0,
MMFF_VERBOSITY_LOW = 1,
MMFF_VERBOSITY_HIGH = 2
};
class MMFFMolProperties {
public:
MMFFMolProperties(ROMol &mol, const std::string &mmffVariant = "MMFF94",
boost::uint8_t verbosity = MMFF_VERBOSITY_NONE,
std::ostream &oStream = std::cout);
~MMFFMolProperties(){};
unsigned int getMMFFBondType(const Bond *bond);
unsigned int getMMFFAngleType(const ROMol &mol, const unsigned int idx1,
const unsigned int idx2,
const unsigned int idx3);
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);
void computeMMFFCharges(const ROMol &mol);
const ForceFields::MMFF::MMFFTor *getMMFFTorsionEmpiricalRuleParams(
const ROMol &mol, unsigned int idx2, unsigned int idx3);
const ForceFields::MMFF::MMFFBond *getMMFFBondStretchEmpiricalRuleParams(
const ROMol &mol, const Bond *bond);
boost::uint8_t getMMFFAtomType(const unsigned int idx) {
URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size() - 1);
return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffAtomType;
};
double getMMFFFormalCharge(const unsigned int idx) {
URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size() - 1);
return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffFormalCharge;
};
double getMMFFPartialCharge(const unsigned int idx) {
URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size() - 1);
return this->d_MMFFAtomPropertiesPtrVect[idx]->mmffPartialCharge;
};
void setMMFFBondTerm(const bool state) { this->d_bondTerm = state; };
bool getMMFFBondTerm() { return this->d_bondTerm; };
void setMMFFAngleTerm(const bool state) { this->d_angleTerm = state; };
bool getMMFFAngleTerm() { return this->d_angleTerm; };
void setMMFFStretchBendTerm(const bool state) {
this->d_stretchBendTerm = state;
};
bool getMMFFStretchBendTerm() { return this->d_stretchBendTerm; };
void setMMFFOopTerm(const bool state) { this->d_oopTerm = state; };
bool getMMFFOopTerm() { return this->d_oopTerm; };
void setMMFFTorsionTerm(const bool state) { this->d_torsionTerm = state; };
bool getMMFFTorsionTerm() { return this->d_torsionTerm; };
void setMMFFVdWTerm(const bool state) { this->d_vdWTerm = state; };
bool getMMFFVdWTerm() { return this->d_vdWTerm; };
void setMMFFEleTerm(const bool state) { this->d_eleTerm = state; };
bool getMMFFEleTerm() { return this->d_eleTerm; };
void setMMFFVariant(const std::string &mmffVariant) {
PRECONDITION((mmffVariant == "MMFF94") || (mmffVariant == "MMFF94s"),
"bad MMFF variant");
this->d_mmffs = ((mmffVariant == "MMFF94s") ? true : false);
};
const std::string getMMFFVariant() {
return (this->d_mmffs ? "MMFF94s" : "MMFF94");
};
void setMMFFDielectricConstant(const double dielConst) {
PRECONDITION(dielConst > 0.0, "bad dielectric constant");
this->d_dielConst = dielConst;
};
double getMMFFDielectricConstant() { return this->d_dielConst; };
void setMMFFDielectricModel(boost::uint8_t dielModel) {
this->d_dielModel = dielModel;
};
boost::uint8_t getMMFFDielectricModel() { return this->d_dielModel; };
void setMMFFVerbosity(boost::uint8_t verbosity) {
this->d_verbosity = verbosity;
};
boost::uint8_t getMMFFVerbosity() { return this->d_verbosity; };
void setMMFFOStream(std::ostream *oStream) { this->d_oStream = oStream; };
std::ostream &getMMFFOStream() { return *(this->d_oStream); };
bool isValid() { return d_valid; };
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);
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);
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);
bool getMMFFOopBendParams(const ROMol &mol, const unsigned int idx1,
const unsigned int idx2, const unsigned int idx3,
const unsigned int idx4,
MMFFOop &mmffOopBendParams);
bool getMMFFVdWParams(const unsigned int idx1, const unsigned int idx2,
MMFFVdWRijstarEps &mmffVdWParams);
private:
void setMMFFHeavyAtomType(const Atom *atom);
void setMMFFHydrogenType(const Atom *atom);
void setMMFFFormalCharge(const unsigned int idx, const double fChg) {
URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size() - 1);
this->d_MMFFAtomPropertiesPtrVect[idx]->mmffFormalCharge = fChg;
};
void setMMFFPartialCharge(const unsigned int idx, const double pChg) {
URANGE_CHECK(idx, this->d_MMFFAtomPropertiesPtrVect.size() - 1);
this->d_MMFFAtomPropertiesPtrVect[idx]->mmffPartialCharge = pChg;
};
bool d_valid;
bool d_mmffs;
bool d_bondTerm;
bool d_angleTerm;
bool d_stretchBendTerm;
bool d_oopTerm;
bool d_torsionTerm;
bool d_vdWTerm;
bool d_eleTerm;
double d_dielConst; //!< the dielectric constant
boost::uint8_t d_dielModel; //!< the dielectric model (1 = constant, 2 =
// distance-dependent)
boost::uint8_t d_verbosity;
std::ostream *d_oStream;
std::vector<MMFFAtomPropertiesPtr> d_MMFFAtomPropertiesPtrVect;
};
unsigned int isAngleInRingOfSize3or4(const ROMol &mol, const unsigned int idx1,
const unsigned int idx2,
const unsigned int idx3);
unsigned int isTorsionInRingOfSize4or5(const ROMol &mol,
const unsigned int idx1,
const unsigned int idx2,
const unsigned int idx3,
const unsigned int idx4);
bool isAtomInAromaticRingOfSize(const Atom *atom, const unsigned int ringSize);
bool isAtomNOxide(const Atom *atom);
bool areAtomsInSameAromaticRing(const ROMol &mol, const unsigned int idx1,
const unsigned int idx2);
bool areAtomsInSameRingOfSize(const ROMol &mol, const unsigned int ringSize,
const unsigned int numAtoms, ...);
unsigned int sanitizeMMFFMol(RWMol &mol);
void setMMFFAromaticity(RWMol &mol);
unsigned int getMMFFStretchBendType(const unsigned int angleType,
const unsigned int bondType1,
const unsigned int bondType2);
unsigned int getPeriodicTableRow(const int atomicNum);
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);
}
}
#endif
RDKit::MMFF::MMFFMolProperties::getMMFFVerbosity
boost::uint8_t getMMFFVerbosity()
Definition: MMFF/AtomTyper.h:117
RDKit::MMFF::MMFF_VERBOSITY_HIGH
Definition: MMFF/AtomTyper.h:44
RDKit::MMFF::MMFFMolProperties::getMMFFStretchBendTerm
bool getMMFFStretchBendTerm()
Definition: MMFF/AtomTyper.h:86
RDKit::MMFF::MMFFMolProperties::setMMFFAngleTerm
void setMMFFAngleTerm(const bool state)
Definition: MMFF/AtomTyper.h:81
RDKit::MMFF::MMFFAtomProperties
Definition: MMFF/AtomTyper.h:29
RDKit::MMFF::MMFFMolProperties::getMMFFVariant
const std::string getMMFFVariant()
Definition: MMFF/AtomTyper.h:101
RDKit::MMFF::setMMFFAromaticity
void setMMFFAromaticity(RWMol &mol)
Params.h
RDKit::MMFF::MMFFMolProperties::setMMFFVdWTerm
void setMMFFVdWTerm(const bool state)
Definition: MMFF/AtomTyper.h:91
ForceFields::MMFF::MMFFAngle
class to store MMFF parameters for angle bending
Definition: MMFF/Params.h:110
RDKit::MMFF::MMFFAtomPropertiesPtr
boost::shared_ptr< MMFFAtomProperties > MMFFAtomPropertiesPtr
Definition: MMFF/AtomTyper.h:39
RDKit::MMFF::MMFFMolProperties::setMMFFDielectricConstant
void setMMFFDielectricConstant(const double dielConst)
Definition: MMFF/AtomTyper.h:104
RDKit::MMFF::MMFFMolProperties::getMMFFTorsionTerm
bool getMMFFTorsionTerm()
Definition: MMFF/AtomTyper.h:90
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:30
RDKit::MMFF::DISTANCE
Definition: MMFF/AtomTyper.h:40
RDKit::MMFF::getMMFFStretchBendType
unsigned int getMMFFStretchBendType(const unsigned int angleType, const unsigned int bondType1, const unsigned int bondType2)
RDKit::MMFF::MMFF_VERBOSITY_LOW
Definition: MMFF/AtomTyper.h:43
RDKit::MMFF::MMFFMolProperties::getMMFFOStream
std::ostream & getMMFFOStream()
Definition: MMFF/AtomTyper.h:119
RDKit::MMFF::MMFFMolProperties::~MMFFMolProperties
~MMFFMolProperties()
Definition: MMFF/AtomTyper.h:51
RDKit::MMFF::MMFFMolProperties::setMMFFBondTerm
void setMMFFBondTerm(const bool state)
Definition: MMFF/AtomTyper.h:79
RDKit::MMFF::MMFFAtomProperties::~MMFFAtomProperties
~MMFFAtomProperties()
Definition: MMFF/AtomTyper.h:33
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:102
RDKit::MMFF::MMFF_VERBOSITY_NONE
Definition: MMFF/AtomTyper.h:42
RDKit::MMFF::MMFFMolProperties::setMMFFTorsionTerm
void setMMFFTorsionTerm(const bool state)
Definition: MMFF/AtomTyper.h:89
RDKit::MMFF::areAtomsInSameAromaticRing
bool areAtomsInSameAromaticRing(const ROMol &mol, const unsigned int idx1, const unsigned int idx2)
RDKit::MMFF::MMFFMolProperties::getMMFFEleTerm
bool getMMFFEleTerm()
Definition: MMFF/AtomTyper.h:94
RDKit::MMFF::areAtomsInSameRingOfSize
bool areAtomsInSameRingOfSize(const ROMol &mol, const unsigned int ringSize, const unsigned int numAtoms,...)
RDKit::MMFF::MMFFMolProperties::getMMFFBondTerm
bool getMMFFBondTerm()
Definition: MMFF/AtomTyper.h:80
RDKit::MMFF::isTorsionInRingOfSize4or5
unsigned int isTorsionInRingOfSize4or5(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3, const unsigned int idx4)
RDKit::MMFF::MMFFAtomProperties::mmffPartialCharge
double mmffPartialCharge
Definition: MMFF/AtomTyper.h:36
RDKit::MMFF::MMFFMolProperties::getMMFFOopTerm
bool getMMFFOopTerm()
Definition: MMFF/AtomTyper.h:88
RDKit::MMFF::sanitizeMMFFMol
unsigned int sanitizeMMFFMol(RWMol &mol)
RDKit::MMFF::MMFFMolProperties::getMMFFVdWTerm
bool getMMFFVdWTerm()
Definition: MMFF/AtomTyper.h:92
ForceFields::MMFF::MMFFStbn
class to store MMFF parameters for stretch-bending
Definition: MMFF/Params.h:117
RDKit::MMFF::getPeriodicTableRow
unsigned int getPeriodicTableRow(const int atomicNum)
ForceFields::MMFF::MMFFBond
class to store MMFF parameters for bond stretching
Definition: MMFF/Params.h:86
RDKit::MMFF::MMFFMolProperties::setMMFFStretchBendTerm
void setMMFFStretchBendTerm(const bool state)
Definition: MMFF/AtomTyper.h:83
ForceFields::MMFF
Definition: MMFF/AngleBend.h:19
RDKit::MMFF::MMFFMolProperties::getMMFFFormalCharge
double getMMFFFormalCharge(const unsigned int idx)
Definition: MMFF/AtomTyper.h:69
ForceFields::MMFF::MMFFOop
class to store MMFF parameters for out-of-plane bending
Definition: MMFF/Params.h:124
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
RDKit::MMFF::MMFFMolProperties::setMMFFVerbosity
void setMMFFVerbosity(boost::uint8_t verbosity)
Definition: MMFF/AtomTyper.h:114
RDKit::MMFF::MMFFMolProperties::setMMFFOopTerm
void setMMFFOopTerm(const bool state)
Definition: MMFF/AtomTyper.h:87
RDKit::MMFF::MMFFMolProperties::getMMFFPartialCharge
double getMMFFPartialCharge(const unsigned int idx)
Definition: MMFF/AtomTyper.h:74
RDKit::MMFF::isAngleInRingOfSize3or4
unsigned int isAngleInRingOfSize3or4(const ROMol &mol, const unsigned int idx1, const unsigned int idx2, const unsigned int idx3)
URANGE_CHECK
#define URANGE_CHECK(x, hi)
Definition: Invariant.h:136
RDKit::Bond
class for representing a bond
Definition: Bond.h:46
RDKit::MMFF::CONSTANT
Definition: MMFF/AtomTyper.h:40
RDKit::MMFF::MMFFMolProperties::setMMFFEleTerm
void setMMFFEleTerm(const bool state)
Definition: MMFF/AtomTyper.h:93
RDKit::MMFF::isAtomInAromaticRingOfSize
bool isAtomInAromaticRingOfSize(const Atom *atom, const unsigned int ringSize)
RDKit::MMFF::MMFFMolProperties::getMMFFAtomType
boost::uint8_t getMMFFAtomType(const unsigned int idx)
Definition: MMFF/AtomTyper.h:64
RDKit::MMFF::MMFFMolProperties::setMMFFOStream
void setMMFFOStream(std::ostream *oStream)
Definition: MMFF/AtomTyper.h:118
RDKit::MMFF::MMFFMolProperties::setMMFFVariant
void setMMFFVariant(const std::string &mmffVariant)
Definition: MMFF/AtomTyper.h:95
PRECONDITION
#define PRECONDITION(expr, mess)
Definition: Invariant.h:103
RDKit::MMFF::MMFFMolProperties
Definition: MMFF/AtomTyper.h:46
RDKit::MMFF::getMMFFAngleBendEmpiricalRuleParams
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)
ForceFields::MMFF::MMFFVdWRijstarEps
Definition: MMFF/Params.h:148
ForceFields::MMFF::MMFFTor
class to store MMFF parameters for torsions
Definition: MMFF/Params.h:130
RDKit::MMFF::MMFFMolProperties::getMMFFDielectricConstant
double getMMFFDielectricConstant()
Definition: MMFF/AtomTyper.h:109
RDKit::MMFF::MMFFMolProperties::setMMFFDielectricModel
void setMMFFDielectricModel(boost::uint8_t dielModel)
Definition: MMFF/AtomTyper.h:110
RDKit::MMFF::MMFFMolProperties::getMMFFAngleTerm
bool getMMFFAngleTerm()
Definition: MMFF/AtomTyper.h:82
RDKit::MMFF::isAtomNOxide
bool isAtomNOxide(const Atom *atom)
RDKit::Atom
The class for representing atoms.
Definition: Atom.h:67
RDKit::MMFF::MMFFMolProperties::isValid
bool isValid()
Definition: MMFF/AtomTyper.h:120
RDKit::MMFF::MMFFAtomProperties::MMFFAtomProperties
MMFFAtomProperties()
Definition: MMFF/AtomTyper.h:31
RDKit::MMFF::MMFFAtomProperties::mmffFormalCharge
double mmffFormalCharge
Definition: MMFF/AtomTyper.h:35
RDKit::MMFF::MMFFMolProperties::getMMFFDielectricModel
boost::uint8_t getMMFFDielectricModel()
Definition: MMFF/AtomTyper.h:113
ForceFields::MMFF::MMFFProp
class to store MMFF Properties
Definition: MMFF/Params.h:59