OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Probability Density Function with Ramachandran function of MDAnalysis in Python

  • Thread starter Thread starter Fernando Oliveir Tytor
  • Start date Start date
F

Fernando Oliveir Tytor

Guest
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.

Code:
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:

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!
<p>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.</p>
<p>I'm using the following code to get the Ramachandran data.</p>
<pre><code>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()
</code></pre>
<p>Then, to plot it, I'm using the following code:</p>
<pre><code>import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=plt.figaspect(1))
R.plot(ax=ax, color='y', marker='.')
plt.show()
</code></pre>
<p><a href="https://i.sstatic.net/TMyuTGsJ.png" rel="nofollow noreferrer">Ramachandran Image</a></p>
<p>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!</p>
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top