Пример #1
0
    def test_null_rotation_one_atom(self):
        atom1 = Atom(1, 'CA', '', 'A', 'ALA', x=2., y=2., z=2.)
        atoms = [atom1]
        docking_model = DockingModel(atoms, SpacePoints([[2., 2., 2.]]))
        q = Quaternion()
        docking_model.rotate(q)

        expected_coordinates = np.array([[2., 2., 2.]])
        assert (expected_coordinates == docking_model.coordinates).all()
Пример #2
0
    def test_null_rotation(self):
        atom1 = Atom(1, 'CA', '', 'A', 'ALA', x=2., y=2., z=2.)
        atom2 = Atom(2, 'CB', '', 'A', 'ALA', x=0., y=0., z=0.)
        atom3 = Atom(3, 'C', '', 'A', 'ALA', x=0.5, y=0.5, z=0.5)
        atoms = [atom1, atom2, atom3]
        docking_model = DockingModel(atoms, SpacePoints([[2., 2., 2.], [0., 0., 0.], [0.5, 0.5, 0.5]]))
        q = Quaternion()
        docking_model.rotate(q)

        expected_coordinates = SpacePoints([[2., 2., 2.], [0., 0., 0.], [0.5, 0.5, 0.5]])
        assert expected_coordinates == docking_model.coordinates[0]

        expected_coordinates = SpacePoints([[0.833333333333, 0.833333333333, 0.833333333333]])
        assert np.allclose(expected_coordinates, docking_model.reference_points)