Chemical Data Processing Library C++ API - Version 1.1.1
MMFF94ChargeCalculator.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94ChargeCalculator.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_MMFF94CHARGECALCULATOR_HPP
30 #define CDPL_FORCEFIELD_MMFF94CHARGECALCULATOR_HPP
31 
32 #include <cstddef>
33 #include <memory>
34 
41 #include "CDPL/Util/Array.hpp"
42 #include "CDPL/Util/BitSet.hpp"
43 
44 
45 namespace CDPL
46 {
47 
48  namespace Chem
49  {
50 
51  class MolecularGraph;
52  class Atom;
53  } // namespace Chem
54 
55  namespace ForceField
56  {
57 
59  {
60 
61  public:
62  typedef std::shared_ptr<MMFF94ChargeCalculator> SharedPointer;
63 
65 
66  MMFF94ChargeCalculator(const Chem::MolecularGraph& molgraph, Util::DArray& charges, bool strict);
67 
69 
71 
73 
75 
77 
79 
81 
83 
120  void calculate(const Chem::MolecularGraph& molgraph, Util::DArray& charges, bool strict);
121 
123 
124  private:
129 
130  typedef std::vector<std::size_t> AtomIndexList;
131 
132  void init(const Chem::MolecularGraph& molgraph, Util::DArray& charges);
133 
134  void assignFormalCharges();
135  void distFormalNeighborCharges(const Chem::Atom& atom, const FormChargeDefEntry& entry);
136  void distFormalAromAtomCharges(const Chem::Atom& atom, const FormChargeDefEntry& entry);
137 
138  void calcPartialCharges(Util::DArray& charges, bool strict) const;
139  double getBondChargeIncrement(unsigned int bnd_type_idx, unsigned int atom_type1, unsigned int atom_type2,
140  const PBCIEntry& pbci_entry1, const PBCIEntry& pbci_entry2) const;
141 
146  MMFF94RingSetFunction aromRingSetFunc;
147  MMFF94NumericAtomTypeFunction numAtomTypeFunc;
148  MMFF94SymbolicAtomTypeFunction symAtomTypeFunc;
149  MMFF94BondTypeIndexFunction bondTypeIdxFunc;
150  Util::DArray formCharges;
151  Util::BitSet assFormChargeMask;
152  AtomIndexList atomList;
153  const Chem::MolecularGraph* molGraph;
154  };
155  } // namespace ForceField
156 } // namespace CDPL
157 
158 #endif // CDPL_FORCEFIELD_MMFF94CHARGECALCULATOR_HPP
MMFF94BondChargeIncrementTable.hpp
Definition of the class CDPL::ForceField::MMFF94BondChargeIncrementTable.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::MMFF94FormalAtomChargeDefinitionTable::SharedPointer
std::shared_ptr< MMFF94FormalAtomChargeDefinitionTable > SharedPointer
Definition: MMFF94FormalAtomChargeDefinitionTable.hpp:61
CDPL::ForceField::MMFF94ChargeCalculator::setAromaticRingSetFunction
void setAromaticRingSetFunction(const MMFF94RingSetFunction &func)
CDPL::ForceField::MMFF94FormalAtomChargeDefinitionTable::Entry
Definition: MMFF94FormalAtomChargeDefinitionTable.hpp:64
CDPL::ForceField::MMFF94BondChargeIncrementTable::Entry
Definition: MMFF94BondChargeIncrementTable.hpp:63
CDPL::Util::BitSet
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
CDPL::ForceField::MMFF94PartialBondChargeIncrementTable::Entry
Definition: MMFF94PartialBondChargeIncrementTable.hpp:62
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
CDPL::ForceField::MMFF94AtomTypePropertyTable::SharedPointer
std::shared_ptr< MMFF94AtomTypePropertyTable > SharedPointer
Definition: MMFF94AtomTypePropertyTable.hpp:59
CDPL::ForceField::MMFF94ChargeCalculator::setNumericAtomTypeFunction
void setNumericAtomTypeFunction(const MMFF94NumericAtomTypeFunction &func)
CDPL::ForceField::MMFF94ChargeCalculator::getFormalCharges
const Util::DArray & getFormalCharges() const
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
BitSet.hpp
Definition of the type CDPL::Util::BitSet.
CDPL::ForceField::MMFF94BondTypeIndexFunction
std::function< unsigned int(const Chem::Bond &)> MMFF94BondTypeIndexFunction
A generic wrapper class used to store a user-defined MMFF94 bond type index function.
Definition: MMFF94PropertyFunctions.hpp:71
CDPL::ForceField::MMFF94BondChargeIncrementTable::SharedPointer
std::shared_ptr< MMFF94BondChargeIncrementTable > SharedPointer
Definition: MMFF94BondChargeIncrementTable.hpp:60
Array.hpp
Definition of the class CDPL::Util::Array.
CDPL::ForceField::MMFF94ChargeCalculator::setBondChargeIncrementTable
void setBondChargeIncrementTable(const MMFF94BondChargeIncrementTable::SharedPointer &table)
CDPL::ForceField::MMFF94ChargeCalculator::setAtomTypePropertyTable
void setAtomTypePropertyTable(const MMFF94AtomTypePropertyTable::SharedPointer &table)
CDPL::ForceField::MMFF94NumericAtomTypeFunction
std::function< unsigned int(const Chem::Atom &)> MMFF94NumericAtomTypeFunction
A generic wrapper class used to store a user-defined numeric MMFF94 atom type function.
Definition: MMFF94PropertyFunctions.hpp:56
MMFF94PartialBondChargeIncrementTable.hpp
Definition of the class CDPL::ForceField::MMFF94PartialBondChargeIncrementTable.
CDPL::ForceField::MMFF94PartialBondChargeIncrementTable::SharedPointer
std::shared_ptr< MMFF94PartialBondChargeIncrementTable > SharedPointer
Definition: MMFF94PartialBondChargeIncrementTable.hpp:59
CDPL::ForceField::MMFF94ChargeCalculator::setSymbolicAtomTypeFunction
void setSymbolicAtomTypeFunction(const MMFF94SymbolicAtomTypeFunction &func)
CDPL::ForceField::MMFF94ChargeCalculator::setBondTypeIndexFunction
void setBondTypeIndexFunction(const MMFF94BondTypeIndexFunction &func)
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94ChargeCalculator::setPartialBondChargeIncrementTable
void setPartialBondChargeIncrementTable(const MMFF94PartialBondChargeIncrementTable::SharedPointer &table)
CDPL::ForceField::MMFF94ChargeCalculator
Definition: MMFF94ChargeCalculator.hpp:59
CDPL::ForceField::MMFF94ChargeCalculator::SharedPointer
std::shared_ptr< MMFF94ChargeCalculator > SharedPointer
Definition: MMFF94ChargeCalculator.hpp:62
MMFF94AtomTypePropertyTable.hpp
Definition of the class CDPL::ForceField::MMFF94AtomTypePropertyTable.
CDPL::ForceField::MMFF94SymbolicAtomTypeFunction
std::function< const std::string &(const Chem::Atom &)> MMFF94SymbolicAtomTypeFunction
A generic wrapper class used to store a user-defined symbolic MMFF94 atom type function.
Definition: MMFF94PropertyFunctions.hpp:61
CDPL::Util::DArray
Array< double > DArray
An array of double precision floating-point numbers.
Definition: Array.hpp:587
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ForceField::MMFF94ChargeCalculator::setFormalChargeDefinitionTable
void setFormalChargeDefinitionTable(const MMFF94FormalAtomChargeDefinitionTable::SharedPointer &table)
CDPL::ForceField::MMFF94RingSetFunction
std::function< const Chem::FragmentList::SharedPointer &(const Chem::MolecularGraph &)> MMFF94RingSetFunction
A generic wrapper class used to store a user-defined MMFF94 ring set function.
Definition: MMFF94PropertyFunctions.hpp:76
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry
Definition: MMFF94AtomTypePropertyTable.hpp:62
CDPL::ForceField::MMFF94ChargeCalculator::MMFF94ChargeCalculator
MMFF94ChargeCalculator()
MMFF94PropertyFunctions.hpp
Type definition of generic wrapper classes for storing user-defined functions for the retrieval of MM...
MMFF94FormalAtomChargeDefinitionTable.hpp
Definition of the class CDPL::ForceField::MMFF94FormalAtomChargeDefinitionTable.
CDPL::ForceField::MMFF94ChargeCalculator::MMFF94ChargeCalculator
MMFF94ChargeCalculator(const Chem::MolecularGraph &molgraph, Util::DArray &charges, bool strict)
CDPL::ForceField::MMFF94ChargeCalculator::calculate
void calculate(const Chem::MolecularGraph &molgraph, Util::DArray &charges, bool strict)
Calculates MMFF94 partial charges for the atoms of a molecular graph.