From: Mihaela Drenscko (quo.physics_at_gmail.com)
Date: Tue Jul 08 2014 - 09:27:06 CDT

Hello,

I am trying to get average area per lipid with a tcl script and molinfo top
get a and molinfo top get b (using VMD Tk console). How do I set the script
such that x and y coordinates of the box will be read at each frame (I have
2000 frames)?

These are the preliminaries of a script which does not work because I
didn't set reading new x and y for a new frame. How do I do that?

set outfile [open “areaeachframe” w]
set nf [molinfo top get numframes]
set atoms [atomselect top “lipids”]
set areasum 0.0

for {set i 0} {$i < $nf} {incr i} {
puts "frame $i of $nf"$atoms frame $i

 set xcoor [ molinfo top get a]
set ycoor [ molinfo top get b]
set area [expr ( $xcoor * $ycoor) / 274]
set areasum [expr $area + $areasum]
puts $outfile "$i $area"
}

set areaavg [expr $areasum/$nf]

Thank you,
Mihaela