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 
100  {
101 
102  public:
106  typedef std::shared_ptr<MMFF94InteractionParameterizer> SharedPointer;
107 
113 
119 
125 
131 
137 
143 
149 
155 
161 
166 
172 
178 
184 
190 
196 
202 
208 
214 
220 
226 
232 
239 
245 
251 
257 
263 
269 
274  void setDielectricConstant(double de_const);
275 
280  void setDistanceExponent(double dist_expo);
281 
286  void setParameterSet(unsigned int param_set);
287 
294 
304  unsigned int ia_types = InteractionType::ALL, bool strict = true);
305 
306  private:
307  void setPropertyFunctions();
308 
309  unsigned int getBondTypeIndex(const Chem::Bond& bond) const;
310 
311  unsigned int getNumericAtomType(const Chem::Atom& atom) const;
312 
313  const std::string& getSymbolicAtomType(const Chem::Atom& atom) const;
314 
315  double getAtomCharge(const Chem::Atom& atom) const;
316 
318 
319  std::size_t getTopologicalDistance(const Chem::Atom& atom1, const Chem::Atom& atom2,
320  const Chem::MolecularGraph& molgraph) const;
321 
322  void setup(const Chem::MolecularGraph& molgraph, unsigned int ia_types, bool strict);
323 
324  void setupAromaticRingSet();
325  void setupAtomTypes(bool strict);
326  void setupBondTypeIndices(bool strict);
327  void setupAtomCharges(bool strict);
328  void setupTopDistances();
329 
330  MMFF94BondStretchingInteractionParameterizer bondStretchingParameterizer;
331  MMFF94AngleBendingInteractionParameterizer angleBendingParameterizer;
332  MMFF94StretchBendInteractionParameterizer stretchBendParameterizer;
333  MMFF94OutOfPlaneBendingInteractionParameterizer outOfPlaneParameterizer;
334  MMFF94TorsionInteractionParameterizer torsionParameterizer;
335  MMFF94VanDerWaalsInteractionParameterizer vanDerWaalsParameterizer;
336  MMFF94ElectrostaticInteractionParameterizer electrostaticParameterizer;
337  MMFF94AtomTyper atomTyper;
338  MMFF94BondTyper bondTyper;
339  MMFF94ChargeCalculator chargeCalculator;
341  Chem::FragmentList::SharedPointer usedAromRings;
342  Math::ULMatrix::SharedPointer topDistMatrix;
343  Math::ULMatrix::SharedPointer usedTopDistMatrix;
344  Util::UIArray numAtomTypes;
345  Util::SArray symAtomTypes;
346  Util::UIArray bondTypeIndices;
347  Util::DArray atomCharges;
348  const Chem::MolecularGraph* molGraph;
349  };
350  } // namespace ForceField
351 } // namespace CDPL
352 
353 #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:53
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:71
std::shared_ptr< MMFF94AngleBendingParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AngleBendingParameterTable ...
Definition: MMFF94AngleBendingParameterTable.hpp:64
std::shared_ptr< MMFF94AromaticAtomTypeDefinitionTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AromaticAtomTypeDefinitionT...
Definition: MMFF94AromaticAtomTypeDefinitionTable.hpp:66
std::shared_ptr< MMFF94AromaticSSSRSubset > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AromaticSSSRSubset instance...
Definition: MMFF94AromaticSSSRSubset.hpp:64
std::shared_ptr< MMFF94AtomTypePropertyTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94AtomTypePropertyTable insta...
Definition: MMFF94AtomTypePropertyTable.hpp:68
Assigns MMFF94 symbolic and numeric atom types to the atoms of a molecular graph.
Definition: MMFF94AtomTyper.hpp:69
std::shared_ptr< MMFF94BondChargeIncrementTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondChargeIncrementTable in...
Definition: MMFF94BondChargeIncrementTable.hpp:67
Detects and parameterizes the MMFF94 bond-stretching interactions of a molecular graph.
Definition: MMFF94BondStretchingInteractionParameterizer.hpp:64
std::shared_ptr< MMFF94BondStretchingParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondStretchingParameterTabl...
Definition: MMFF94BondStretchingParameterTable.hpp:64
std::shared_ptr< MMFF94BondStretchingRuleParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondStretchingRuleParameter...
Definition: MMFF94BondStretchingRuleParameterTable.hpp:65
Assigns MMFF94 bond type indices to the bonds of a molecular graph.
Definition: MMFF94BondTyper.hpp:59
Calculator for the MMFF94 partial atomic charges of a molecular graph.
Definition: MMFF94ChargeCalculator.hpp:67
std::shared_ptr< MMFF94DefaultStretchBendParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94DefaultStretchBendParameter...
Definition: MMFF94DefaultStretchBendParameterTable.hpp:68
Detects and parameterizes the MMFF94 electrostatic interactions of a molecular graph.
Definition: MMFF94ElectrostaticInteractionParameterizer.hpp:61
std::shared_ptr< MMFF94FormalAtomChargeDefinitionTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94FormalAtomChargeDefinitionT...
Definition: MMFF94FormalAtomChargeDefinitionTable.hpp:69
std::shared_ptr< MMFF94HeavyToHydrogenAtomTypeMap > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94HeavyToHydrogenAtomTypeMap ...
Definition: MMFF94HeavyToHydrogenAtomTypeMap.hpp:58
Container holding the full set of MMFF94 interaction parameters for a molecular graph.
Definition: MMFF94InteractionData.hpp:60
One-stop MMFF94 parameterizer that combines atom typing, bond typing, partial-charge assignment and p...
Definition: MMFF94InteractionParameterizer.hpp:100
void setTorsionFilterFunction(const InteractionFilterFunction4 &func)
Installs a filter that decides whether a candidate torsion interaction is kept.
void clearFilterFunctions()
Removes every previously installed interaction-filter function.
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:106
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-atomic-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 and reinstalls the matching default tables.
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 resolve 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 ent...
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:67
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:64
std::shared_ptr< MMFF94PrimaryToParameterAtomTypeMap > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94PrimaryToParameterAtomTypeM...
Definition: MMFF94PrimaryToParameterAtomTypeMap.hpp:64
Definition: MMFF94StretchBendInteractionParameterizer.hpp:64
std::shared_ptr< MMFF94StretchBendParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94StretchBendParameterTable i...
Definition: MMFF94StretchBendParameterTable.hpp:68
std::shared_ptr< MMFF94SymbolicAtomTypePatternTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94SymbolicAtomTypePatternTabl...
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:66
std::shared_ptr< MMFF94SymbolicToNumericAtomTypeMap > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94SymbolicToNumericAtomTypeMa...
Definition: MMFF94SymbolicToNumericAtomTypeMap.hpp:57
Detects and parameterizes the MMFF94 torsion interactions of a molecular graph.
Definition: MMFF94TorsionInteractionParameterizer.hpp:67
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:62
std::shared_ptr< MMFF94VanDerWaalsParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94VanDerWaalsParameterTable i...
Definition: MMFF94VanDerWaalsParameterTable.hpp:68
CDPL_CHEM_API FragmentList::SharedPointer getAromaticRings(const MolecularGraph &molgraph)
Returns the subset of the aromatic rings of molgraph (a fresh list, not stored on molgraph).
CDPL_CHEM_API std::size_t getTopologicalDistance(const Atom &atom1, const Atom &atom2, const MolecularGraph &molgraph)
Returns the topological distance (number of edges along the shortest path) between two atoms of molgr...
constexpr unsigned int ALL
A bitmask covering all interaction types.
Definition: InteractionType.hpp:88
constexpr unsigned int STATIC
Static MMFF94s parameter set (used for energy minimization).
Definition: MMFF94ParameterSet.hpp:48
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:595
Array< unsigned int > UIArray
Array storing unsigned integers of type unsigned int.
Definition: Array.hpp:570
Array< std::string > SArray
Array storing std::string objects.
Definition: Array.hpp:600
The namespace of the Chemical Data Processing Library.