Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double counter in Water bridge analysis #3119

Closed
xiki-tempula opened this issue Feb 14, 2021 · 0 comments · Fixed by #3120
Closed

Double counter in Water bridge analysis #3119

xiki-tempula opened this issue Feb 14, 2021 · 0 comments · Fixed by #3120

Comments

@xiki-tempula
Copy link
Contributor

xiki-tempula commented Feb 14, 2021

Expected behavior

User Irtaza Hassan emailed me providing a case where

        Acceptor(A1)···H(H2)−O(O3)···H(H7)-Donor(D8) 
                             |
                             H(H4)···O(O5)-H(H6)

This should give a first-order water bridge.

Actual behavior

It recognised the following route
A1···H2-O3
O3-H4···O5
O5···H4-O3
O3···H7-D8
Will be recognised as a third-order water bridge

Code to reproduce the behavior

from MDAnalysis.analysis.hydrogenbonds import WaterBridgeAnalysis
import MDAnalysis
from io import StringIO
grofile = '''Test gro file
    7
    1LEU      O    1   1.876   0.810   1.354
  117SOL    HW1    2   1.853   0.831   1.162
  117SOL     OW    3   1.877   0.890   1.081
  117SOL    HW2    4   1.908   0.828   1.007
  135SOL     OW    5   1.924   0.713   0.845
    1LEU      H    6   1.997   0.991   1.194
    1LEU      N    7   2.041   1.030   1.274
   2.22092   2.22092   2.22092'''
u = MDAnalysis.Universe(StringIO(grofile), format='gro')
wb = WaterBridgeAnalysis(u, 'resname LEU and name O', 'resname LEU and name N H', order=4)
wb.run()
print(wb.timeseries)
[[(0, 1, ('LEU', 1, 'O'), ('SOL', 117, 'HW1'), 1.9450972623464, 144.11627508942746), 
  (2, 5, ('SOL', 117, 'OW'), ('LEU', 1, 'H'), 1.933132206990047, 162.05564720359993), 
  (3, 4, ('SOL', 117, 'HW2'), ('SOL', 135, 'OW'), 1.9931120422844908, 166.0596405239858), 
  (4, 3, ('SOL', 135, 'OW'), ('SOL', 117, 'HW2'), 1.9931120422844908, 166.0596405239858), 
  (2, 5, ('SOL', 117, 'OW'), ('LEU', 1, 'H'), 1.933132206990047, 162.05564720359993)]]

Current version of MDAnalysis

  • Which version are you using? I will fix this for both master and develop branch
IAlibay pushed a commit that referenced this issue May 7, 2021
Fixes #3119

* Fixes bug linked with double counting of waters in WaterBridgeAnalysis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants