From: John Stone (
Date: Fri May 18 2007 - 16:54:42 CDT

  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):

Writing out the final trajectory frames can be done with
the GUI, or by scripts, e.g. 'animate writedcd':

  John Stone

On Wed, May 16, 2007 at 12:06:45PM -0400, 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:                 Phone: 217-244-3349
  WWW:      Fax: 217-244-6078