From: Ekta Khurana (ekta_at_vitae.cmm.upenn.edu)
Date: Thu Jun 02 2005 - 10:12:00 CDT

  Hi,
   If you want center of mass you just have to use
" measure center $sel weight mass " instead of " measure center $sel".

 Cheers,
 Ekta

> Hi Xiongce,
>
> I don't have an appropriate script for that, but the following should get
> you started.
>
> If you only need interatomic distances, I think you can create a bond
> label
> and use the Labels dialogue box to (see save button on the graph tab) to
> obtain interatomic distance over time.
>
> If you're willing to settle for geometric center instead of COM, the
> following procedure (which I have not really tested) might help:
>
> proc distance_between_centers {molid1 molid2 stxt1 stxt2 frame1 frame2} {
> set s1 [atomselect $molid1 "$stxt1" frame $frame1]
> set s2 [atomselect $molid2 "$stxt2" frame $frame2]
> set v1 [measure center $s1]
> set v2 [measure center $s2]
> $s1 delete
> $s2 delete
> return [veclength [vecsub $v1 $v2]]
> }
>
> You would call this with something like the following:
> set frm 0
> set delta_r [distance_between_centers top top "protein and resid 10"
> "protein and resid 12" $frm $frm]
> puts "$frm\t$delta_r"
>
> You would need to loop through frames with commands like these:
> set nf [molinfo $molid get numframes]
> for {set frm 0} {$frm<=[expr {$nf-1}]} {incr frm} {
> something...
> }
>
> There is a COM procedure in one of the NAMD/VMD tutorials.
>
> Can anyone think of an easier way to do this?
>
> -----Original Message-----
> From: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] On Behalf
> Of
> Xiongce Zhao
> Sent: June 1, 2005 1:37 PM
> To: vmd list
> Subject: vmd-l: how to write out the coordinates of center of mass of a
> particularresidue
>
>
> I hope to monitor the distance between the center of mass of two
> residues, anyone can give some instructions?
>
> Thank you very much.
>
> Xiongce
>

-- 
Ekta Khurana
Center for Molecular Modeling
University of Pennsylvania
email:ekta_at_cmm.upenn.edu
      ekhurana_at_sas.upenn.edu
Phone: (215) 573-8697
Fax: (215) 573-6233