def calc_arom_facing_norms(arom_a_coords, arom_b_coords):
"""Given two aromatic rings get the normal vectors that face the other ring"""
centroids = calc_centroids(arom_a_coords, arom_b_coords)
arom_norms = calc_arom_norms(arom_a_coords, arom_b_coords)
face_norms = []
for i, arom_norm in enumerate(arom_norms):
# get the index of the other arom
j = 1 if i ==0 else 0
norm_up = arom_norm
norm_down = -1 * arom_norm
# get the norm so that it points to the other ring
d_up = cdist([norm_up + centroids[i]], [centroids[j]])
d_down = cdist([norm_down + centroids[i]], [centroids[j]])
norm = norm_up if d_up < d_down else norm_down
face_norms.append(norm)
return face_norms
评论列表
文章目录