BALL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GAFFTypeProcessor.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_MOLMEC_AMBER_GAFFTYPEPROCESSOR_H
6 #define BALL_MOLMEC_AMBER_GAFFTYPEPROCESSOR_H
7 
8 #ifndef BALL_CONCEPT_COMPOSITE_H
9 # include <BALL/CONCEPT/composite.h>
10 #endif
11 
12 #ifndef BALL_CONCEPT_PROCESSOR_H
13 # include <BALL/CONCEPT/processor.h>
14 #endif
15 
16 #ifndef BALL_MOLMEC_AMBER_GAFFCESPARSER_H
18 #endif
19 
20 #ifndef BALL_DATATYPE_OPTIONS_H
21 # include <BALL/DATATYPE/options.h>
22 #endif
23 
24 #ifndef BALL_COMMON_EXCEPTION_H
25 # include <BALL/COMMON/exception.h>
26 #endif
27 
28 #ifndef BALL_KERNEL_MOLECULE_H
29 # include <BALL/KERNEL/molecule.h>
30 #endif
31 
32 #include <vector>
33 #include <map>
34 
35 namespace BALL
36 {
37  class BALL_EXPORT GAFFTypeProcessor : public UnaryProcessor<Composite>
38  {
39  public:
42  {
50  };
51 
53  {
55  static const String ATOMTYPE_FILENAME;
56 
59  };
60 
62  {
64  static const String ATOMTYPE_FILENAME;
65 
67  static const bool GAFF_ATOMTYPE_POSTPROCESSING;
68  };
69 
70  enum BALL_EXPORT BOND_TYPES
71  {
72  sb,
73  SB,
74  db,
75  DB,
76  TB,
77  DL,
78  AB
79  };
80 
81  GAFFTypeProcessor();
82  GAFFTypeProcessor(const Options& new_options);
83  virtual ~GAFFTypeProcessor();
84  virtual Processor::Result operator() (Composite &composite);
85 
86  std::set<String> getTypeNames() const;
87 
89 
90  protected:
91  // helper functions used in identifying the correct atom type
92  std::vector<TypeDefinition> getCarbonTypes_() { return atom_types_[6]; }
93  std::vector<TypeDefinition> getHydrogenTypes_() { return atom_types_[1]; }
94  std::vector<TypeDefinition> getNitrogenTypes_() { return atom_types_[7]; }
95  std::vector<TypeDefinition> getOxygenTypes_() { return atom_types_[8]; }
96  std::vector<TypeDefinition> getSulfurTypes_() { return atom_types_[16]; }
97 
104  void parseAtomtypeTableFile_()
105  throw(Exception::FileNotFound);
106 
108  void precomputeBondProperties_(Molecule* molecule);
109 
113  void precomputeAtomProperties_(Molecule* molecule);
114 
116  void annotateBondTypes_();
117 
119  void annotateRingSizes_();
120  void annotateAliphaticAndAromaticRingAtoms_();
121  void annotatePlanarRingAtoms_();
122  bool planarAtom_(const Atom& atom);
123 
126  bool assignAtomtype_(Atom& atom);
127 
130  void postProcessAtomTypes_(Molecule* molecule);
131 
132  //for every CESstring in atomtable store the "predicate tree"
133  //built by GAFFCESParser
134  StringHashMap<GAFFCESParser*> ces_parsers_;
135 
136  // stores the vectors of atom types indexed by atomic number for fast retrieval
137  std::map<Position, std::vector<TypeDefinition> > atom_types_;
138 
139  // smallest set of smallest rings used for atomic environment strings
140  std::vector<std::vector<Atom*> > sssr_;
141 
143  Molecule* current_molecule_;
144  };
145 }
146 
147 #endif