From: Brian Kim (bnk25_at_cornell.edu)
Date: Tue Feb 07 2012 - 15:16:17 CST

Hi all,

 I am sort of new to this vmd and tcl script so forgive me if this question
is way too easy for this mailing list.

I am trying to use atomselect with a variable in lipid bilayer simulation.
The center of mass for membrane that I produced is changing over time and I
would like to count how many lipids are on each leaflet of membrane in
every frame of the simulation by comparing their z location to z coordinate
of COM.

For example,

# calculate z coordinate of COM
set COM [atomselect [molinfo top] {name ROH or name PO4}]
set x [measure center $COM]
foreach {xmass ymass zmass} $x { break }

# atomselect PPCS lipids that is located below zmass.
set sel1 [atomselect [molinfo top] {name PO4 and resname PPCS and z <
$zmass}]

However, it doesn't work. It's always 0 even though zmass is correct in
each frame.

Can anyone give me some help? Thank you very much in advance!

regards,

Brian

-- 
Brian N. Kim
Ph.D Candidate
Graduate Field of Biophysics
Cornell University, Ithaca, NY 14853
Phone: 607 - 255 - 0632