BALL  1.5.0
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);
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 
72  bool is_initialized_;
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  {
120  MMFF94AtomType();
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 
158  public MMFF94ParametersBase
159  {
160  public:
161 
163  MMFF94AtomTypes();
164 
166  MMFF94AtomTypes(const MMFF94AtomTypes& to_copy);
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 
186  public MMFF94ParametersBase
187  {
188  public:
189 
191  struct BondData
192  {
193  BondData();
194 
195  double kb_normal;
196  double r0_normal;
198 
200  double kb_sbmb;
201  double r0_sbmb;
203  bool empirical;
204  };
205 
208  {
209  double kb;
210  double r0;
211  };
212 
216 
218 
219 
221 
223  virtual ~MMFF94StretchParameters();
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 
253  StretchMap parameters_;
254  mutable StretchMap buffered_parameters_;
255  EmpiricalStretchMap empirical_parameters_;
256  };
257 
259 
264  : public MMFF94ParametersBase
265  {
266  public:
267 
270 
272 
273 
275 
277  virtual ~MMFF94BendParameters();
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 
324  virtual ~MMFF94StretchBendParameters();
325 
327  const MMFF94StretchBendParameters& operator = (const MMFF94StretchBendParameters& param)
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 
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);
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
std::vector< bool > calculated_
HashMap< Position, std::pair< double, double > > BendMap
Map with the force constant and reference angle.
const MMFF94AtomTypeEquivalences * equiv_
EmpiricalStretchMap empirical_parameters_
HashMap< String, double > PlaneMap
Map with the force constant.
StretchMap parameters_
standard parameters
StretchBendMap parameters_
parameters
char Atom[5]
Definition: PDBdefs.h:257
BALL_SIZE_TYPE Position
Position aspec
atomic number;
Position getMMFF94Index(Position atom_type1, Position atom_type2)
std::vector< double > eij_
bool valid
Is this a valid MMFF94 atom type?
HashMap< Position, std::pair< double, double > > StretchBendMap
Map with the force constant and reference angle.
virtual ~MMFF94ParametersBase()
Destructor.
const EmpiricalStretchMap & getEmpiricalParameters() const
HashMap< Position, EmpiricalBondData > EmpiricalStretchMap
bool lin
has linear bond
std::vector< std::vector< Position > > equivalences_
double kb_sbmb
parameters for optinal single-bond–multiple bond cases (see MMFFPROP.PAR)
HashMap< Position, BondData > StretchMap
HashMap< String, std::vector< double > > TorsionsMap
Map with the force constant and reference angle.
Size MMFF94_number_atom_types
hold the maximum number of MMFF94 atom types + 1 (wildcard)
Class to store the values of an atom type from MMFFPROP.PAR.
std::vector< double > rij_
BendMap parameters_
parameters
bool sbmb
can have a delocalized single bond
std::vector< double > rij_7_
#define BALL_EXPORT
Definition: COMMON/global.h:50
std::vector< double > rs_
PlaneMap parameters_
parameters
std::vector< double > phis_
const std::vector< MMFF94AtomType > & getAtomTypes() const
BALL_SIZE_TYPE Size
Definition: constants.h:12
virtual bool setup_(const std::vector< std::vector< String > > &)
Position val
number of bonds made to this atom type
Position crd
necessary number of bonded neighbours
bool pilp
has pi lone pair electrons
void setEquivalences(const MMFF94AtomTypeEquivalences &equi)
TorsionsMap parameters_
parameters
std::vector< VDWEntry > parameters_
parameters
const StretchMap & getBondParameters() const
std::vector< MMFF94AtomType > data_
bool arom
is aromatic
#define BALL_CREATE(name)
Definition: create.h:62