示例#1
0
    def test_get_quaternion_for_restraint1(self):
        # Origin is 0,0,0
        # Ligand center
        l_center = [-5., 5., -5.]
        # Ligand residue
        l_res = [-7., 7., -7.]
        # Receptor residue
        r_res = [3., 1., 0.]
        # Calculate quaternion for rotation from l_res to point to r_res
        rec_residue = Residue.dummy(r_res[0], r_res[1], r_res[2])
        lig_residue = Residue.dummy(l_res[0], l_res[1], l_res[2])

        q = get_quaternion_for_restraint(
            rec_residue,
            lig_residue,
            l_center[0],
            l_center[1],
            l_center[2],  # translation
            [0., 0., 0.],  # receptor translation 
            [5., -5., 5.]  # ligand translation
        )

        e = Quaternion(w=0.14518697,
                       x=0.19403814,
                       y=-0.58211441,
                       z=-0.77615254)

        assert e == q
示例#2
0
    def test_get_quaternion_for_restraint2d(self):
        # Origin is 0,0,0
        # Ligand center
        l_center = [5., 5., 0.]
        # Ligand residue
        l_res = [7., 7., 0.]
        # Receptor residue
        r_res = [3., 1., 0.]
        # Calculate quaternion for rotation from l_res to point to r_res
        rec_residue = Residue.dummy(r_res[0], r_res[1], r_res[2])
        lig_residue = Residue.dummy(l_res[0], l_res[1], l_res[2])

        q = get_quaternion_for_restraint(
            rec_residue,
            lig_residue,
            l_center[0],
            l_center[1],
            l_center[2],  # translation
            [0., 0., 0.],  # receptor translation 
            [5., 5., 0.]  # ligand translation
        )

        e = Quaternion(0.16018224, 0., 0., -0.98708746)

        assert e == q
示例#3
0
    def test_get_quaternion_for_restraint2d_different_quadrant(self):
        # Origin is 0,0,0
        # Ligand center
        l_center = [5., -5., 0.]
        # Ligand residue
        l_res = [7., -7., 0.]
        # Receptor residue
        r_res = [-3., 1., 0.]
        # Calculate quaternion for rotation from l_res to point to r_res
        rec_residue = Residue.dummy(r_res[0], r_res[1], r_res[2])
        lig_residue = Residue.dummy(l_res[0], l_res[1], l_res[2])

        q = get_quaternion_for_restraint(
            rec_residue,
            lig_residue,
            l_center[0],
            l_center[1],
            l_center[2],  # translation
            [0., 0., 0.],  # receptor translation 
            [5., -5., 0.]  # ligand translation
        )

        e = Quaternion(0.07088902, 0., 0., -0.99748421)

        assert e == q
示例#4
0
    def test_get_quaternion_for_restraint2(self):
        # Origin is 0,0,0
        # Ligand center
        l_center = [-5., 5., -5.]
        # Ligand residue
        l_res = [-7., 6., -7.]
        # Receptor residue
        r_res = [3., 1., 0.]
        # Calculate quaternion for rotation from l_res to point to r_res
        rec_residue = Residue.dummy(r_res[0], r_res[1], r_res[2])
        lig_residue = Residue.dummy(l_res[0], l_res[1], l_res[2])

        q = get_quaternion_for_restraint(
            rec_residue,
            lig_residue,
            l_center[0],
            l_center[1],
            l_center[2],  # translation
            [0., 0., 0.],  # receptor translation 
            [5., -5., 5.]  # ligand translation
        )

        e = Quaternion(0.10977233, -0.44451098, -0.88902195, 0.)

        assert e == q