[Chimera-users] MD analysis outputting to file

Elaine Meng meng at cgl.ucsf.edu
Thu Mar 23 09:23:58 PDT 2017


Dear Neha Gandhi,
I guess you want to measure this centroid-centroid distance at each frame of a trajectory that you are showing with the “MD Movie” tool.
<http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/framemovie.html>

First, figure out the Chimera commands to do the measurement at a single time point (for any single frame of the trajectory).  The Command Line can be shown from the Favorites menu.  You could use the “define” command to calculate centroids, and the “distance” command to measure the distance between the centroid objects or markers.  For example (Tyr-1 to Phe-4 in 1plx, an NMR ensemble opened as a trajectory):

define centroid radius 0.5 number 1 :1 at cg,cd1,cd2,ce1,ce2,cz
define centroid radius 0.5 number 2 :4 at cg,cd1,cd2,ce1,ce2,cz
distance c1 c2

<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/define.html#centroid>
<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/distance.html>

Of course, you would need to use different residue numbers and atom names as appropriate for your own data.

Once you have figured out the proper commands, you can enter them as a per-frame script to be run at each frame of the trajectory when you play through it in MD Movie (MD Movie menu: Per-Frame… Define script, enter the commands in that dialog).  You could also echo frame number if that’s helpful, so total script could be

echo frame <FRAME>
define centroid radius 0.5 number 1 :1 at cg,cd1,cd2,ce1,ce2,cz
define centroid radius 0.5 number 2 :4 at cg,cd1,cd2,ce1,ce2,cz
distance c1 c2

<http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#per-frame>

If I click Apply or OK on the per-frame dialog (Apply leaves it up, OK makes it go away), that will execute at the current frame, and if I then play a few frames using the MD Movie controller, the Reply Log (open from Favorites menu) contains something like this:

frame 21
centroid name, ID, center: centroid: c1 ( -2.746,   3.036,  -0.904)
centroid name, ID, center: centroid: c2 (  2.165,  -0.511,   1.683)
Distance from c1 to c2 is 6.587
frame 22
centroid name, ID, center: centroid: c1 ( -2.429,   3.518,  -0.332)
centroid name, ID, center: centroid: c2 (  1.489,  -0.440,   1.981)
Distance from c1 to c2 is 6.030
frame 23
centroid name, ID, center: centroid: c1 ( -2.665,   3.402,  -0.915)
centroid name, ID, center: centroid: c2 (  1.831,  -0.568,   1.777)
Distance from c1 to c2 is 6.574

I would then Clear the Reply Log to get a fresh start and then play the whole trajectory from start to end one time (turn off looping), and then save the Reply Log to a text file using its Save button.
I hope this helps,
Elaine
----------
Elaine C. Meng, Ph.D. 
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

P.S. if you need to draw a dashed line between the centroids you have to use a slightly different method with “measure center” instead of “define”, as outlined in this previous post
<http://plato.cgl.ucsf.edu/pipermail/chimera-users/2016-June/012404.html>

> On Mar 23, 2017, at 12:45 AM, Neha Gandhi <n.gandhiau at gmail.com> wrote:
> 
> Dear Chimera support,
> 
> I want to calculate the centroid of the sugar ring and the distance from the centroid to another atom of amino-acid. I know this can be done using the Structure analysis tools in Chimera. I want to use distance command in the MD ensemble analysis and output it to the analysis to the text file. 
> 
> How can I write output per frame to a text file in Chimera?
> 
> Your insight is appreciated.




More information about the Chimera-users mailing list