waterEntropy 2.1.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {waterentropy-2.1.0 → waterentropy-2.2.0}/PKG-INFO +1 -1
  2. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/recipes/test_bulk_water.py +2 -0
  3. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/recipes/test_interfacial_solvent.py +6 -0
  4. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/__init__.py +1 -1
  5. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/entropy/orientations.py +55 -6
  6. {waterentropy-2.1.0 → waterentropy-2.2.0}/.github/dependabot.yml +0 -0
  7. {waterentropy-2.1.0 → waterentropy-2.2.0}/.github/workflows/ci.yml +0 -0
  8. {waterentropy-2.1.0 → waterentropy-2.2.0}/.github/workflows/release.yml +0 -0
  9. {waterentropy-2.1.0 → waterentropy-2.2.0}/.gitignore +0 -0
  10. {waterentropy-2.1.0 → waterentropy-2.2.0}/.pre-commit-config.yaml +0 -0
  11. {waterentropy-2.1.0 → waterentropy-2.2.0}/.readthedocs.yml +0 -0
  12. {waterentropy-2.1.0 → waterentropy-2.2.0}/LICENSE +0 -0
  13. {waterentropy-2.1.0 → waterentropy-2.2.0}/README.md +0 -0
  14. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/.gitignore +0 -0
  15. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/Makefile +0 -0
  16. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/conf.py +0 -0
  17. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/images/ccpbiosim-logo-white-background.png +0 -0
  18. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/images/waterentropy_logo_grey.png +0 -0
  19. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/index.rst +0 -0
  20. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/user_guide/hpc.rst +0 -0
  21. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/user_guide/parallel.rst +0 -0
  22. {waterentropy-2.1.0 → waterentropy-2.2.0}/docs/source/user_guide/serial.rst +0 -0
  23. {waterentropy-2.1.0 → waterentropy-2.2.0}/example_inputs/lysozyme_solution/system.gro +0 -0
  24. {waterentropy-2.1.0 → waterentropy-2.2.0}/example_inputs/lysozyme_solution/system.tpr +0 -0
  25. {waterentropy-2.1.0 → waterentropy-2.2.0}/example_inputs/lysozyme_solution/system.trr +0 -0
  26. {waterentropy-2.1.0 → waterentropy-2.2.0}/notebooks/interfacial_water_entropy.ipynb +0 -0
  27. {waterentropy-2.1.0 → waterentropy-2.2.0}/pyproject.toml +0 -0
  28. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/__init__.py +0 -0
  29. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/analysis/test_RAD.py +0 -0
  30. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/__init__.py +0 -0
  31. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/amber/arginine_solution/README.md +0 -0
  32. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/amber/arginine_solution/system.nc +0 -0
  33. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/amber/arginine_solution/system.prmtop +0 -0
  34. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/gromacs/aspirin_solution/README.md +0 -0
  35. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/gromacs/aspirin_solution/system.gro +0 -0
  36. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/gromacs/aspirin_solution/system.prmtop +0 -0
  37. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/gromacs/aspirin_solution/system.trr +0 -0
  38. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/input_files/load_inputs.py +0 -0
  39. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/maths/test_trig.py +0 -0
  40. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/utils/__init__.py +0 -0
  41. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/utils/test_dask_clusters.py +0 -0
  42. {waterentropy-2.1.0 → waterentropy-2.2.0}/tests/utils/test_selections.py +0 -0
  43. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/analysis/HB.py +0 -0
  44. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/analysis/HB_labels.py +0 -0
  45. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/analysis/RAD.py +0 -0
  46. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/analysis/__init__.py +0 -0
  47. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/analysis/shell_labels.py +0 -0
  48. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/analysis/shells.py +0 -0
  49. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/cli/runWaterEntropy.py +0 -0
  50. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/cli/run_find_Nc.py +0 -0
  51. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/entropy/__init__.py +0 -0
  52. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/entropy/convariances.py +0 -0
  53. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/entropy/vibrations.py +0 -0
  54. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/maths/__init__.py +0 -0
  55. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/maths/transformations.py +0 -0
  56. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/maths/trig.py +0 -0
  57. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/recipes/__init__.py +0 -0
  58. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/recipes/bulk_water.py +0 -0
  59. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/recipes/forces_torques.py +0 -0
  60. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/recipes/interfacial_solvent.py +0 -0
  61. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/utils/__init__.py +0 -0
  62. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/utils/dask_clusters.py +0 -0
  63. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/utils/helpers.py +0 -0
  64. {waterentropy-2.1.0 → waterentropy-2.2.0}/waterEntropy/utils/selections.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: waterEntropy
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Python package for calculating interfacial water entropy from molecular dynamics simulations.
5
5
  Keywords: water,entropy,molecular dynamics,forces
