BALL 1.5.0
Loading...
Searching...
No Matches
MMFF94Parameters.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4// $Id: MMFF94Parameters.h,v 1.1.8.1 2007/03/25 21:25:17 oliver Exp $
5//
6
7// Molecular Mechanics: MMFF94 force field class
8
9#ifndef BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
10#define BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
11
12#ifndef BALL_COMMON_H
13# include <BALL/common.h>
14#endif
15
16#ifndef BALL_DATATYPE_HASHMAP_H
18#endif
19
20namespace BALL
21{
22
23 class Atom;
24 class Parameters;
25
26 Position getMMFF94Index(Position atom_type1, Position atom_type2);
27
30
32
33#define MMFF94_INVALID_VALUE 99.0
34
36
40 {
41 public:
42
44
45
47
49 virtual ~MMFF94ParametersBase() {};
50
52 const MMFF94ParametersBase& operator = (const MMFF94ParametersBase&)
53 {return *this;};
54
56 virtual void clear()
57 ;
58
60 bool isInitialized() { return is_initialized_;}
61
63 bool readParameters(Parameters& p, const String& section);
64
66 void setEquivalences(const MMFF94AtomTypeEquivalences& equi) { equiv_ = &equi;}
67
68 protected:
69
70 virtual bool setup_(const std::vector<std::vector<String> >&) { return true;};
71
73
74 // nr of needed fields in parameter files
77 };
78
79
85 {
86 public:
87
90
93
96
98 void clear()
99 ;
100
105 Index getEquivalence(Position original, Position number) const;
106
107 protected:
108
109 virtual bool setup_(const std::vector<std::vector<String> >&);
110 std::vector<std::vector<Position> > equivalences_;
111 std::vector<String> names_;
112 std::vector<bool> exists_;
113 };
114
115
118 {
121
124
127
130
132 bool pilp;
133
138
140 bool arom;
141
143 bool lin;
144
146 bool sbmb;
147
149 bool valid;
150 };
151
152
154
159 {
160 public:
161
164
167
170
172 const std::vector<MMFF94AtomType>& getAtomTypes() const { return data_;}
173
174 protected:
175
176 virtual bool setup_(const std::vector<std::vector<String> >&);
177 std::vector<MMFF94AtomType> data_;
178 };
179
181
187 {
188 public:
189
191 struct BondData
192 {
194
195 double kb_normal;
196 double r0_normal;
198
200 double kb_sbmb;
201 double r0_sbmb;
204 };
205
208 {
209 double kb;
210 double r0;
211 };
212
216
218
219
221
224
226 const MMFF94StretchParameters& operator = (const MMFF94StretchParameters& param)
227 ;
228
230 virtual void clear()
231 ;
232
234 bool assignParameters(Position type1, Position type2, BondData& data) const;
235
237 bool readEmpiricalParameters(Parameters& p, const String& section);
238
240 const StretchMap& getBondParameters() const { return parameters_;}
241
243 const EmpiricalStretchMap& getEmpiricalParameters() const { return empirical_parameters_;}
244
245 static double radii[];
246 static double electronegatives[];
247
248 protected:
249
250 virtual bool setup_(const std::vector<std::vector<String> >&);
251
256 };
257
259
264 : public MMFF94ParametersBase
265 {
266 public:
267
270
272
273
275
278
280 const MMFF94BendParameters& operator = (const MMFF94BendParameters& param)
281 ;
282
284 virtual void clear()
285 ;
286
288 bool assignParameters(Position bend_type,
289 Position atom_type1, Position atom_type2, Position atom_type3,
290 double& ka, double& angle) const;
291
292 protected:
293
294 virtual bool setup_(const std::vector<std::vector<String> >&);
295
296 Position getIndex_(Position bend_type, Position atom_type1, Position atom_type2, Position atom_type3) const;
297
299 BendMap parameters_;
300 mutable BendMap buffered_parameters_;
301 };
302
303
306
311 : public MMFF94ParametersBase
312 {
313 public:
314
317
319
320
322
325
328 ;
329
331 virtual void clear()
332 ;
333
335 bool assignParameters(Position stretch_bend_type, const Atom& atom1, const Atom& atom2, const Atom& atom3,
336 double& kba_ijk, double& kba_kji) const;
337
341 bool readEmpiricalParameters(Parameters& p, const String& section);
342
344
345 protected:
346
347 virtual bool setup_(const std::vector<std::vector<String> >&);
348
349 Position getIndex_(Position stretch_bend_type,
350 Position atom_type1, Position atom_type2, Position atom_type3) const;
351
352 Position getIndexByRow_(Position r1, Position r2, Position r3) const;
353
355 StretchBendMap parameters_;
356 mutable StretchBendMap buffered_parameters_;
357 StretchBendMap parameters_by_row_;
358 };
359
362
367 : public MMFF94ParametersBase
368 {
369 public:
370
373
375
376
378
381
383 const MMFF94TorsionParameters& operator = (const MMFF94TorsionParameters& param)
384 ;
385
387 virtual void clear()
388 ;
389
391 bool assignParameters(Position type_index,
392 Index at1, Index at2, Index at3, Index at4,
393 double& v1, double& v2, double& v3) const;
394
395 protected:
396
397 virtual bool setup_(const std::vector<std::vector<String> >&);
398
399 String getIndex_(Position type, Position atom_type1, Position atom_type2, Position atom_type3, Position atom_type4) const;
400
402 TorsionsMap parameters_;
403 mutable TorsionsMap buffered_parameters_;
404 static Position ic_[5];
405 static Position lc_[5];
406 };
407
410
415 : public MMFF94ParametersBase
416 {
417 public:
418
421
423
424
426
429
431 const MMFF94PlaneParameters& operator = (const MMFF94PlaneParameters& param)
432 ;
433
435 virtual void clear()
436 ;
437
439 bool assignParameters(Index at1, Index at2, Index at3, Index at4, double& v) const;
440
441 protected:
442
443 virtual bool setup_(const std::vector<std::vector<String> >&);
444
445 String getIndex_(Position atom_type1, Position atom_type2, Position atom_type3, Position atom_type4) const;
446
448 PlaneMap parameters_;
449 mutable PlaneMap buffered_parameters_;
450 };
451
454
459 : public MMFF94ParametersBase
460 {
461 public:
462
463 struct VDWEntry
464 {
465 double alpha_i;
466 double ni;
467 double ai;
468 double gi;
470 bool valid;
471 };
472
474
475
477
480
482 const MMFF94VDWParameters& operator = (const MMFF94VDWParameters& param)
483 ;
484
486 virtual void clear()
487 ;
488
490 double getR(Position atom_type) const;
491
493 const VDWEntry& getParameters(Index at) const;
494
496 bool assignParameters(Position at1, Position at2, double& rij, double& rij_7_, double& eij) const;
497
498 protected:
499
500 virtual bool setup_(const std::vector<std::vector<String> >&);
501
503 std::vector<VDWEntry> parameters_;
504
505 // R star ii for all individual atom types
506 mutable std::vector<double> rs_;
507
508 // R star ij for pairs of atom types
509 mutable std::vector<double> rij_;
510 // R star ij ^ 7 for pairs of atom types
511 mutable std::vector<double> rij_7_;
512 // R star ij and for pairs of atom types
513 mutable std::vector<double> eij_;
514 // bools if indivual value was already calculated
515 mutable std::vector<bool> calculated_;
516 };
517
518
521
526 : public MMFF94ParametersBase
527 {
528 public:
529
531
532
534
537
539 const MMFF94ESParameters& operator = (const MMFF94ESParameters& param)
540 ;
541
543 virtual void clear()
544 ;
545
550 double getPartialCharge(Position at1, Position at2, Position bt) const;
551
553 bool readEmpiricalParameters(Parameters& p, const String& section);
554
556 double getPhi(Index atom_type) const;
557
559 double getPBCI(Index atom_type) const;
560
561 protected:
562
563 virtual bool setup_(const std::vector<std::vector<String> >&);
564 Position getIndex_(Position at1, Position at2, Position bt) const;
565
567 std::vector<double> parameters_, phis_, pbcis_;
568 };
569
570
571} // namespace BALL
572
573#endif // BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
#define BALL_CREATE(name)
Definition create.h:62
STL namespace.
Size MMFF94_number_atom_types
hold the maximum number of MMFF94 atom types + 1 (wildcard)
Position getMMFF94Index(Position atom_type1, Position atom_type2)
char Atom[5]
Definition PDBdefs.h:257
HashMap class based on the STL map (containing serveral convenience functions)
bool readParameters(Parameters &p, const String &section)
virtual bool setup_(const std::vector< std::vector< String > > &)
const MMFF94AtomTypeEquivalences * equiv_
virtual void clear()
Clear method.
void setEquivalences(const MMFF94AtomTypeEquivalences &equi)
MMFF94AtomTypeEquivalences(const MMFF94AtomTypeEquivalences &to_copy)
std::vector< std::vector< Position > > equivalences_
virtual bool setup_(const std::vector< std::vector< String > > &)
Index getEquivalence(Position original, Position number) const
Class to store the values of an atom type from MMFFPROP.PAR.
bool valid
Is this a valid MMFF94 atom type?
bool lin
has linear bond
Position aspec
atomic number;
Position val
number of bonds made to this atom type
bool sbmb
can have a delocalized single bond
bool pilp
has pi lone pair electrons
Position crd
necessary number of bonded neighbours
virtual bool setup_(const std::vector< std::vector< String > > &)
std::vector< MMFF94AtomType > data_
MMFF94AtomTypes(const MMFF94AtomTypes &to_copy)
const std::vector< MMFF94AtomType > & getAtomTypes() const
HashMap< Position, BondData > StretchMap
EmpiricalStretchMap empirical_parameters_
virtual bool setup_(const std::vector< std::vector< String > > &)
const EmpiricalStretchMap & getEmpiricalParameters() const
HashMap< Position, EmpiricalBondData > EmpiricalStretchMap
StretchMap parameters_
standard parameters
double kb_sbmb
parameters for optinal single-bond–multiple bond cases (see MMFFPROP.PAR)
HashMap< Position, std::pair< double, double > > BendMap
Map with the force constant and reference angle.
HashMap< Position, std::pair< double, double > > StretchBendMap
Map with the force constant and reference angle.
HashMap< String, std::vector< double > > TorsionsMap
Map with the force constant and reference angle.
HashMap< String, double > PlaneMap
Map with the force constant.
#define BALL_EXPORT