Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the case where distance_type = 'heavy' in water bridge analysis (#…
…4066) * fix #4040 and #4136 * ensure that for distance_type == 'heavy' all possible hydrogens are taken into account when analyzing H-bonds; previously, only one connected H was considered and that could lead to incorrect results and IndexErrors * ensure that WaterBridgeAnalysis ONLY accepts distance_type 'heavy' or 'hydrogen' (anything else now raises ValueError) * add tests * update CHANGELOG * Long explanation (see also PR #4066) In water bridge analysis, in the distance_type = 'hydrogen' mode, I get the pair index (hydrogen bond hydrogen atom and acceptor) and the pair distance from the distance search. Then for each hydrogen atom bonded to the donor heavy atom, I check the angle between the hydrogen bond donor heavy atom, the hydrogen atom and the acceptor and map the index to the pair distance. This works because the distance is computed based on the hydrogen atom and we map the hydrogen atom index back to the distance. In the distance_type = 'heavy' mode, In the original code, I get the pair index (hydrogen bond donor heavy atom and acceptor) and the pair distance from the distance search. Then for each hydrogen atom bonded to the donor heavy atom, I check the angle between the hydrogen bond donor heavy atom, the hydrogen atom and the acceptor. In this case, I cannot map back to the pair distance, as the distance search is done on the heavy atom and we are mapping the index of the hydrogen atom back to the distance. This PR fixes the issue. Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com> Co-authored-by: Oliver Beckstein <orbeckst@gmail.com>
- Loading branch information