예제 #1
0
    def test_0(self):
        traj = pt.iterload("./data/Tc5b.x", "./data/Tc5b.top")

        # convert to mutable traj
        t0 = traj[:1]

        for deg in range(-170, 170, 10):
            pt.rotate_dihedral(t0, "custom:3:phi:" + str(deg))
            _deg = pt.calc_phi(t0, '3', dtype='ndarray')[0]
            dih = pt.dihedral(t0, ':2@C :3@N :3@CA :3@C')[0]
            aa_eq(deg, _deg)
            aa_eq(deg, dih)

            aa_eq(pt.calc_psi(traj[:1]).values, pt.calc_psi(t0).values)
    def test_0(self):
        traj = pt.iterload(fn('Tc5b.x'), fn('Tc5b.top'))

        # convert to mutable traj
        t0 = traj[:1]

        for deg in range(-170, 170, 10):
            pt.rotate_dihedral(t0, "custom:3:phi:" + str(deg))
            _deg = pt.calc_phi(t0, '3', dtype='ndarray')[0]
            dih = pt.dihedral(t0, ':2@C :3@N :3@CA :3@C')[0]
            aa_eq(deg, _deg)
            aa_eq(deg, dih)

            aa_eq(pt.calc_psi(traj[:1]).values, pt.calc_psi(t0).values)
예제 #3
0
    def test_1(self):
        # different from test_0 a bit in `mask`
        traj = pt.iterload("./data/Tc5b.x", "./data/Tc5b.top")

        # convert to mutable traj
        t0 = traj[:1]

        for deg in range(-170, 170, 10):
            pt.rotate_dihedral(t0, "3:phi:" + str(deg))
            _deg = pt.calc_phi(t0, '3', dtype='ndarray')[0]
            dih = pt.dihedral(t0, ':2@C :3@N :3@CA :3@C')[0]
            aa_eq(deg, _deg)
            aa_eq(deg, dih)

            aa_eq(pt.calc_psi(traj[:1]).values, pt.calc_psi(t0).values)
예제 #4
0
    def test_1(self):
        dslist0 = pt.calc_phi(traj)
        dslist1 = pt.calc_psi(traj)
        dslist2 = pt.search_hbonds(traj)
        self.assertRaises(KeyError, lambda: stack((dslist0, dslist1)))
        self.assertRaises(TypeError, lambda: stack((dslist0, dslist2)))

        stack((dslist0 for _ in range(3)))
예제 #5
0
    def test_1(self):
        dslist0 = pt.calc_phi(traj)
        dslist1 = pt.calc_psi(traj)
        dslist2 = pt.search_hbonds(traj)
        self.assertRaises(KeyError, lambda: stack((dslist0, dslist1)))
        self.assertRaises(TypeError, lambda: stack((dslist0, dslist2)))

        stack((dslist0 for _ in range(3)))
예제 #6
0
    def test_1(self):
        dslist0 = pt.calc_phi(traj)
        dslist1 = pt.calc_psi(traj)
        dslist2 = pt.search_hbonds(traj)
        with pytest.raises(KeyError):
            stack((dslist0, dslist1))
        with pytest.raises(TypeError):
            stack((dslist0, dslist2))

        stack((dslist0 for _ in range(3)))