def test_frame_indices(self): traj = pt.iterload(fn("tz2.truncoct.nc"), fn("tz2.truncoct.parm7")) traj2 = pt.iterload(fn("tz2.truncoct.nc"), fn("tz2.truncoct.parm7"), frame_slice=(2, 8)) txt = ''' reference {} 2 2 rmsd :2-11 refindex 0 perres perresout center.agr range 1 perrescenter '''.format(fn('tz2.truncoct.nc')) state = pt.load_batch(traj2, txt) with tempfolder(): state.run() frame_indices = range(2, 8) rmsd0 = pt.rmsd(traj, ref=1, mask=':2-11', frame_indices=frame_indices) rmsdperres = pt.rmsd_perres(traj, ref=1, mask=':2-11', perres_mask='*', resrange='1', perres_center=True, frame_indices=frame_indices) aa_eq(rmsd0, state.data[2]) aa_eq(rmsdperres[1], state.data[3].values)
def test_frame_indices(self): traj = pt.iterload("data/tz2.truncoct.nc", "data/tz2.truncoct.parm7") traj2 = pt.iterload("data/tz2.truncoct.nc", "data/tz2.truncoct.parm7", frame_slice=(2, 8)) txt = ''' reference ./data/tz2.truncoct.nc 2 2 rmsd :2-11 refindex 0 perres perresout center.agr range 1 perrescenter ''' state = pt.load_batch(traj2, txt) state.run() frame_indices = range(2, 8) rmsd0 = pt.rmsd(traj, ref=1, mask=':2-11', frame_indices=frame_indices) rmsdperres = pt.rmsd_perres(traj, ref=1, mask=':2-11', perres_mask='*', resrange='1', perres_center=True, frame_indices=frame_indices) aa_eq(rmsd0, state.data[2]) aa_eq(rmsdperres[1], state.data[3].values)
def test_noreference(self): from pytraj.datafiles import load_cpptraj_output, tz2_ortho_trajin traj = pt.iterload("./data/tz2.ortho.nc", "./data/tz2.ortho.parm7") cout = load_cpptraj_output(tz2_ortho_trajin + """ rmsd first @CA perres range 2-7""") d = pt.rmsd_perres(traj, ref=0, mask='@CA', resrange='2-7', dtype='ndarray') aa_eq(cout[1:].values, d)
def test_noreference(self): from pytraj.datafiles import load_cpptraj_output, tz2_ortho_trajin traj = pt.iterload(fn("tz2.ortho.nc"), fn("tz2.ortho.parm7")) cout = load_cpptraj_output(tz2_ortho_trajin + """ rmsd first @CA perres range 2-7""") d = pt.rmsd_perres(traj, ref=0, mask='@CA', resrange='2-7', dtype='ndarray') aa_eq(cout[1:].values, d)
def test_reference(self): traj = pt.iterload("./data/tz2.truncoct.nc", "data/tz2.truncoct.parm7") txt = ''' reference data/tz2.truncoct.nc 2 2 rmsd :2-11 refindex 0 perres perresout center.agr range 1 perrescenter ''' state = pt.load_batch(traj, txt).run() # state.data has 3 datasets: ref, rmsd, rmsd perres # cpptraj use 2nd reference rmsd0 = pt.rmsd(traj, ref=1, mask=':2-11') rmsdperres = pt.rmsd_perres(traj, ref=1, mask=':2-11', perres_mask='*', resrange='1', perres_center=True) aa_eq(rmsd0, state.data[2]) aa_eq(rmsdperres[1], state.data[3].values)
def test_reference(self): traj = pt.iterload(fn("tz2.truncoct.nc"), fn("tz2.truncoct.parm7")) txt = ''' reference {} 2 2 rmsd :2-11 refindex 0 perres perresout center.agr range 1 perrescenter '''.format(fn('tz2.truncoct.nc')) with tempfolder(): state = pt.load_batch(traj, txt).run() # state.data has 3 datasets: ref, rmsd, rmsd perres # cpptraj use 2nd reference rmsd0 = pt.rmsd(traj, ref=1, mask=':2-11') rmsdperres = pt.rmsd_perres(traj, ref=1, mask=':2-11', perres_mask='*', resrange='1', perres_center=True) aa_eq(rmsd0, state.data[2]) aa_eq(rmsdperres[1], state.data[3].values)