1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 package ffx.potential.bonded;
39
40 import ffx.potential.bonded.AminoAcidUtils.AminoAcid3;
41 import ffx.potential.parameters.ForceField;
42 import ffx.potential.parameters.RelativeSolvationType;
43
44 import java.util.HashMap;
45 import java.util.Map;
46 import java.util.logging.Logger;
47
48 import static java.lang.String.format;
49
50
51
52
53
54
55
56
57 public class RelativeSolvation {
58
59 private static final Logger logger = Logger.getLogger(RelativeSolvation.class.getName());
60
61 private final Map<String, Double> nonStdEnergies;
62
63 private final SolvationLibrary solvationLibrary;
64
65
66
67
68
69
70
71
72 public RelativeSolvation(SolvationLibrary solvationLibrary, ForceField forceField) {
73 this.solvationLibrary = solvationLibrary;
74 nonStdEnergies = new HashMap<>();
75 for (RelativeSolvationType rsType : forceField.getRelativeSolvationTypes().values()) {
76 String resName = rsType.getResName();
77 double e = rsType.getSolvEnergy();
78 if (nonStdEnergies.put(resName, e) != null) {
79 logger.warning(format(" Repeat relative solvation for %s", resName));
80 }
81 }
82 }
83
84
85
86
87
88
89
90
91
92
93
94 public double getSolvationEnergy(Residue residue, boolean checkZeroes)
95 throws IllegalArgumentException {
96 String resName = "";
97 double energy;
98 Residue theRes =
99 (residue instanceof MultiResidue) ? ((MultiResidue) residue).getActive() : residue;
100 switch (theRes.getResidueType()) {
101 case AA -> {
102 if (theRes instanceof MultiResidue) {
103 resName = ((MultiResidue) theRes).getActive().getName();
104 } else {
105 resName = theRes.getName();
106 }
107 energy = getAASolvationEnergy(theRes);
108 }
109 case NA -> {
110 if (theRes instanceof MultiResidue) {
111 resName = ((MultiResidue) theRes).getActive().getName();
112 } else {
113 resName = theRes.getName();
114 }
115 energy = getNASolvationEnergy(theRes);
116 }
117 default -> energy = 0;
118 }
119 if (checkZeroes && energy == 0) {
120 throw new IllegalArgumentException(
121 format(" Zero de-solvation energy for residue %s: likely not in solvation library.",
122 resName));
123 }
124 return energy;
125 }
126
127
128 @Override
129 public String toString() {
130 return "Relative solvation library: " + solvationLibrary.toString();
131 }
132
133
134
135
136
137
138
139 private double getAASolvationEnergy(Residue residue) {
140 return switch (solvationLibrary) {
141 case WOLFENDEN -> getWolfendenSolvationEnergy(residue);
142 case CABANI -> getCabaniSolvationEnergy(residue);
143 case EXPLICIT -> getExplicitSolvationEnergy(residue);
144 case GK -> getGKSolvationEnergy(residue);
145 case MACCALLUM_SPC -> getMacCallumSPCSolvationEnergy(residue);
146 case MACCALLUM_TIP4P -> getMacCallumTIP4PSolvationEnergy(residue);
147 default -> 0;
148 };
149 }
150
151
152
153
154
155
156
157 private double getNASolvationEnergy(Residue residue) {
158 return 0;
159 }
160
161
162
163
164
165
166
167
168 private double getGKSolvationEnergy(Residue residue) {
169 return getExplicitSolvationEnergy(residue);
170 }
171
172
173
174
175
176
177
178
179 private double getExplicitSolvationEnergy(Residue residue) {
180 AminoAcid3 name = residue.getAminoAcid3();
181 return switch (name) {
182 case ALA -> 0.58;
183 case CYS -> -0.85;
184 case CYD -> -69.82;
185 case ASP -> -69.45;
186 case ASH -> -4.00;
187 case GLU -> -71.40;
188 case GLH -> -3.61;
189 case PHE -> -1.59;
190 case GLY -> 0.67;
191 case HIS -> -45.36;
192 case HID -> -8.42;
193 case HIE -> -7.53;
194 case ILE -> 0.14;
195 case LYS -> -43.98;
196 case LYD -> +0.35;
197 case MET -> -3.48;
198 case ASN -> -5.89;
199 case PRO -> 7.82;
200 case GLN -> -6.89;
201 case ARG -> -42.57;
202 case SER -> -2.14;
203 case THR -> 0.58;
204 case VAL -> 0.10;
205 case TRP -> -4.64;
206 case TYR -> 1.76;
207 case TYD -> -41.71;
208 case UNK -> nonStdEnergies.getOrDefault(residue.getName().toUpperCase(), 0.0);
209 default -> 0;
210 };
211 }
212
213
214
215
216
217
218
219
220 private double getMacCallumTIP4PSolvationEnergy(Residue residue) {
221 AminoAcid3 name = residue.getAminoAcid3();
222 return switch (name) {
223 case ALA -> 9.8;
224 case CYS -> -0.5;
225 case ASP -> -30.5;
226 case GLU -> -19.0;
227 case PHE -> -1.2;
228 case HIS -> -28.0;
229 case ILE -> 12.2;
230 case LYS -> -13.6;
231 case LEU -> 13.7;
232 case MET -> -7.1;
233 case ASN -> -34.5;
234 case GLN -> -31.4;
235 case ARG -> -43.9;
236 case SER -> -20.2;
237 case THR -> -20.3;
238 case VAL -> 12.0;
239 case TRP -> -16.2;
240 case TYR -> -18.8;
241 case UNK -> nonStdEnergies.getOrDefault(residue.getName().toUpperCase(), 0.0);
242 default -> 0;
243 };
244 }
245
246
247
248
249
250
251
252
253 private double getMacCallumSPCSolvationEnergy(Residue residue) {
254 AminoAcid3 name = residue.getAminoAcid3();
255 return switch (name) {
256 case ALA -> 9.3;
257 case CYS -> -1.1;
258 case ASP -> -30.1;
259 case GLU -> -18.8;
260 case PHE -> -1.4;
261 case HIS -> -27.2;
262 case ILE -> 11.9;
263 case LYS -> -8.6;
264 case LEU -> 12.6;
265 case MET -> -5.1;
266 case ASN -> -34.3;
267 case GLN -> -30.8;
268 case ARG -> -46.3;
269 case SER -> -18.5;
270 case THR -> -19.3;
271 case VAL -> 11.3;
272 case TRP -> -15.1;
273 case TYR -> -18.2;
274 case UNK -> nonStdEnergies.getOrDefault(residue.getName().toUpperCase(), 0.0);
275 default -> 0;
276 };
277 }
278
279
280
281
282
283
284
285
286 private double getCabaniSolvationEnergy(Residue residue) {
287 AminoAcid3 name = residue.getAminoAcid3();
288 switch (name) {
289 case ALA:
290 return 8.4;
291 case CYS:
292 return -5.2;
293 case ASP:
294 return -28.1;
295 case GLU:
296 return -27.1;
297 case PHE:
298 return -3.7;
299 case HIS:
300 return -27.4;
301 case ILE:
302 return 8.7;
303 case LYS:
304 return -15.5;
305 case LEU:
306 return 9.7;
307 case MET:
308 return 9.0;
309 case ASN:
310 return -40.6;
311 case GLN:
312 return -18.7;
313 case ARG:
314 return -30.1;
315 case SER:
316 return -21.4;
317 case THR:
318 return -21.0;
319 case VAL:
320 return 8.2;
321 case TRP:
322 return -12.3;
323 case TYR:
324 return -25.7;
325 case UNK:
326 return nonStdEnergies.getOrDefault(residue.getName().toUpperCase(), 0.0);
327 case GLY:
328 case PRO:
329 default:
330 return 0;
331 }
332 }
333
334
335
336
337
338
339
340
341 private double getWolfendenSolvationEnergy(Residue residue) {
342 AminoAcid3 name = residue.getAminoAcid3();
343 switch (name) {
344 case ALA:
345 return 8.1;
346 case CYS:
347 return -5.1;
348 case ASP:
349 return -27.5;
350 case GLU:
351 return -26.6;
352 case PHE:
353 return -3.1;
354 case HIS:
355 return -42.1;
356 case ILE:
357 return 8.8;
358 case LYS:
359 return -18.0;
360 case LEU:
361 return 9.4;
362 case MET:
363 return -6.1;
364 case ASN:
365 return -39.9;
366 case GLN:
367 return -38.7;
368 case ARG:
369 return -44.8;
370 case SER:
371 return -20.8;
372 case THR:
373 return -20.1;
374 case VAL:
375 return 8.2;
376 case TRP:
377 return -24.3;
378 case TYR:
379 return -25.2;
380 case UNK:
381 return nonStdEnergies.getOrDefault(residue.getName().toUpperCase(), 0.0);
382 case GLY:
383 case PRO:
384 default:
385 return 0;
386 }
387 }
388
389
390
391
392
393
394
395
396
397
398
399
400
401 public enum SolvationLibrary {
402 WOLFENDEN, CABANI, EXPLICIT, GK, MACCALLUM_SPC, MACCALLUM_TIP4P, OPLS_EXPLICIT, OPLS_GK, AUTO, NONE
403 }
404 }