From: Schreiner Eduard (eschrein_at_ks.uiuc.edu)
Date: Wed Dec 10 2008 - 01:52:29 CST

hi ramya,

close the file you are writing in.
additionally, add a
$sel2 update
after you set the frame for this selection

eddi

On Dec 10, 2008, at 1:31 AM, ramya narasimhan wrote:

> Hi All,
> I tried to find the center of mass for all the frames (2000)
> of the dcd file. The output contains only for 1966 frames. But when
> I move the frame in VMD and measure in Tkconsol, it is calculating
> for the rest. To check I save the coordinates in pdb format. I
> loaded the pdb and tried in the same way. It results in same manner.
> I have given the script below
>
> set out [open com.dat w]
> set numframes [molinfo top get numframes]
> set sel2 [atomselect top protein]
> for {set frame 0} {${frame} < ${numframes}} {incr frame} {
> $sel2 frame $frame
> set com [measure center ${sel2} weight mass]
> puts $out "center of mass of structure ${frame} is {$com}"
> }
>
> is there any mistake in the script?
> Is it possible to find for many residues at the same time (like
> selecting resid 3 6 7 9 ... for each frame)?
>
> Thanks in advance.
> Ramya.L.
>
> Add more friends to your messenger and enjoy! Invite them now.

=====================================================
Eduard Schreiner
Theoretical and Computational Biophysics Group
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave., Urbana, IL 61801
Phone: 217-244-4361
Fax: 217-244-6078
http://www.ks.uiuc.edu/~eschrein/
=============================================