| 1 |
|
| 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 |
| 17 |
# include <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: |
| 40 |
|
| 41 |
struct TypeDefinition |
| 42 |
{ |
| 43 |
String atom_type; |
| 44 |
int atomic_number; |
| 45 |
int connectivity; |
| 46 |
String attached_hydrogens; |
| 47 |
String electron_withdrawal_atoms; |
| 48 |
String atomic_property; |
| 49 |
String chemical_environment; |
| 50 |
}; |
| 51 |
|
| 52 |
struct BALL_EXPORT Option |
| 53 |
{ |
| 54 |
|
| 55 |
static const String ATOMTYPE_FILENAME; |
| 56 |
|
| 57 |
|
| 58 |
static const String GAFF_ATOMTYPE_POSTPROCESSING; |
| 59 |
}; |
| 60 |
|
| 61 |
struct BALL_EXPORT Default |
| 62 |
{ |
| 63 |
|
| 64 |
static const String ATOMTYPE_FILENAME; |
| 65 |
|
| 66 |
|
| 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 |
|
| 88 |
Options options; |
| 89 |
|
| 90 |
protected: |
| 91 |
|
| 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 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
void parseAtomtypeTableFile_(); |
| 106 |
|
| 107 |
|
| 108 |
void precomputeBondProperties_(Molecule* molecule); |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
void precomputeAtomProperties_(Molecule* molecule); |
| 114 |
|
| 115 |
|
| 116 |
void annotateBondTypes_(); |
| 117 |
|
| 118 |
|
| 119 |
void annotateRingSizes_(); |
| 120 |
void annotateAliphaticAndAromaticRingAtoms_(); |
| 121 |
void annotatePlanarRingAtoms_(); |
| 122 |
bool planarAtom_(const Atom& atom); |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
bool assignAtomtype_(Atom& atom); |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
void postProcessAtomTypes_(Molecule* molecule); |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
StringHashMap<GAFFCESParser*> ces_parsers_; |
| 135 |
|
| 136 |
|
| 137 |
std::map<Position, std::vector<TypeDefinition> > atom_types_; |
| 138 |
|
| 139 |
|
| 140 |
std::vector<std::vector<Atom*> > sssr_; |
| 141 |
|
| 142 |
|
| 143 |
Molecule* current_molecule_; |
| 144 |
}; |
| 145 |
} |
| 146 |
|
| 147 |
#endif |