Skip to content

Fix hydrogen bond detection across fragment orderings - #5207

Open
barlowa124 wants to merge 1 commit into
deepchem:masterfrom
barlowa124:fix-hbond-fragment-order-5194
Open

barlowa124 wants to merge 1 commit into
deepchem:masterfrom
barlowa124:fix-hbond-fragment-order-5194

Conversation

@barlowa124

Copy link
Copy Markdown

Closes #5194.

Whether compute_hydrogen_bonds found a valid bond depended on the
order fragments and hydrogens were passed. frag1_xyz[i] indexed with
the frag2 loop counter, placing frag1 hydrogens at frag2 coordinates.
The hydrogen-candidate loop broke out after the first candidate
instead of examining all of them. hbond_angle_cutoff landed in the
distance parameter positionally, so the caller's angle bound never
applied.

Indexing is corrected. Every candidate is visited and the cutoff
passes by keyword. The previously empty test_compute_hydrogen_bonds
now covers all four orderings plus a bent geometry where a tight
cutoff rejects and a loose one accepts.

…eepchem#5194)

is_hydrogen_bond indexed frag1 coordinates with the frag2 loop
counter, returned after checking only the first candidate hydrogen,
and compute_hbonds_in_range passed the angle cutoff positionally so
it landed in the unused distance parameter. Donor-in-frag1 contacts
were never found and the per-bin angle cutoff was always the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compute_hydrogen_bonds misses hydrogen bonds depending on fragment order / hydrogen order, and ignores the angle cutoff

1 participant