BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
17 # include <BALL/DATATYPE/hashMap.h>
18 #endif
19 
20 namespace BALL
21 {
22 
23  class Atom;
24  class Parameters;
25 
26  Position getMMFF94Index(Position atom_type1, Position atom_type2);
27 
30 
31  class MMFF94AtomTypeEquivalences;
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)
65 
67  void setEquivalences(const MMFF94AtomTypeEquivalences& equi) { equiv_ = &equi;}
68 
69  protected:
70 
71  virtual bool setup_(const std::vector<std::vector<String> >&) { return true;};
72 
73  bool is_initialized_;
74 
75  // nr of needed fields in parameter files
78  };
79 
80 
86  {
87  public:
88 
91 
94 
97 
99  void clear()
100  ;
101 
106  Index getEquivalence(Position original, Position number) const;
107 
108  protected:
109 
110  virtual bool setup_(const std::vector<std::vector<String> >&);
111  std::vector<std::vector<Position> > equivalences_;
112  std::vector<String> names_;
113  std::vector<bool> exists_;
114  };
115 
116 
119  {
121  MMFF94AtomType();
122 
125 
128 
131 
133  bool pilp;
134 
139 
141  bool arom;
142 
144  bool lin;
145 
147  bool sbmb;
148 
150  bool valid;
151  };
152 
153 
155 
159  public MMFF94ParametersBase
160  {
161  public:
162 
164  MMFF94AtomTypes();
165 
167  MMFF94AtomTypes(const MMFF94AtomTypes& to_copy);
168 
171 
173  const std::vector<MMFF94AtomType>& getAtomTypes() const { return data_;}
174 
175  protected:
176 
177  virtual bool setup_(const std::vector<std::vector<String> >&);
178  std::vector<MMFF94AtomType> data_;
179  };
180 
182 
187  public MMFF94ParametersBase
188  {
189  public:
190 
192  struct BondData
193  {
194  BondData();
195 
196  double kb_normal;
197  double r0_normal;
199 
201  double kb_sbmb;
202  double r0_sbmb;
204  bool empirical;
205  };
206 
209  {
210  double kb;
211  double r0;
212  };
213 
217 
219 
220 
222 
224  virtual ~MMFF94StretchParameters();
225 
227  const MMFF94StretchParameters& operator = (const MMFF94StretchParameters& param)
228  ;
229 
231  virtual void clear()
232  ;
233 
235  bool assignParameters(Position type1, Position type2, BondData& data) const;
236 
238  bool readEmpiricalParameters(Parameters& p, const String& section);
239 
241  const StretchMap& getBondParameters() const { return parameters_;}
242 
244  const EmpiricalStretchMap& getEmpiricalParameters() const { return empirical_parameters_;}
245 
246  static double radii[];
247  static double electronegatives[];
248 
249  protected:
250 
251  virtual bool setup_(const std::vector<std::vector<String> >&);
252 
257  };
258 
260 
265  : public MMFF94ParametersBase
266  {
267  public:
268 
271 
273 
274 
276 
278  virtual ~MMFF94BendParameters();
279 
281  const MMFF94BendParameters& operator = (const MMFF94BendParameters& param)
282  ;
283 
285  virtual void clear()
286  ;
287 
289  bool assignParameters(Position bend_type,
290  Position atom_type1, Position atom_type2, Position atom_type3,
291  double& ka, double& angle) const;
292 
293  protected:
294 
295  virtual bool setup_(const std::vector<std::vector<String> >&);
296 
297  Position getIndex_(Position bend_type, Position atom_type1, Position atom_type2, Position atom_type3) const;
298 
300  BendMap parameters_;
301  mutable BendMap buffered_parameters_;
302  };
303 
304 
307 
312  : public MMFF94ParametersBase
313  {
314  public:
315 
318 
320 
321 
323 
325  virtual ~MMFF94StretchBendParameters();
326 
328  const MMFF94StretchBendParameters& operator = (const MMFF94StretchBendParameters& param)
329  ;
330 
332  virtual void clear()
333  ;
334 
336  bool assignParameters(Position stretch_bend_type, const Atom& atom1, const Atom& atom2, const Atom& atom3,
337  double& kba_ijk, double& kba_kji) const;
338 
340  bool readEmpiricalParameters(Parameters& p, const String& section)
341  throw(Exception::FileNotFound);
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 
380  virtual ~MMFF94TorsionParameters();
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 
428  virtual ~MMFF94PlaneParameters();
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 
479  virtual ~MMFF94VDWParameters();
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 
536  virtual ~MMFF94ESParameters();
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)
555 
557  double getPhi(Index atom_type) const;
558 
560  double getPBCI(Index atom_type) const;
561 
562  protected:
563 
564  virtual bool setup_(const std::vector<std::vector<String> >&);
565  Position getIndex_(Position at1, Position at2, Position bt) const;
566 
568  std::vector<double> parameters_, phis_, pbcis_;
569  };
570 
571 
572 } // namespace BALL
573 
574 #endif // BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
EmpiricalStretchMap empirical_parameters_
double kb_sbmb
parameters for optinal single-bond–multiple bond cases (see MMFFPROP.PAR)
virtual bool setup_(const std::vector< std::vector< String > > &)
#define BALL_CREATE(name)
Definition: create.h:62
const EmpiricalStretchMap & getEmpiricalParameters() const
HashMap< String, std::vector< double > > TorsionsMap
Map with the force constant and reference angle.
HashMap< String, double > PlaneMap
Map with the force constant.
bool sbmb
can have a delocalized single bond
bool lin
has linear bond
HashMap< Position, std::pair< double, double > > StretchBendMap
Map with the force constant and reference angle.
bool pilp
has pi lone pair electrons
StretchMap parameters_
standard parameters
HashMap< Position, BondData > StretchMap
bool arom
is aromatic
Class to store the values of an atom type from MMFFPROP.PAR.
std::vector< double > phis_
std::vector< MMFF94AtomType > data_
Position getMMFF94Index(Position atom_type1, Position atom_type2)
const std::vector< MMFF94AtomType > & getAtomTypes() const
void setEquivalences(const MMFF94AtomTypeEquivalences &equi)
BALL_SIZE_TYPE Size
Size MMFF94_number_atom_types
hold the maximum number of MMFF94 atom types + 1 (wildcard)
Position crd
necessary number of bonded neighbours
virtual ~MMFF94ParametersBase()
Destructor.
char Atom[5]
Definition: PDBdefs.h:257
Position aspec
atomic number;
HashMap< Position, EmpiricalBondData > EmpiricalStretchMap
std::vector< std::vector< Position > > equivalences_
bool valid
Is this a valid MMFF94 atom type?
#define BALL_EXPORT
Definition: COMMON/global.h:50
const MMFF94AtomTypeEquivalences * equiv_
BALL_SIZE_TYPE Position
HashMap< Position, std::pair< double, double > > BendMap
Map with the force constant and reference angle.
Position val
number of bonds made to this atom type