From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Mar 28 2012 - 11:40:54 CDT

Hi,
  Your script looks generally correct to me just reading it in the email
you sent. What is your reason for doubting the correctness of your script?

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Mar 27, 2012 at 08:37:23AM +0200, VladanStefanovic_at_kg.ac.rs wrote:
> Hi,
>
> I want, for each molecule's center of mass, to extract its coordinates
> into some file for every frame of simulation.
> first,I load my_molecule_file.psf and my_molecule_file.dcd in VMD and then
> I use my Tk console script:
>
> set frm [molinfo top get numframes]
> set atom [atomselect top "segid GLUB and resid 20"]
> set fout [open Coords_CNTmas_GLUB_20.dat w]
>
> for {set i 0} {$i<$frm} {incr i} {
> $atom frame $i
> set cntmas [measure center $atom weight mass]
>
> puts $fout [format "%8.3f%8.3f%8.3f" [lindex $cntmas 0] [lindex $cntmas 1]
> [lindex $cntmas 2]]
> }
> $atom delete
> close $fout
>
> I have got the results- the coordinates for each molecule but,I'm not sure
> that everything is ok.
> So, I will need a second hand opinion about my script, and is there
> another way to get the coordinates of center of mass for each simulation's
> frame for one or for whole group of molecules.
>
> Thanks,
> Vlada

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