Exemple #1
0
def align(full_base, ox_base):
    theta = utils.get_angle(full_base.a3, ox_base._a3)
    # if the two bases are already essentially aligned then we do nothing
    if sin(theta) > 1e-3:
        axis = np.cross(full_base.a3, ox_base._a3)
        axis /= sqrt(np.dot(axis, axis))
        R = utils.get_rotation_matrix(axis, theta)
        full_base.rotate(R)

    theta = utils.get_angle(full_base.a1, ox_base._a1)
    if sin(theta) > 1e-3:
        axis = np.cross(full_base.a1, ox_base._a1)
        axis /= sqrt(np.dot(axis, axis))
        R = utils.get_rotation_matrix(axis, theta)
        full_base.rotate(R)
Exemple #2
0
def vhelix_rotation_origami_he(direction, perp):
    R = utils.get_rotation_matrix(direction, np.pi * 160. / 180)
    return np.dot(R, perp)
Exemple #3
0
    for c in range(nbases):
        #dna center of mass positions
        ssdna1[c, :] = coordxyz[c, :] - CM_CENTER_DS * v_perp_ssdna1[c, :]
        ssdna2[c, :] = coordxyz[c, :] + CM_CENTER_DS * v_perp_ssdna1[c, :]

        #Update v_perp_ssdna1

        ind_1 = c
        ind = (c + 1) % nbases

        alpha = top.py_ang(v_perp_ssdna1[ind_1, :], p[ind, :], dist[ind_1, :])
        gamma = rot_base - alpha
        #prevent change when ind=0 on open chain
        if c != nbases - 1:
            R = utils.get_rotation_matrix(dist[ind, :], gamma)
            v_perp_ssdna1[ind, :] = np.dot(R, p[ind, :])
            v_perp_ssdna2[ind, :] = -v_perp_ssdna1[ind, :]

    # check LK imposed and measured
    if opts.closed:
        TW_measured = top.get_twist(coordxyz, ssdna1)

    box = np.array([boxmax, boxmax, boxmax])
    system = base.System(box)

    if opts.sequence_file == None:
        ssdna1_base = np.zeros(nbases, int)
        for c in range(nbases):
            ssdna1_base[c] = np.random.randint(0, 4)
    else: