BALL  1.5.0
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 
105  void parseAtomtypeTableFile_();
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
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 
144  };
145 }
146 
147 #endif
BALL::GAFFTypeProcessor::getSulfurTypes_
std::vector< TypeDefinition > getSulfurTypes_()
Definition: GAFFTypeProcessor.h:96
BALL::GAFFTypeProcessor::current_molecule_
Molecule * current_molecule_
Definition: GAFFTypeProcessor.h:143
BALL::Molecule
Definition: molecule.h:29
BALL::Options
Definition: options.h:46
BALL::GAFFTypeProcessor::getHydrogenTypes_
std::vector< TypeDefinition > getHydrogenTypes_()
Definition: GAFFTypeProcessor.h:93
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::GAFFTypeProcessor::options
Options options
Definition: GAFFTypeProcessor.h:88
BALL::GAFFTypeProcessor::Option
Definition: GAFFTypeProcessor.h:52
DL
DL
Definition: GAFFTypeProcessor.h:72
BALL::GAFFTypeProcessor::TypeDefinition::chemical_environment
String chemical_environment
Definition: GAFFTypeProcessor.h:49
SB
SB
Definition: GAFFTypeProcessor.h:72
BALL::GAFFTypeProcessor::atom_types_
std::map< Position, std::vector< TypeDefinition > > atom_types_
Definition: GAFFTypeProcessor.h:137
BALL::StringHashMap
Definition: stringHashMap.h:40
db
db
Definition: GAFFTypeProcessor.h:72
sb
sb
Definition: GAFFTypeProcessor.h:72
BALL::Atom
Definition: atom.h:87
BALL
Definition: constants.h:12
BALL::GAFFTypeProcessor::TypeDefinition::atomic_number
int atomic_number
Definition: GAFFTypeProcessor.h:44
BALL::String
Definition: string.h:56
BALL::GAFFTypeProcessor::TypeDefinition::atomic_property
String atomic_property
Definition: GAFFTypeProcessor.h:48
exception.h
BALL::GAFFTypeProcessor::TypeDefinition::electron_withdrawal_atoms
String electron_withdrawal_atoms
Definition: GAFFTypeProcessor.h:47
BALL::GAFFTypeProcessor::TypeDefinition
Nested class definitions.
Definition: GAFFTypeProcessor.h:41
options.h
BALL::GAFFTypeProcessor::Option::ATOMTYPE_FILENAME
static const String ATOMTYPE_FILENAME
path to the file containing the atom type definitions
Definition: GAFFTypeProcessor.h:55
BALL::GAFFTypeProcessor::TypeDefinition::atom_type
String atom_type
Definition: GAFFTypeProcessor.h:43
BALL::GAFFTypeProcessor::getOxygenTypes_
std::vector< TypeDefinition > getOxygenTypes_()
Definition: GAFFTypeProcessor.h:95
BALL::GAFFTypeProcessor::Default
Definition: GAFFTypeProcessor.h:61
BALL::GAFFTypeProcessor::Default::ATOMTYPE_FILENAME
static const String ATOMTYPE_FILENAME
path to the file containing the atom type definitions
Definition: GAFFTypeProcessor.h:64
BALL::GAFFTypeProcessor
Definition: GAFFTypeProcessor.h:37
GAFFCESParser.h
TB
TB
Definition: GAFFTypeProcessor.h:72
processor.h
composite.h
BALL::GAFFTypeProcessor::TypeDefinition::connectivity
int connectivity
Definition: GAFFTypeProcessor.h:45
BALL::UnaryProcessor
Definition: processor.h:58
BALL::GAFFTypeProcessor::TypeDefinition::attached_hydrogens
String attached_hydrogens
Definition: GAFFTypeProcessor.h:46
BALL::GAFFTypeProcessor::ces_parsers_
StringHashMap< GAFFCESParser * > ces_parsers_
Definition: GAFFTypeProcessor.h:134
BALL::GAFFTypeProcessor::getCarbonTypes_
std::vector< TypeDefinition > getCarbonTypes_()
Definition: GAFFTypeProcessor.h:92
DB
DB
Definition: GAFFTypeProcessor.h:72
BALL::GAFFTypeProcessor::sssr_
std::vector< std::vector< Atom * > > sssr_
Definition: GAFFTypeProcessor.h:140
BALL::GAFFTypeProcessor::getNitrogenTypes_
std::vector< TypeDefinition > getNitrogenTypes_()
Definition: GAFFTypeProcessor.h:94
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL::GAFFTypeProcessor::Option::GAFF_ATOMTYPE_POSTPROCESSING
static const String GAFF_ATOMTYPE_POSTPROCESSING
switch cleanup of GAFF types (cc=>cd, ...) on or off
Definition: GAFFTypeProcessor.h:58
BALL::GAFFTypeProcessor::Default::GAFF_ATOMTYPE_POSTPROCESSING
static const bool GAFF_ATOMTYPE_POSTPROCESSING
switch cleanup of GAFF types (cc=>cd, ...) on or off
Definition: GAFFTypeProcessor.h:67
molecule.h