def prepare(self): '''Load trajectory, print information and perform initial alignment and fit.''' self.load_traj() self.atoms = self.traj.n_atoms self.frames = self.traj.n_frames print('\nPROTEIN INFORMATION') print('PDB code: {}'.format(self.PDB)) print('residues: {}'.format(self.atoms)) print('frames: {}'.format(self.frames)) print('temperature: {}'.format(self.temperature)) # Align molecule to principal axes pt.principal_axes(self.traj, dorotation=True) # Center molecule at the origin pt.center(self.traj, center='origin') # First rmsd fit pt.rmsd(self.traj) # Calculate average structure self.avg = pt.mean_structure(self.traj) # Perform rms fit to average structure pt.rmsd(self.traj, ref=self.avg) # Initialize arrays self.initialize_arrays()
def clean_traj(self): # Align molecule to principal axes pt.principal_axes(self.traj, dorotation=True) # Center molecule at the origin pt.center(self.traj, center='origin') # First rmsd fit pt.rmsd(self.traj) # Calculate average structure self.avg = pt.mean_structure(self.traj) # Perform rms fit to average structure pt.rmsd(self.traj, ref=self.avg)
def test_do_rotation(self): traj = pt.iterload("./data/Tc5b.x", "./data/Tc5b.top") cm = ''' principal * dorotation mass name pout createcrd myname ''' state = pt.load_cpptraj_state(cm, traj) state.run() mut_traj_0 = traj[:] mut_traj_1 = traj[:] data = pt.principal_axes(mut_traj_0, mask='*', dorotation=True, mass=True) pt.align_principal_axis(mut_traj_1, mask='*', mass=True) aa_eq(data[0], state.data[1].values) aa_eq(data[1], state.data[2].values) aa_eq(state.data[-1].xyz, mut_traj_0.xyz) aa_eq(state.data[-1].xyz, mut_traj_1.xyz)