1
2
3
4
5
6
7
8
9
10
11
12
13
14 import Numeric, math
15 from scorer import DistDepPairwiseScorer
16
17
18
21 DistDepPairwiseScorer.__init__(self)
22
23 self.required_attr_dictA.setdefault('autodock_element', False)
24 self.required_attr_dictA.setdefault('AtVol', False)
25 self.required_attr_dictB.setdefault('autodock_element', False)
26 if ms is not None:
27 self.set_molecular_system(ms)
28
29
30
31 self.sol_par = {
32 'C': 0.004,
33 'A': 0.0006}
34
35
36
37
38
39
40
41
42 dsolv_weight = 0.1711
43 self.sol_const = {
44 'O': 0.236/dsolv_weight,
45 'H': 0.118/dsolv_weight,
46 }
47
48
50 """return distance dependent solvation parameter
51
52 WHERE DID THIS COME FROM??
53 ===========================
54
55 Stouten @@ Document this @@
56 """
57 sigma = 3.6
58 minus_inv_two_sigma_sqd = -1.0 / (2.0*(sigma*sigma))
59 exponent = minus_inv_two_sigma_sqd*(distance*distance)
60 ddsol = math.e**exponent
61 return ddsol
62
63
64 - def _f(self, at_a, at_b, dist):
65 """Return desolvation energy in kcal/mole.
66
67 Atom Volumes are in units of kcal/mol*Ang**3
68 NB: pdbqs volumes are cal/mol*Ang**3 and must be converted!!
69 This is done by MolecularSystem.py for now.
70
71 In Autodock3.0.5, this term is valid only for C atoms
72 in the ligand and is used to descriminate aromatic carbons
73 from aliphatic carbons
74 """
75 elm_a = at_a.autodock_element
76
77
78 vol_a = at_a.AtVol
79 elm_b = at_b.autodock_element
80 energy = 0.0
81 sp = self.sol_par.get(elm_b, 0.0)
82 if sp != 0.0:
83 energy = - 1.0 * sp * vol_a * self.get_ddsol(dist)
84 return energy
85
86 - def post_process(self):
87
88
89 atoms_bx = self.ms.configuration[1]
90 atoms_b = self.ms.get_entities(atoms_bx)
91
92
93 atoms_ax = self.ms.configuration[0]
94 atoms_a = self.ms.get_entities(0)
95 num_R_atoms = len(atoms_a)
96
97
98 smeared_Oxygen_sol_const = 1.3793/ num_R_atoms
99
100
101
102 smeared_Hydrogen_sol_const = 0.6897/ num_R_atoms
103
104
105
106
107
108
109
110 for row in xrange(len(atoms_a)):
111
112 for i,ats in enumerate(self.ms.get_entities(atoms_bx)):
113 element = ats.element
114 if element == 'H':
115 self.array[row][i] += smeared_Hydrogen_sol_const
116 elif element =='O':
117 self.array[row][i] += smeared_Oxygen_sol_const
118
119 Desolvation = DesolvationRefImpl
120
121
122
123
124
126
127
128 Vols = {}
129 Vols["C"] = Vols["C"] = Vols["A"] = 33.5103
130 Vols["N"] = Vols["NA"] = Vols["Na"] = Vols["n"] = 22.4493
131 Vols["O"] = Vols["OA"] = Vols["Oa"] = 17.1573
132 Vols["P"] = 38.7924
133 Vols["S"] = Vols["SA"] = Vols["Sa"] = 33.5103
134 Vols["H"] = Vols["HD"] = Vols["HS"] = Vols["Hd"] = Vols["Hs"] =0.00
135 Vols["F"] = 15.448
136 Vols["f"] = Vols["FE"] = Vols["Fe"] = 1.84
137 Vols["I"] = 55.0585
138 Vols["M"] = Vols["MG"] = Vols["Mg"] = 1.56
139 Vols["MN"]= 2.14
140 Vols["Z"] = Vols["ZN"] = Vols["Zn"] = 1.70
141 Vols["L"] = Vols["CA"] = Vols["Ca"] = 2.77
142 Vols["c"] = Vols["CL"] = Vols["Cl"] = 35.8235
143 Vols["b"] = Vols["BR"] = Vols["Br"] = 42.5661
144
145
146
147 Solpars = {
148 'C': -0.00143,
149 'A': -0.00052,
150 'N': -0.00162,
151 'NA':-0.00162,
152 'O': -0.00251,
153 'OA':-0.00251,
154 'H': 0.00051,
155 'HD': 0.00051,
156 'S': -0.00214,
157 'SA':-0.00214}
158
159
160
161 - def __init__(self, ms=None, solpar_q = 0.01097):
162 DistDepPairwiseScorer.__init__(self)
163
164 self.required_attr_dictA = {}
165 self.required_attr_dictA.setdefault('autodock_element', False)
166 self.required_attr_dictB.setdefault('autodock_element', False)
167 if ms is not None:
168 self.set_molecular_system(ms)
169
170
171 self.solpar_q = solpar_q
172
173
174
176 """return distance dependent solvation parameter
177
178 WHERE DID THIS COME FROM??
179 ===========================
180
181 Stouten @@ Document this @@
182 """
183 sigma = 3.6
184 minus_inv_two_sigma_sqd = -1.0 / (2.0*(sigma*sigma))
185 exponent = minus_inv_two_sigma_sqd*(distance*distance)
186 ddsol = math.e**exponent
187 return ddsol
188
189
190 - def _f(self, at_a, at_b, dist):
191 """Return desolvation energy in kcal/mole.
192
193 Atom Volumes are in units of kcal/mol*Ang**3
194 NB: pdbqs volumes are cal/mol*Ang**3 and must be converted!!
195 This is done by MolecularSystem.py for now.
196
197 In Autodock3.0.5, this term is valid only for C atoms
198 in the ligand and is used to discriminate aromatic carbons
199 from aliphatic carbons
200 """
201 elm_a = at_a.autodock_element
202 charge_a = at_a.charge
203
204 vol_a = self.Vols.get(elm_a, 33.5103)
205
206
207 sp_a = self.Solpars.get(elm_a, -0.00110)
208
209
210
211 elm_b = at_b.autodock_element
212 charge_b = at_b.charge
213
214 vol_b = self.Vols.get(elm_b, 33.5103)
215
216
217 sp_b = self.Solpars.get(elm_b, -0.00110)
218
219 lig_energy = 0.0
220 rec_energy = 0.0
221
222 sol_func = self.get_ddsol(dist)
223
224
225 rec_at_energy = (sp_a + self.solpar_q*abs(charge_a))*vol_b * sol_func
226 lig_at_energy = (sp_b + self.solpar_q*abs(charge_b))*vol_a * sol_func
227 return rec_at_energy + lig_at_energy
228
229
230 NewDesolvation = NewDesolvationRefImpl
231
232
233
234
236
237
238
239
240
241 - def _f(self, at_a, at_b, dist):
242 """Return desolvation energy in kcal/mole.
243
244 Atom Volumes are in units of kcal/mol*Ang**3
245 NB: pdbqs volumes are cal/mol*Ang**3 and must be converted!!
246 This is done by MolecularSystem.py for now.
247
248 In Autodock3.0.5, this term is valid only for C atoms
249 in the ligand and is used to discriminate aromatic carbons
250 from aliphatic carbons
251 """
252 elm_a = at_a.autodock_element
253 charge_a = at_a.charge
254
255 vol_a = self.Vols.get(elm_a, 33.5103)
256
257
258 sp_a = self.Solpars.get(elm_a, -0.00110)
259
260
261
262 elm_b = at_b.autodock_element
263 charge_b = at_b.charge
264
265 vol_b = self.Vols.get(elm_b, 33.5103)
266
267
268 sp_b = self.Solpars.get(elm_b, -0.00110)
269
270 lig_energy = 0.0
271 rec_energy = 0.0
272
273 sol_func = self.get_ddsol(dist)
274
275
276
277 lig_at_energy = (sp_b + self.solpar_q*abs(charge_b))*vol_a * sol_func
278
279 return lig_at_energy
280
281 NewDesolvationLigOnly = NewDesolvationLigOnlyRefImpl
282
283
284
285
287
288
289
290
291
292 - def _f(self, at_a, at_b, dist):
293 """Return desolvation energy in kcal/mole.
294
295 Atom Volumes are in units of kcal/mol*Ang**3
296 NB: pdbqs volumes are cal/mol*Ang**3 and must be converted!!
297 This is done by MolecularSystem.py for now.
298
299 In Autodock3.0.5, this term is valid only for C atoms
300 in the ligand and is used to discriminate aromatic carbons
301 from aliphatic carbons
302 """
303 elm_a = at_a.autodock_element
304 charge_a = at_a.charge
305
306 vol_a = self.Vols.get(elm_a, 33.5103)
307 sp_a = self.Solpars.get(elm_a, -0.00110)
308
309
310 elm_b = at_b.autodock_element
311 charge_b = at_b.charge
312
313 vol_b = self.Vols.get(elm_b, 33.5103)
314 sp_b = self.Solpars.get(elm_b, -0.00110)
315
316 lig_energy = 0.0
317 rec_energy = 0.0
318
319 sol_func = self.get_ddsol(dist)
320
321 rec_at_energy = (sp_a + self.solpar_q*abs(charge_a))*vol_b * sol_func
322
323
324
325 lig_at_energy = (sp_b)*vol_a * sol_func
326
327 return rec_at_energy + lig_at_energy
328
329 NewDesolvationAtomMap = NewDesolvationAtomMapRefImpl
330
331
332
334
335
336
337
338
339 - def _f(self, at_a, at_b, dist):
340 """Return desolvation energy in kcal/mole.
341
342 Atom Volumes are in units of kcal/mol*Ang**3
343 NB: pdbqs volumes are cal/mol*Ang**3 and must be converted!!
344 This is done by MolecularSystem.py for now.
345
346 In Autodock3.0.5, this term is valid only for C atoms
347 in the ligand and is used to discriminate aromatic carbons
348 from aliphatic carbons
349 """
350 elm_a = at_a.autodock_element
351 charge_a = at_a.charge
352
353 vol_a = self.Vols.get(elm_a, 33.5103)
354 sp_a = self.Solpars.get(elm_a, -0.00110)
355
356
357 elm_b = at_b.autodock_element
358 charge_b = at_b.charge
359
360 vol_b = self.Vols.get(elm_b, 33.5103)
361 sp_b = self.Solpars.get(elm_b, -0.00110)
362
363 lig_energy = 0.0
364 rec_energy = 0.0
365
366 sol_func = self.get_ddsol(dist)
367
368
369
370
371
372
373
374
375 lig_at_energy = self.solpar_q*abs(charge_b)*vol_a * sol_func
376
377
378 lig_at_energy = self.solpar_q * vol_a * sol_func
379 return lig_at_energy
380
381 NewDesolvationDesolvMap = NewDesolvationDesolvMapRefImpl
382
383
384
385 if __name__ == '__main__':
386 print "run tests in Tests.test_desolvation"
387