From: Joaquim Rui de Castro Rodrigues (joaquim.rodrigues_at_ipleiria.pt)
Date: Thu Apr 19 2012 - 14:23:33 CDT

Hi,

The 2nd line of your script is wrong at incr $f
It should be:
 for {set f $firstFrame} {$f < $lastFrame} {incr f} {

Hope this helps,
Rui Rodrigues

________________________________________
De: owner-vmd-l_at_ks.uiuc.edu [owner-vmd-l_at_ks.uiuc.edu] Em Nome De Bryan Roessler [roessler_at_uab.edu]
Enviado: quinta-feira, 19 de Abril de 2012 19:17
Para: vmd-l_at_ks.uiuc.edu
Assunto: vmd-l: Problem with hydration script

proc residue_hydration {firstFrame lastFrame} {
for {set f $firstFrame} {$f < $lastFrame} {incr $f} {
set sel1 [atomselect top "protein and within 3 of water"]
$sel1 frame $f
lappend restotal [lsort -unique -integer [$sel1 get resid]]
}
set outDataFile [open hydration.csv a]
for {set r 1} {$r < 1480} {incr r} {
set num [llength [lsearch -exact -all $restotal $r]]
puts $outDataFile "$r,$num"
unset indnumber num
}
close $outDataFile
}

I'm having a trouble with this hydration analysis script. I'm trying to record the number of frames that a particular residue is within 3A of water.

Whenever I run the first for loop, it continues to infinity (crashing VMD) although I cannot understand why. I've tried using "animate goto $f" and "display update ui" to no avail. Note the use of the "-unique" switch so that the residue is only counted once (even if multiple atoms are within 3A of water).

It's driving me nuts!