Root Mean Square Fluctuation (RMSF)#
Plot for C\(_{\alpha}\) of protein in Amber MD simulation, with domains labeled by color.
import numpy as np
import pytraj as pt
import matplotlib.pyplot as plt
# Load trajectory
traj = pt.iterload('../test/prod.nc', top='../test/step3_pbcsetup.parm7')
# Superimpose to 1st frame and alpha carbons
pt.superpose(traj, ref=0, mask="@CA")
rmsf0 = pt.rmsf(traj, mask="@CA")
# Shade domains different color
# plt.axvspan( 1, 56, facecolor='tab:red', alpha=0.2)
# plt.axvspan( 718, 765, facecolor='tab:red', alpha=0.2)
# plt.axvspan( 925, 1102, facecolor='tab:red', alpha=0.2)
# plt.axvspan( 56, 718, facecolor='tab:blue', alpha=0.2)
# plt.axvspan( 765, 924, facecolor='tab:orange', alpha=0.2)
# plt.axvspan(1099, 1368, facecolor='tab:green', alpha=0.2)
# Plot Residue # vs RMSF
plt.plot(np.arange(1,len(rmsf0.T[0])+1), rmsf0.T[1])
plt.xlabel('Residue Number')
plt.ylabel('RMSF (Å)')
# plt.savefig('rmsf.png', dpi=300)
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import numpy as np
2 import pytraj as pt
3 import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'numpy'