My data consists with a trajectory of a MD we’ve done with a protein. My idea is to plot a Ramachandran graph with a color gradient. The has the information of all the frames in the trajectory, but with the same color and size, because of it, it’s very hard to read the image.
I’m using the following code to get the Ramachandran data.
import MDAnalysis as mda
import warnings
warnings.filterwarnings('ignore')
from MDAnalysis.analysis.dihedrals import Ramachandran
u = mda.Universe(topology, trajectory)
r = u.select_atoms("protein")
R = Ramachandran(r).run()
Then, to plot it, I’m using the following code:
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=plt.figaspect(1))
R.plot(ax=ax, color='y', marker='.')
plt.show()
Ramachandran Image
I’m hoping to get a image like this:
The area where the values appears more frequently should have a color, while, the area where the values don’t appear as much, it will have another color. So it’s like a “3d probabily density function”.
Maybe I’m going for something way out of my league. But, for now, it’s the path I can see to get where I want. If someone has a tip for me going foward, I will appreciate it!
Fernando Oliveir Tytor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.