From: Leonardo Trabuco (ltrabuco_at_ks.uiuc.edu)
Date: Wed Dec 10 2008 - 04:34:27 CST

Dear Ramya,

If you want to calculate the center of mass for different residues,
you need to use a different atom selection for each residue.

Regarding the '$sel update' command, it is only necessary when you
wanna force VMD to re-evaluate the atom selection. Thus, if you
select, e.g., 'resid 1', when you advance a frame there is no need to
update the selection. Now, if you select something like 'x > 5', then
you do need to re-evaluate the selection after advancing a frame.

Cheers,
Leo

On Wed, Dec 10, 2008 at 4:26 AM, ramya narasimhan <ramya_jln_at_yahoo.co.in> wrote:
> Hi Eddi,
> Thank you very much. Now it works fine after closing the file.
> I want to find the com for N number of residues separately and for each
> frame. Its not working by using $sel2 update.
> Thanks in advance.
> Ramya.L.
> --- On Wed, 10/12/08, Schreiner Eduard <eschrein_at_ks.uiuc.edu> wrote:
>
> From: Schreiner Eduard <eschrein_at_ks.uiuc.edu>
> Subject: Re: vmd-l: Problem finding center of mass for all the frames
> To: "ramya narasimhan" <ramya_jln_at_yahoo.co.in>
> Cc: vmd-l_at_ks.uiuc.edu
> Date: Wednesday, 10 December, 2008, 1:22 PM
>
> 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/
> =============================================
>
>
> ________________________________
> Add more friends to your messenger and enjoy! Invite them now.

-- 
Leonardo Trabuco, Ph.D. candidate
Theoretical and Computational Biophysics Group
University of Illinois at Urbana-Champaign