Skip to content

Commit a8258c2

Browse files
committed
Account for singularities
1 parent 5aca0a6 commit a8258c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightdock/prep/poses.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def get_quaternion_for_restraint(rec_residue, lig_residue, cx, cy, cz):
3434
c = np.cross(a, b)
3535
d = np.dot(a, b)
3636

37-
s = np.sqrt( (1+d)*2 )
37+
try:
38+
s = np.sqrt( (1+d)*2 )
39+
except FloatingPointError:
40+
return Quaternion()
3841
invs = 1. / s
3942
x = c[0] * invs
4043
y = c[1] * invs

0 commit comments

Comments
 (0)