In [ ]:
import MDAnalysis
import matplotlib.pyplot as plt
import numpy as np
from MDAnalysis.analysis.align import *
from MDAnalysis.analysis.rms import rmsd
%matplotlib inline
In [ ]:
In [ ]:
import numpy as np
RMSD_lig = []
ligand = u.select_atoms("(resid 142:146) and not name H*") ## include selection based on user description
#current = u.select_atoms("segname BGLC and not name H*")
reference = ref.select_atoms("(resid 142:146) and not name H*")
for ts in u.trajectory:
A = ligand.coordinates()
B = reference.coordinates()
C = rmsd(A,B)
RMSD_lig.append((u.trajectory.frame, C))
RMSD_lig = np.array(RMSD_lig)
print RMSD_lig
import matplotlib.pyplot as plt
ax = plt.subplot(111)
ax.plot(RMSD_lig[:,0], RMSD_lig[:,1], 'r--', lw=2, label=r"$R_G$")
ax.set_xlabel("Frame")
ax.set_ylabel(r"RMSD of ligand ($\AA$)")
ax.figure.savefig("RMSD_ligand.pdf")
plt.draw()