6
6
  Author-email: Jas Kalayan <jas.kalayan@stfc.ac.uk>
@@ -39,6 +39,8 @@ def test_Sorient_dict(bulk_water_entropy_dicts):
39
39
  6.053509907760105,
40
40
  6.053509907760105,
41
41
  0.2291068586055006,
42
+ 9.775154915649155,
43
+ 9.775154915649155,
42
44
  ]
43
45
  )
44
46
 
@@ -67,6 +67,8 @@ def test_Sorient_dict(interfacial_entropy_dicts):
67
67
  5.257142857142858,
68
68
  2.9594964080590276,
69
69
  0.10765314493056646,
70
+ 10.670272583734757,
71
+ 8.183120170171872,
70
72
  ]
71
73
  )
72
74
  assert Sorient_dict[2]["ARG"] == pytest.approx(
@@ -77,6 +79,8 @@ def test_Sorient_dict(interfacial_entropy_dicts):
77
79
  5.835721088435374,
78
80
  3.2771824257183773,
79
81
  0.10732165472942556,
82
+ 12.039086367415315,
83
+ 9.1274183064461,
80
84
  ]
81
85
  )
82
86
  assert Sorient_dict[3]["NME"] == pytest.approx(
@@ -87,6 +91,8 @@ def test_Sorient_dict(interfacial_entropy_dicts):
87
91
  5.1923076923076925,
88
92
  2.050259026687599,
89
93
  0.07010328362114078,
94
+ 10.77132783200613,
95
+ 8.187096360116465,
90
96
  ]
91
97
  )
92
98
 
@@ -3,4 +3,4 @@
3
3
  # Add imports here
4
4
  # from waterEntropy.neighbours.force_torque import *
5
5
 
6
- __version__ = "2.1.0"
6
+ __version__ = "2.2.0"
@@ -41,6 +41,29 @@ class WaterOrientCalculator:
41
41
  self.Nc_eff = Nc_eff
42
42
  self.pbias_ave = pbias_ave
43
43
 
44
+ def get_non_HB_data(self, Nc):
45
+ """
46
+ Calculate water orientational entropies without accounting for
47
+ HB biasing, using the following equation (as in the host-guest systems
48
+ paper, https://doi.org/10.1007/s10822-021-00406-5):
49
+
50
+ .. math::
51
+ S_\\mathrm{orient} = \\ln \\Bigg(N_c ^ {(3 / 2)} \times \\pi ^ {0.5}
52
+ \times \frac{p_\\mathrm{corr}}{\\sigma} \\Bigg)
53
+
54
+ where :math:`N_{c}` is the number of UAs in the coordination shell,
55
+ :math:`p_\\mathrm{corr}` is the probability that the neighboring
56
+ molecules are oriented suitably for each solute, which is set to 0.25
57
+ for water. And :math:`\\sigma` is the symmetry number for water which
58
+ is 2.
59
+
60
+ """
61
+ S_orient = 0
62
+ if Nc != 0:
63
+ S_orient = np.log((Nc) ** (3 / 2) * np.pi**0.5 * 0.25 / 2)
64
+ S_orient = max(S_orient, 0)
65
+ return S_orient * self.GAS_CONSTANT
66
+
44
67
  def get_shell_degeneracy(self, shell_label: list):
