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

bug fix double counting water in Water bridge analysis #3120

Merged
merged 3 commits into from
May 7, 2021

Conversation

xiki-tempula
Copy link
Contributor

@xiki-tempula xiki-tempula commented Feb 14, 2021

Fixes #3119

Changes made in this Pull Request:

Previously, Water bridge analysis counts the duplicated water via checking if the same hydrogen bond is being used.
For example,

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

Will give
A1···H2-O3
O3-H4···O5
O5-H6-A1
A1···H2-O3
O3···H7-D8.
This will get rejected as A1···H2-O3 appear twice. However, it doesn't check if O3-H4···O5 and O5···H4-O3 can exit at the same time and this PR fixed it.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@pep8speaks
Copy link

pep8speaks commented Feb 14, 2021

Hello @xiki-tempula! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-05-07 06:59:13 UTC

@codecov
Copy link

codecov bot commented Feb 14, 2021

Codecov Report

Merging #3120 (aaaec28) into develop (da46e84) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3120   +/-   ##
========================================
  Coverage    93.03%   93.03%           
========================================
  Files          172      172           
  Lines        22724    22725    +1     
  Branches      3193     3194    +1     
========================================
+ Hits         21141    21142    +1     
  Misses        1533     1533           
  Partials        50       50           
Impacted Files Coverage Δ
...nalysis/analysis/hydrogenbonds/wbridge_analysis.py 97.42% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da46e84...aaaec28. Read the comment docs.

Copy link
Member

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mechanically, a new unit test has been added, the tests are passing, and the patch diff is 100 %.

I'm perhaps a little confused here because I'm not familiar with this analysis module, so I've asked a question about the desired order here.

Acceptor···H−O···H-Donor
|
H···O-H
will be recognised as 3rd order water bridge.
Copy link
Member

@tylerjereddy tylerjereddy Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matching issue has "Will be recognised as a third-order water bridge" under the "expected behavior" section?

Is this supposed to be a "first order" water bridge because only one water actually contacts both the acceptor and donor? Or is it second order because of propagation into the "extra water" on the side?

Copy link
Contributor Author

@xiki-tempula xiki-tempula Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerjereddy I'm sorry. I didn't realise that it is in the expected behaviour section. I have amended the issue to reflect that.

@IAlibay IAlibay added this to the 2.0 milestone Apr 6, 2021
Copy link
Contributor

@fiona-naughton fiona-naughton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - though (possible naive question), is there a reason for not doing the check for duplicates until the end rather than as you're building the routes? I would have thought the latter would be faster, but I may be wrong.

@xiki-tempula
Copy link
Contributor Author

@fiona-naughton Thanks for the review.
This could surely be put at the end and my feeling is that given that we need to store such a network for each frame, removing the duplication before storing the network would be good.

@orbeckst
Copy link
Member

orbeckst commented May 5, 2021

@xiki-tempula are you going to fix #3259 as part of this PR?

@orbeckst
Copy link
Member

orbeckst commented May 5, 2021

@fiona-naughton , what needs to be done to merge by Friday?

@xiki-tempula
Copy link
Contributor Author

I have resolved the conflicts in case this could be merged today.

Copy link
Contributor

@fiona-naughton fiona-naughton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @xiki-tempula - I'll let the checks finish running, but lgtm!

@IAlibay IAlibay merged commit d7b3c24 into MDAnalysis:develop May 7, 2021
@xiki-tempula xiki-tempula deleted the double_water branch May 7, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double counter in Water bridge analysis
6 participants