Chemical Data Processing Library C++ API - Version 1.4.0
MMFF94InteractionParameterizer.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94InteractionParameterizer.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_FORCEFIELD_MMFF94INTERACTIONPARAMETERIZER_HPP
30 #define CDPL_FORCEFIELD_MMFF94INTERACTIONPARAMETERIZER_HPP
31 
32 #include <string>
33 #include <cstddef>
34 #include <memory>
35 
68 #include "CDPL/Util/Array.hpp"
69 #include "CDPL/Math/Matrix.hpp"
70 
71 
72 namespace CDPL
73 {
74 
75  namespace Chem
76  {
77 
78  class Atom;
79  class Bond;
80  } // namespace Chem
81 
82  namespace ForceField
83  {
84 
85  class MMFF94InteractionData;
86 
102  {
103 
104  public:
108  typedef std::shared_ptr<MMFF94InteractionParameterizer> SharedPointer;
109 
115 
121 
127 
133 
139 
145 
151 
157 
163 
168 
174 
180 
186 
192 
198 
204 
210 
216 
222 
228 
234 
241 
247 
253 
259 
265 
271 
276  void setDielectricConstant(double de_const);
277 
282  void setDistanceExponent(double dist_expo);
283 
288  void setParameterSet(unsigned int param_set);
289 
296 
306  unsigned int ia_types = InteractionType::ALL, bool strict = true);
307 
308  private:
309  void setPropertyFunctions();
310 
311  unsigned int getBondTypeIndex(const Chem::Bond& bond) const;
312 
313  unsigned int getNumericAtomType(const Chem::Atom& atom) const;
314 
315  const std::string& getSymbolicAtomType(const Chem::Atom& atom) const;
316 
317  double getAtomCharge(const Chem::Atom& atom) const;
318 
320 
321  std::size_t getTopologicalDistance(const Chem::Atom& atom1, const Chem::Atom& atom2,
322  const Chem::MolecularGraph& molgraph) const;
323 
324  void setup(const Chem::MolecularGraph& molgraph, unsigned int ia_types, bool strict);
325 
326  void setupAromaticRingSet();
327  void setupAtomTypes(bool strict);
328  void setupBondTypeIndices(bool strict);
329  void setupAtomCharges(bool strict);
330  void setupTopDistances();
331 
332  MMFF94BondStretchingInteractionParameterizer bondStretchingParameterizer;
333  MMFF94AngleBendingInteractionParameterizer angleBendingParameterizer;
334  MMFF94StretchBendInteractionParameterizer stretchBendParameterizer;
335  MMFF94OutOfPlaneBendingInteractionParameterizer outOfPlaneParameterizer;
336  MMFF94TorsionInteractionParameterizer torsionParameterizer;
337  MMFF94VanDerWaalsInteractionParameterizer vanDerWaalsParameterizer;
338  MMFF94ElectrostaticInteractionParameterizer electrostaticParameterizer;
339  MMFF94AtomTyper atomTyper;
340  MMFF94BondTyper bondTyper;
341  MMFF94ChargeCalculator chargeCalculator;
343  Chem::FragmentList::SharedPointer usedAromRings;
344  Math::ULMatrix::SharedPointer topDistMatrix;
345  Math::ULMatrix::SharedPointer usedTopDistMatrix;
346  Util::UIArray numAtomTypes;
347  Util::SArray symAtomTypes;
348  Util::UIArray bondTypeIndices;
349  Util::DArray atomCharges;
350  const Chem::MolecularGraph* molGraph;
351  };
352  } // namespace ForceField
353 } // namespace CDPL
354 
355 #endif // CDPL_FORCEFIELD_MMFF94INTERACTIONPARAMETERIZER_HPP
Definition of class CDPL::Util::Array.
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Type declaration of generic wrapper class types for storing user-defined interaction filtering predic...
Definition of constants in namespace CDPL::ForceField::InteractionType.
Definition of class CDPL::ForceField::MMFF94AngleBendingInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94AngleBendingParameterTable.
Definition of class CDPL::ForceField::MMFF94AromaticAtomTypeDefinitionTable.
Definition of class CDPL::ForceField::MMFF94AromaticSSSRSubset.
Definition of class CDPL::ForceField::MMFF94AtomTypePropertyTable.
Definition of class CDPL::ForceField::MMFF94AtomTyper.
Definition of class CDPL::ForceField::MMFF94BondChargeIncrementTable.
Definition of class CDPL::ForceField::MMFF94BondStretchingInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94BondStretchingParameterTable.
Definition of class CDPL::ForceField::MMFF94BondStretchingRuleParameterTable.
Definition of class CDPL::ForceField::MMFF94BondTyper.
Definition of class CDPL::ForceField::MMFF94ChargeCalculator.
Definition of class CDPL::ForceField::MMFF94DefaultStretchBendParameterTable.
Definition of class CDPL::ForceField::MMFF94ElectrostaticInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94FormalAtomChargeDefinitionTable.
Definition of class CDPL::ForceField::MMFF94HeavyToHydrogenAtomTypeMap.
Definition of class CDPL::ForceField::MMFF94OutOfPlaneBendingInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94OutOfPlaneBendingParameterTable.
Definition of constants in namespace CDPL::ForceField::MMFF94ParameterSet.
Definition of class CDPL::ForceField::MMFF94PartialBondChargeIncrementTable.
Definition of class CDPL::ForceField::MMFF94PrimaryToParameterAtomTypeMap.
Definition of class CDPL::ForceField::MMFF94StretchBendInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94StretchBendParameterTable.
Definition of class CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable.
Definition of class CDPL::ForceField::MMFF94SymbolicToNumericAtomTypeMap.
Definition of class CDPL::ForceField::MMFF94TorsionInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94TorsionParameterTable.
Definition of class CDPL::ForceField::MMFF94VanDerWaalsInteractionParameterizer.
Definition of class CDPL::ForceField::MMFF94VanDerWaalsParameterTable.
Definition of matrix data types.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Abstract base class representing a chemical bond between two Chem::Atom instances.
Definition: Bond.hpp:54
std::shared_ptr< FragmentList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentList instances.
Definition: FragmentList.hpp:55
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Detects and parameterizes the MMFF94 angle-bending interactions of a molecular graph.
Definition: MMFF94AngleBendingInteractionParameterizer.hpp:73
std::shared_ptr< MMFF94AngleBendingParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AngleBendingParameterTable ...
Definition: MMFF94AngleBendingParameterTable.hpp:67
std::shared_ptr< MMFF94AromaticAtomTypeDefinitionTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AromaticAtomTypeDefinitionT...
Definition: MMFF94AromaticAtomTypeDefinitionTable.hpp:70
std::shared_ptr< MMFF94AromaticSSSRSubset > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AromaticSSSRSubset instance...
Definition: MMFF94AromaticSSSRSubset.hpp:65
std::shared_ptr< MMFF94AtomTypePropertyTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AtomTypePropertyTable insta...
Definition: MMFF94AtomTypePropertyTable.hpp:72
Assigns MMFF94 symbolic and numeric atom types to the atoms of a molecular graph.
Definition: MMFF94AtomTyper.hpp:71
std::shared_ptr< MMFF94BondChargeIncrementTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondChargeIncrementTable in...
Definition: MMFF94BondChargeIncrementTable.hpp:71
Detects and parameterizes the MMFF94 bond-stretching interactions of a molecular graph.
Definition: MMFF94BondStretchingInteractionParameterizer.hpp:66
std::shared_ptr< MMFF94BondStretchingParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondStretchingParameterTabl...
Definition: MMFF94BondStretchingParameterTable.hpp:67
std::shared_ptr< MMFF94BondStretchingRuleParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondStretchingRuleParameter...
Definition: MMFF94BondStretchingRuleParameterTable.hpp:67
Assigns MMFF94 bond type indices to the bonds of a molecular graph.
Definition: MMFF94BondTyper.hpp:61
Calculator for the MMFF94 partial atomic charges of a molecular graph.
Definition: MMFF94ChargeCalculator.hpp:69
std::shared_ptr< MMFF94DefaultStretchBendParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94DefaultStretchBendParameter...
Definition: MMFF94DefaultStretchBendParameterTable.hpp:71
Detects and parameterizes the MMFF94 electrostatic interactions of a molecular graph.
Definition: MMFF94ElectrostaticInteractionParameterizer.hpp:63
std::shared_ptr< MMFF94FormalAtomChargeDefinitionTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94FormalAtomChargeDefinitionT...
Definition: MMFF94FormalAtomChargeDefinitionTable.hpp:73
std::shared_ptr< MMFF94HeavyToHydrogenAtomTypeMap > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94HeavyToHydrogenAtomTypeMap ...
Definition: MMFF94HeavyToHydrogenAtomTypeMap.hpp:60
Container holding the full set of MMFF94 interaction parameter records for a molecular graph.
Definition: MMFF94InteractionData.hpp:62
Highly configurable implementation of the complete workflow for molecular graph MMFF94 interaction pe...
Definition: MMFF94InteractionParameterizer.hpp:102
void setTorsionFilterFunction(const InteractionFilterFunction4 &func)
Installs a filter that decides whether a candidate torsion interaction is kept.
void clearFilterFunctions()
Removes all previously installed interaction filter functions.
void setAngleBendingParameterTable(const MMFF94AngleBendingParameterTable::SharedPointer &table)
Sets the angle-bending parameter table to use.
void setSymbolicToNumericAtomTypeMap(const MMFF94SymbolicToNumericAtomTypeMap::SharedPointer &map)
Sets the symbolic-to-numeric atom type map used to convert symbolic types to numeric ones.
void setBondStretchingFilterFunction(const InteractionFilterFunction2 &func)
Installs a filter that decides whether a candidate bond-stretching interaction is kept.
void setOutOfPlaneBendingParameterTable(const MMFF94OutOfPlaneBendingParameterTable::SharedPointer &table)
Sets the out-of-plane bending parameter table to use.
void setDielectricConstant(double de_const)
Sets the dielectric constant used by the electrostatic interaction parameterizer.
MMFF94InteractionParameterizer(unsigned int param_set=MMFF94ParameterSet::STATIC)
Constructs the parameterizer with the default tables for the chosen MMFF94 parameter set.
void setDistanceExponent(double dist_expo)
Sets the distance exponent used by the electrostatic interaction parameterizer.
void setDefaultStretchBendParameterTable(const MMFF94DefaultStretchBendParameterTable::SharedPointer &table)
Sets the default stretch-bend parameter table used as a periodic-row fallback.
void parameterize(const Chem::MolecularGraph &molgraph, MMFF94InteractionData &ia_data, unsigned int ia_types=InteractionType::ALL, bool strict=true)
Parameterizes the MMFF94 force field interactions for molgraph and stores them in ia_data.
void setStretchBendFilterFunction(const InteractionFilterFunction3 &func)
Installs a filter that decides whether a candidate stretch-bend interaction is kept.
void setAngleBendingFilterFunction(const InteractionFilterFunction3 &func)
Installs a filter that decides whether a candidate angle-bending interaction is kept.
std::shared_ptr< MMFF94InteractionParameterizer > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94InteractionParameterizer in...
Definition: MMFF94InteractionParameterizer.hpp:108
void setAromaticAtomTypeDefinitionTable(const MMFF94AromaticAtomTypeDefinitionTable::SharedPointer &table)
Sets the aromatic atom type definition table used to override types of aromatic atoms.
MMFF94InteractionParameterizer & operator=(const MMFF94InteractionParameterizer &parameterizer)
Copies the state of parameterizer.
void setBondChargeIncrementTable(const MMFF94BondChargeIncrementTable::SharedPointer &table)
Sets the bond charge-increment table used during partial-charge calculation.
void setBondStretchingParameterTable(const MMFF94BondStretchingParameterTable::SharedPointer &table)
Sets the bond-stretching parameter table to use.
void setFormalAtomChargeDefinitionTable(const MMFF94FormalAtomChargeDefinitionTable::SharedPointer &table)
Sets the formal atom charge definition table used during charge assignment.
void setOutOfPlaneBendingFilterFunction(const InteractionFilterFunction4 &func)
Installs a filter that decides whether a candidate out-of-plane bending interaction is kept.
void setVanDerWaalsFilterFunction(const InteractionFilterFunction2 &func)
Installs a filter that decides whether a candidate Van der Waals interaction is kept.
void setParameterSet(unsigned int param_set)
Switches the active MMFF94 parameter set variant to a different one.
void setHeavyToHydrogenAtomTypeMap(const MMFF94HeavyToHydrogenAtomTypeMap::SharedPointer &map)
Sets the heavy-to-hydrogen atom type map used to derive hydrogen atom types from their non-hydrogen n...
void setAtomTypePropertyTable(const MMFF94AtomTypePropertyTable::SharedPointer &table)
Sets the atom type property table used to retrieve per-numeric type properties.
void setStretchBendParameterTable(const MMFF94StretchBendParameterTable::SharedPointer &table)
Sets the stretch-bend parameter table to use.
void setPartialBondChargeIncrementTable(const MMFF94PartialBondChargeIncrementTable::SharedPointer &table)
Sets the partial bond charge-increment table used during partial charge calculation.
void setBondStretchingRuleParameterTable(const MMFF94BondStretchingRuleParameterTable::SharedPointer &table)
Sets the bond-stretching rule parameter table used as a fallback when no explicit bond-stretching par...
void setPrimaryToParameterAtomTypeMap(const MMFF94PrimaryToParameterAtomTypeMap::SharedPointer &map)
Sets the primary-to-parameter atom type map used by the parameter look-ups.
MMFF94InteractionParameterizer(const MMFF94InteractionParameterizer &parameterizer)
Constructs a copy of the parameterizer parameterizer.
void setVanDerWaalsParameterTable(const MMFF94VanDerWaalsParameterTable::SharedPointer &table)
Sets the Van der Waals parameter table to use.
void setSymbolicAtomTypePatternTable(const MMFF94SymbolicAtomTypePatternTable::SharedPointer &table)
Sets the symbolic atom type pattern table to use during atom typing.
void setElectrostaticFilterFunction(const InteractionFilterFunction2 &func)
Installs a filter that decides whether a candidate electrostatic interaction is kept.
void setTorsionParameterTable(const MMFF94TorsionParameterTable::SharedPointer &table)
Sets the torsion parameter table to use.
Detects and parameterizes the MMFF94 out-of-plane bending interactions of a molecular graph.
Definition: MMFF94OutOfPlaneBendingInteractionParameterizer.hpp:69
std::shared_ptr< MMFF94OutOfPlaneBendingParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94OutOfPlaneBendingParameterT...
Definition: MMFF94OutOfPlaneBendingParameterTable.hpp:67
std::shared_ptr< MMFF94PartialBondChargeIncrementTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94PartialBondChargeIncrementT...
Definition: MMFF94PartialBondChargeIncrementTable.hpp:67
std::shared_ptr< MMFF94PrimaryToParameterAtomTypeMap > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94PrimaryToParameterAtomTypeM...
Definition: MMFF94PrimaryToParameterAtomTypeMap.hpp:67
Detects and parameterizes the MMFF94 stretch-bend interactions of a molecular graph.
Definition: MMFF94StretchBendInteractionParameterizer.hpp:76
std::shared_ptr< MMFF94StretchBendParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94StretchBendParameterTable i...
Definition: MMFF94StretchBendParameterTable.hpp:71
std::shared_ptr< MMFF94SymbolicAtomTypePatternTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94SymbolicAtomTypePatternTabl...
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:70
std::shared_ptr< MMFF94SymbolicToNumericAtomTypeMap > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94SymbolicToNumericAtomTypeMa...
Definition: MMFF94SymbolicToNumericAtomTypeMap.hpp:60
Detects and parameterizes the MMFF94 torsion interactions of a molecular graph.
Definition: MMFF94TorsionInteractionParameterizer.hpp:69
std::shared_ptr< MMFF94TorsionParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94TorsionParameterTable insta...
Definition: MMFF94TorsionParameterTable.hpp:67
Detects and parameterizes the MMFF94 Van der Waals interactions of a molecular graph.
Definition: MMFF94VanDerWaalsInteractionParameterizer.hpp:64
std::shared_ptr< MMFF94VanDerWaalsParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94VanDerWaalsParameterTable i...
Definition: MMFF94VanDerWaalsParameterTable.hpp:71
CDPL_CHEM_API FragmentList::SharedPointer getAromaticRings(const MolecularGraph &molgraph)
Returns the subset of the aromatic rings of the molecular graph molgraph.
CDPL_CHEM_API std::size_t getTopologicalDistance(const Atom &atom1, const Atom &atom2, const MolecularGraph &molgraph)
Returns the topological distance between two atoms of the molecular graph molgraph.
constexpr unsigned int ALL
A bitmask covering all interaction types.
Definition: InteractionType.hpp:88
constexpr unsigned int STATIC
Original static MMFF94 parameter set.
Definition: MMFF94ParameterSet.hpp:54
std::function< bool(const Chem::Atom &, const Chem::Atom &, const Chem::Atom &)> InteractionFilterFunction3
Generic wrapper for storing user-defined three-atom interaction filtering functions (see [FUNWRP]).
Definition: InteractionFilterFunctions.hpp:63
std::function< bool(const Chem::Atom &, const Chem::Atom &, const Chem::Atom &, const Chem::Atom &)> InteractionFilterFunction4
Generic wrapper for storing user-defined four-atom interaction filtering functions (see [FUNWRP]).
Definition: InteractionFilterFunctions.hpp:72
std::function< bool(const Chem::Atom &, const Chem::Atom &)> InteractionFilterFunction2
Generic wrapper for storing user-defined two-atom interaction filtering functions (see [FUNWRP]).
Definition: InteractionFilterFunctions.hpp:54
Array< double > DArray
Array storing floating-point values of type double.
Definition: Array.hpp:598
Array< unsigned int > UIArray
Array storing unsigned integers of type unsigned int.
Definition: Array.hpp:573
Array< std::string > SArray
Array storing std::string objects.
Definition: Array.hpp:603
The namespace of the Chemical Data Processing Library.