45
68
  """
46
69
  For a given labelled shell, find the degeneracy, i.e. count of each
@@ -294,14 +317,35 @@ class Orientations:
294
317
  for resname, shell_label_key in sorted(list(labelled_dict.items())):
295
318
  Sorient_ave, tot_count = 0, 0
296
319
  N_c_ave, N_w_ave, Nc_eff_ave, pbias_ave = 0, 0, 0, 0
320
+ Sorient_Nc_ave, Sorient_Nw_ave = 0, 0
297
321
  for shell_label, values in sorted(list(shell_label_key.items())):
322
+ # create object for Sorient
298
323
  water = WaterOrientCalculator()
324
+ # calculate Sorient for water with given shell and solute
325
+ # neighbour using HB biasing
299
326
  water.add_data(shell_label, values)
327
+
328
+ # add water entropies using previous methods that don't account
329
+ # for HBing
330
+ N_c = len(shell_label)
331
+ N_w = values["N_w"]
332
+ Sorient_Nc = water.get_non_HB_data(N_c)
333
+ Sorient_Nw = water.get_non_HB_data(N_w)
334
+
300
335
  # only update tot_count here
336
+ # get running average for HB biased Sorient
301
337
  Sorient_ave, tot_count = self.get_running_average(
302
338
  water.Sorient, values["shell_count"], Sorient_ave, tot_count
303
339
  )
304
340
  # ignore the _tot_count
341
+ # get running average for non-HB Sorient
342
+ Sorient_Nc_ave, _tot_count = self.get_running_average(
343
+ Sorient_Nc, values["shell_count"], Sorient_Nc_ave, tot_count
344
+ )
345
+ Sorient_Nw_ave, _tot_count = self.get_running_average(
346
+ Sorient_Nw, values["shell_count"], Sorient_Nw_ave, tot_count
347
+ )
348
+ # get average terms for Nc and pbais
305
349
  Nc_eff_ave, _tot_count = self.get_running_average(
306
350
  water.Nc_eff, values["shell_count"], Nc_eff_ave, tot_count
307
351
  )
@@ -309,10 +353,10 @@ class Orientations:
309
353
  water.pbias_ave, values["shell_count"], pbias_ave, tot_count
310
354
  )
311
355
  N_c_ave, _tot_count = self.get_running_average(
312
- len(shell_label), values["shell_count"], N_c_ave, tot_count
356
+ N_c, values["shell_count"], N_c_ave, tot_count
313
357
  )
314
358
  N_w_ave, _tot_count = self.get_running_average(
315
- values["N_w"], values["shell_count"], N_w_ave, tot_count
359
+ N_w, values["shell_count"], N_w_ave, tot_count
316
360
  )
317
361
  Sorient_dict[resname] = [
318
362
  Sorient_ave,
@@ -321,6 +365,8 @@ class Orientations:
321
365
  N_w_ave,
322
366
  Nc_eff_ave,
323
367
  pbias_ave,
368
+ Sorient_Nc_ave,
369
+ Sorient_Nw_ave,
324
370
  ]
325
371
 
326
372
 
@@ -335,24 +381,27 @@ def print_Sorient_dicts(Sorient_dict: dict):
335
381
  ============
336
382
  resid: residue ID of the closest solute to the waters
337
383
  resname: name of the residue associated with the residue ID
338
- Sor: Orientational entropy of water around residue
384
+ Sor: Orientational entropy of water around residue using HB biasing
339
385
  count: total number of waters around the residue across frames analysed
340
386
  N_c: average number of UAs around waters analysed
341
387
  N_w: average number of water UAs around waters analysed
342
388
  Nc_eff: average number of effective neighbouts that waters can HB with
343
389
  pbias: average of the probability of forming HBs with neighbouring UAs
390
+ Sor_Nc: Orientational entropy of water around residue using Nc (no HB bias)
391
+ Sor_Nw: Orientational entropy of water around residue using Nw (no HB bias)
344
392
  """
345
393
  print(textwrap.dedent(terms))
346
394
 
347
- print("resid resname Sor count N_c N_w Nc_eff pbias")
395
+ print("resid resname Sor count N_c N_w Nc_eff pbias Sor_Nc Sor_Nw")
348
396
  for resid, resname_key in sorted(list(Sorient_dict.items())):
349
- for resname, [Sor, count, N_c, N_w, Nc_eff, pbias] in sorted(
397
+ for resname, [Sor, count, N_c, N_w, Nc_eff, pbias, Sor_Nc, Sor_Nw] in sorted(
350
398
  list(resname_key.items())
351
399
  ):
352
400
  decimals = 4
353
401
  print(
354
402
  f"{resid} {resname} {Sor:.{decimals}f} {count} "
355
403
  f"{N_c:.{decimals}f} {N_w:.{decimals}f} "
356
- f"{Nc_eff:.{decimals}f} {pbias:.{decimals}f}"
404
+ f"{Nc_eff:.{decimals}f} {pbias:.{decimals}f} "
405
+ f"{Sor_Nc:.{decimals}f} {Sor_Nw:.{decimals}f} "
357
406
  )
358
407
  print()
File without changes
File without changes
File without changes
File without changes