pi_stacking.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:mastic 作者: ADicksonLab 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号