From b08f4c0ed8b66972a432472f86d1c655ff860358 Mon Sep 17 00:00:00 2001 From: Sumit112192 Date: Thu, 11 Jan 2024 19:22:21 +0530 Subject: [PATCH 1/2] Used between to update donors_sel and acceptors_sel --- package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py b/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py index e0597e2c3d2..63b3e7ac7af 100644 --- a/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py +++ b/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py @@ -362,6 +362,10 @@ def __init__(self, universe, if isinstance(between[0], str): between = [between] + temp_between = np.unique(between) + self.donors_sel = " or ".join(temp_between) + self.acceptors_sel = " or ".join(temp_between) + between_ags = [] for group1, group2 in between: between_ags.append( From 8eac74a78f58fbcc9be6022005688e682b941b71 Mon Sep 17 00:00:00 2001 From: Sumit112192 Date: Fri, 12 Jan 2024 18:19:42 +0530 Subject: [PATCH 2/2] Added min_cutoff so that donor and hydrogen are different --- package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py | 1 + 1 file changed, 1 insertion(+) diff --git a/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py b/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py index 63b3e7ac7af..1bbb565005f 100644 --- a/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py +++ b/package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py @@ -650,6 +650,7 @@ def _get_dh_pairs(self): donors.positions, hydrogens.positions, max_cutoff=self.d_h_cutoff, + min_cutoff=0.1, box=self.u.dimensions, return_distances=False ).T