Chemical Data Processing Library C++ API - Version 1.1.1
MMFF94AtomTyper.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94AtomTyper.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_MMFF94ATOMTYPER_HPP
30 #define CDPL_FORCEFIELD_MMFF94ATOMTYPER_HPP
31 
32 #include <vector>
33 #include <string>
34 #include <cstddef>
35 #include <memory>
36 
45 #include "CDPL/Util/Array.hpp"
46 
47 
48 namespace CDPL
49 {
50 
51  namespace Chem
52  {
53 
54  class Fragment;
55  }
56 
57  namespace ForceField
58  {
59 
61  {
62 
63  public:
64  typedef std::shared_ptr<MMFF94AtomTyper> SharedPointer;
65 
67 
68  MMFF94AtomTyper(const Chem::MolecularGraph& molgraph, Util::SArray& sym_types, Util::UIArray& num_types, bool strict);
69 
71 
73 
75 
77 
79 
81 
82  void perceiveTypes(const Chem::MolecularGraph& molgraph, Util::SArray& sym_types, Util::UIArray& num_types, bool strict);
83 
84  private:
86 
87  void init(const Chem::MolecularGraph& molgraph, Util::SArray& sym_types, Util::UIArray& num_types);
88 
89  void assignProvisionalSymbolicAtomTypes(bool strict);
90  void assignAromaticAtomTypes();
91  void assignHydrogenAtomTypes();
92  void assignNumericAtomTypes(Util::UIArray& num_types);
93 
94  void assignAromaticAtomTypes(const Chem::Fragment* ring);
95 
96  std::size_t getUniqueHeteroAtomIndex(const Chem::Fragment& ring) const;
97  std::size_t calcHeteroAtomDistance(std::size_t r_size, std::size_t het_atom_idx, std::size_t from_atom_idx) const;
98 
99  bool isN5Anion(const Chem::Fragment& ring) const;
100  bool isImidazoliumCation(const Chem::Fragment& ring) const;
101 
102  bool matchesAromTypeDefEntry(bool wc_match, const std::string& sym_type, unsigned int atomic_no,
103  std::size_t r_size, std::size_t het_dist, bool im_cat, bool n5_anion,
104  const AromTypeDefEntry& entry) const;
105 
106  typedef std::vector<const Chem::Fragment*> RingList;
107 
113  MMFF94RingSetFunction aromRingSetFunc;
114  const Chem::MolecularGraph* molGraph;
115  Util::SArray* symTypes;
116  RingList aromRings;
117  Chem::PatternAtomTyper atomTyper;
118  };
119  } // namespace ForceField
120 } // namespace CDPL
121 
122 #endif // CDPL_FORCEFIELD_MMFF94ATOMTYPER_HPP
CDPL::ForceField::MMFF94AtomTyper::SharedPointer
std::shared_ptr< MMFF94AtomTyper > SharedPointer
Definition: MMFF94AtomTyper.hpp:64
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::Util::SArray
Array< std::string > SArray
An array of std::string objects.
Definition: Array.hpp:592
CDPL::ForceField::MMFF94AtomTyper::perceiveTypes
void perceiveTypes(const Chem::MolecularGraph &molgraph, Util::SArray &sym_types, Util::UIArray &num_types, bool strict)
CDPL::ForceField::MMFF94AtomTyper::MMFF94AtomTyper
MMFF94AtomTyper(const Chem::MolecularGraph &molgraph, Util::SArray &sym_types, Util::UIArray &num_types, bool strict)
CDPL::ForceField::MMFF94AromaticAtomTypeDefinitionTable::Entry
Definition: MMFF94AromaticAtomTypeDefinitionTable.hpp:63
CDPL::ForceField::MMFF94AtomTyper::setSymbolicToNumericAtomTypeMap
void setSymbolicToNumericAtomTypeMap(const MMFF94SymbolicToNumericAtomTypeMap::SharedPointer &map)
CDPL::ForceField::MMFF94AtomTyper::setHeavyToHydrogenAtomTypeMap
void setHeavyToHydrogenAtomTypeMap(const MMFF94HeavyToHydrogenAtomTypeMap::SharedPointer &map)
CDPL::ForceField::MMFF94AromaticAtomTypeDefinitionTable::SharedPointer
std::shared_ptr< MMFF94AromaticAtomTypeDefinitionTable > SharedPointer
Definition: MMFF94AromaticAtomTypeDefinitionTable.hpp:57
MMFF94SymbolicToNumericAtomTypeMap.hpp
Definition of the class CDPL::ForceField::MMFF94SymbolicToNumericAtomTypeMap.
CDPL::ForceField::MMFF94AtomTyper::setAtomTypePropertyTable
void setAtomTypePropertyTable(const MMFF94AtomTypePropertyTable::SharedPointer &table)
MMFF94HeavyToHydrogenAtomTypeMap.hpp
Definition of the class CDPL::ForceField::MMFF94HeavyToHydrogenAtomTypeMap.
CDPL::ForceField::MMFF94AtomTyper
Definition: MMFF94AtomTyper.hpp:61
CDPL::Chem::Fragment
Fragment.
Definition: Fragment.hpp:52
CDPL::ForceField::MMFF94AtomTypePropertyTable::SharedPointer
std::shared_ptr< MMFF94AtomTypePropertyTable > SharedPointer
Definition: MMFF94AtomTypePropertyTable.hpp:59
CDPL::ForceField::MMFF94SymbolicToNumericAtomTypeMap::SharedPointer
std::shared_ptr< MMFF94SymbolicToNumericAtomTypeMap > SharedPointer
Definition: MMFF94SymbolicToNumericAtomTypeMap.hpp:53
MMFF94SymbolicAtomTypePatternTable.hpp
Pattern of the class CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable.
CDPL::ForceField::MMFF94AtomTyper::setSymbolicAtomTypePatternTable
void setSymbolicAtomTypePatternTable(const MMFF94SymbolicAtomTypePatternTable::SharedPointer &table)
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
Array.hpp
Definition of the class CDPL::Util::Array.
PatternAtomTyper.hpp
Definition of the class CDPL::Chem::PatternAtomTyper.
CDPL::ForceField::MMFF94AtomTyper::setAromaticAtomTypeDefinitionTable
void setAromaticAtomTypeDefinitionTable(const MMFF94AromaticAtomTypeDefinitionTable::SharedPointer &table)
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::SharedPointer
std::shared_ptr< MMFF94SymbolicAtomTypePatternTable > SharedPointer
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:58
MMFF94AromaticAtomTypeDefinitionTable.hpp
Definition of the class CDPL::ForceField::MMFF94AromaticAtomTypeDefinitionTable.
CDPL::Chem::PatternAtomTyper
PatternAtomTyper.
Definition: PatternAtomTyper.hpp:52
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94AtomTyper::MMFF94AtomTyper
MMFF94AtomTyper()
CDPL::ForceField::MMFF94AtomTyper::setAromaticRingSetFunction
void setAromaticRingSetFunction(const MMFF94RingSetFunction &func)
MMFF94AtomTypePropertyTable.hpp
Definition of the class CDPL::ForceField::MMFF94AtomTypePropertyTable.
CDPL::ForceField::MMFF94HeavyToHydrogenAtomTypeMap::SharedPointer
std::shared_ptr< MMFF94HeavyToHydrogenAtomTypeMap > SharedPointer
Definition: MMFF94HeavyToHydrogenAtomTypeMap.hpp:53
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Util::UIArray
Array< unsigned int > UIArray
An array of unsigned integers.
Definition: Array.hpp:562
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
MMFF94PropertyFunctions.hpp
Type definition of generic wrapper classes for storing user-defined functions for the retrieval of MM...