| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#ifndef BALL_MOLMEC_MMFF94_PROCESSORS_H |
| 8 |
#define BALL_MOLMEC_MMFF94_PROCESSORS_H |
| 9 |
|
| 10 |
#ifndef BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H |
| 11 |
# include <BALL/MOLMEC/MMFF94/MMFF94Parameters.h> |
| 12 |
#endif |
| 13 |
|
| 14 |
#ifndef BALL_DATATYPE_HASHSET_H |
| 15 |
# include <BALL/DATATYPE/hashSet.h> |
| 16 |
#endif |
| 17 |
|
| 18 |
#ifndef BALL_DATATYPE_STRINGHASHMAP_H |
| 19 |
# include <BALL/DATATYPE/stringHashMap.h> |
| 20 |
#endif |
| 21 |
|
| 22 |
#ifndef BALL_KERNEL_BOND_H |
| 23 |
# include <BALL/KERNEL/bond.h> |
| 24 |
#endif |
| 25 |
|
| 26 |
#ifndef BALL_STRUCTURE_ATOMTYPER_H |
| 27 |
# include <BALL/STRUCTURE/atomTyper.h> |
| 28 |
#endif |
| 29 |
|
| 30 |
#include <vector> |
| 31 |
|
| 32 |
namespace BALL |
| 33 |
{ |
| 34 |
using std::vector; |
| 35 |
|
| 36 |
class MMFF94ESParameters; |
| 37 |
class Molecule; |
| 38 |
class System; |
| 39 |
|
| 40 |
|
| 41 |
class BALL_EXPORT MMFF94AtomTyper |
| 42 |
: public AtomTyper |
| 43 |
{ |
| 44 |
public: |
| 45 |
|
| 46 |
struct AromaticType |
| 47 |
{ |
| 48 |
String new_type; |
| 49 |
Position atomic_number; |
| 50 |
bool cation; |
| 51 |
bool anion; |
| 52 |
}; |
| 53 |
|
| 54 |
BALL_CREATE(MMFF94AtomTyper) |
| 55 |
|
| 56 |
|
| 57 |
MMFF94AtomTyper(); |
| 58 |
|
| 59 |
|
| 60 |
MMFF94AtomTyper(const MMFF94AtomTyper& t); |
| 61 |
|
| 62 |
|
| 63 |
virtual ~MMFF94AtomTyper() {}; |
| 64 |
|
| 65 |
|
| 66 |
virtual void assignTo(System& s); |
| 67 |
|
| 68 |
|
| 69 |
virtual bool setupHydrogenTypes(Parameters& p, const String& section); |
| 70 |
|
| 71 |
|
| 72 |
virtual bool setupSymbolsToTypes(Parameters& p, const String& section); |
| 73 |
|
| 74 |
|
| 75 |
virtual bool setupAromaticTypes(Parameters& p, const String& section); |
| 76 |
|
| 77 |
|
| 78 |
void collectHeteroAtomTypes(const MMFF94AtomTypes& atom_types); |
| 79 |
|
| 80 |
protected: |
| 81 |
|
| 82 |
bool assignAromaticType_5_(Atom& atom, Position L5, bool anion, bool cation); |
| 83 |
|
| 84 |
StringHashMap<String> partner_type_to_htype_; |
| 85 |
StringHashMap<Position> id_to_type_; |
| 86 |
HashMap<String, AromaticType> aromatic_types_5_map_; |
| 87 |
HashSet<String> cation_atoms_; |
| 88 |
MMFF94AtomTypes* atom_types_; |
| 89 |
HashSet<Position> hetero_atom_types_; |
| 90 |
}; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
class BALL_EXPORT MMFF94ChargeProcessor |
| 97 |
: public UnaryProcessor<Atom> |
| 98 |
{ |
| 99 |
public: |
| 100 |
|
| 101 |
BALL_CREATE(MMFF94ChargeProcessor) |
| 102 |
|
| 103 |
|
| 104 |
MMFF94ChargeProcessor(); |
| 105 |
|
| 106 |
|
| 107 |
MMFF94ChargeProcessor(const MMFF94ChargeProcessor& cp); |
| 108 |
|
| 109 |
|
| 110 |
virtual ~MMFF94ChargeProcessor() {}; |
| 111 |
|
| 112 |
|
| 113 |
const MMFF94ChargeProcessor& operator = (const MMFF94ChargeProcessor& cp) |
| 114 |
; |
| 115 |
|
| 116 |
|
| 117 |
virtual void clear() |
| 118 |
; |
| 119 |
|
| 120 |
|
| 121 |
virtual bool start(); |
| 122 |
|
| 123 |
|
| 124 |
virtual bool finish(); |
| 125 |
|
| 126 |
|
| 127 |
virtual Processor::Result operator () (Atom& atom); |
| 128 |
|
| 129 |
|
| 130 |
void assignFormalCharge(Atom& atom); |
| 131 |
|
| 132 |
|
| 133 |
const HashSet<Atom*>& getUnassignedAtoms() { return unassigned_atoms_;} |
| 134 |
|
| 135 |
|
| 136 |
void setESParameters(const MMFF94ESParameters& es) { es_parameters_ = &es; } |
| 137 |
|
| 138 |
|
| 139 |
void setup(const String& filename); |
| 140 |
|
| 141 |
|
| 142 |
void setAromaticRings(const vector<HashSet<Atom*> >& rings) { aromatic_rings_ = rings;} |
| 143 |
|
| 144 |
protected: |
| 145 |
|
| 146 |
void assignPartialCharges_(); |
| 147 |
|
| 148 |
vector<Atom*> atoms_; |
| 149 |
HashSet<Atom*> unassigned_atoms_; |
| 150 |
const MMFF94ESParameters* es_parameters_; |
| 151 |
HashMap<String, float> types_to_charges_; |
| 152 |
HashSet<String> rule_types_; |
| 153 |
vector<HashSet<Atom*> > aromatic_rings_; |
| 154 |
}; |
| 155 |
|
| 156 |
} |
| 157 |
|
| 158 |
#endif |