From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri May 18 2007 - 16:54:42 CDT

Hi,
  Your script is pretty close to what you need, you just
need to use "$sel moveby", to change the atom coordinates
based on your offset vectors (see $sel moveXXX examples):
  http://www.ks.uiuc.edu/Research/vmd/vmd-1.8.6/ug/node183.html#14467

Writing out the final trajectory frames can be done with
the GUI, or by scripts, e.g. 'animate writedcd':
  http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/4660.html

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, May 16, 2007 at 12:06:45PM -0400, hl332_at_drexel.edu wrote:
> Hi all,
> I have been trying to do the following task:
>
> 1. Calculating position of center_of_masss of my protein relative to whole system center_of_mass.
> i wrote a small script like this: (in this script center_of_mass is another 'proc' sourced before)
>
> set outfile [open coord.dat w];
> set nf [molinfo top get numframes]
> set sel1 [atomselect top "protein or type ZN"]
> set sel2 [atomselect top "all"]
> for {set i 0 } {$i < $nf } { incr i } {
> $sel1 frame $i
> $sel2 frame $i
> set protein [center_of_mass $sel1]
> set all [center_of_mass $sel2]
> set relative [vecsub $protein $all]
> puts $outfile "$relative"
> }
> close $outfile
> Now I have new coordinates of C.O.M of protein relative to whole system.
>
> But i need this presently:
>
> 1. MOve the C.O.M of protein to this new position.
>
> 2. AND write a DCD file so that i can see absolute motion of protein when I already subtracted C.O.M of whole system from its (protein) C.O.M position
>
> Any help to add these two-three modifying lines in my script will do great.
>
> Thanks in advance
>
> Harish
>
> -------------------------------------------------
> Harish Vashisth (Ph.D Candidate)
> CAT-361,Chemical & Biological Engg.
> Drexel University, Philadelphia, PA
> office: 215-895-5823

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078