1
2
3
4
5
6
7
8
9
10
11
12
13 import math
14 from scorer import DistDepPairwiseScorer
15
16
18 """reference implementation of the Electrostatics class
19
20 Notes
21 ======
22 * For now, the MolecularSystem has the responsibility of
23 supplying charges. This could change in the future if the
24 chargeCalculators migrate away from MolKit. This requires
25 a reduced dependency on the Atoms.
26
27 * The electrostatics calculation depends on relative distance
28 not absolute coords. Hopefully, we won't need coords in this
29 class.
30
31 * A GridMap might be represencted as a 'subset' in this class
32 by defining psuedo-atoms at each grid point.
33
34 """
43
44
46 """return distance dependent dielectric permittivity
47
48 weight to be remove to WeightedMultiTermDistDepPairwiseScorer
49
50 Reference
51 ==========
52 Mehler & Solmajer (1991) Protein Engineering vol.4 no.8, pp. 903-910.
53
54 Basically, this describes a sigmoidal function from a low
55 dielectric (like organic solvent) at small distance (<5Ang)
56 asymptoticly to dielectric of water at large distance (30Ang).
57
58 epsilon(r) = A + (B/[1+ k*exp(-lambda*B*r)]) (equation 6)
59
60 where, A, lambda, and k are parameters supplied by the paper,
61 B = epsilon0 - A (so B is also a parameter)
62 epsilon0 is the dielectric constant of water at 25C (78.4)
63
64 Two sets of parameters are given in the paper:
65 {'A' : -8.5525, 'k' : 7.7839, 'lambda_' : 0.003627} [Conway]
66 {'A' : -20.929, 'k' : 3.4781, 'lambda_' : 0.001787} [Mehler&Eichele]
67 """
68
69 epsilon0 = 78.4
70 lambda_ = 0.003627
71 A = -8.5525
72 k = 7.7839
73 B = epsilon0 - A
74
75
76 epsilon = A + B / (1.0 + k*math.e**(-lambda_*B*distance))
77 return epsilon
78
79
80
81 - def _f(self, at_a, at_b, dist):
82 """Return electrostatic potential in kcal/mole.
83
84 Here's how the 332. unit conversion factor is calculated:
85
86 q = 1.60217733E-19 # (C) charge on electron
87 eps0 = 8.854E-12 # (C^2/J*m) vacuum permittivity
88 J_per_cal = 4.18400 # Joules per calorie
89 avo = 6.02214199E23 # Avogadro's number
90
91 factor = (q*avo*q*1E10 )/(4.0*math.pi*eps0*J_per_cal*1000)
92
93 """
94 q1 = at_a.charge;
95 q2 = at_b.charge;
96 epsilon = self.get_dddp(dist)
97 factor = 332.
98 if dist != 0.0:
99 return (factor*q1*q2) / (epsilon*dist)
100 else: return 0.
101
102
103 Electrostatics = ElectrostaticsRefImpl
104
105
106 if __name__ == '__main__':
107 pass
108
109