3.4.6. Root Mean Square Deviation (RMSD)#
The Root Mean Square Deviation (RMSD) is a measure of the average distance between atoms in a superimposed structure. You will see this analysis used to judge convergence of an MD simulation in just about every MD paper. The equation is
Where,
import pytraj as pt
import matplotlib.pyplot as plt
# Load trajectory
traj = pt.iterload('prod.nc', top='step3_pbcsetup_1264.parm7')
rmsd = pt.rmsd(traj, mask="@CA")
# Plot Simulation Time vs RMSD
plt.plot(rmsd)
plt.xlabel('Time ')
plt.ylabel('RMSF (Å)')
plt.savefig('rmsf.png', dpi=300)
3.4.6.1. Pairwise Root Mean Square Deviation (2D RMSD)#
import pytraj as pt
import matplotlib.pyplot as plt
# Load trajectory
traj = pt.iterload('prod.nc', top='step3_pbcsetup_1264.parm7')
data = pt.pairwise_rmsd(traj, mask="@CA")
im = plt.imshow(data
plt.colorbar(im, label='2D-RMSD (Å)')
plt.gca().invert_yaxis()
plt.xlabel('Frame Number')
plt.ylabel('Frame Number')
plt.savefig('rmsf.png', dpi=300)