From: JC Gumbart (gumbart_at_ks.uiuc.edu)
Date: Wed Mar 09 2011 - 11:55:58 CST

You also need to add "waitfor all" when you add your dcd.

On Mar 9, 2011, at 9:32 AM, menica dibenedetto wrote:

> Dear all,
> I try to run this code to calculate same distance:
> cd /Users/domenica/Desktop/01_DOP
> mol load pdb 01_DOP_wat.pdb
> mol addfile new01.dcd type dcd
> set sel1 [atomselect top "resid 136"]
> set sel2 [atomselect top "resname DP0"]
> set fil [open distance_136-DOP_1f.dat w]
> for {set i 1} {$i < 50} {incr i} {
> $sel1 frame $i
> $sel2 frame $i
> set com1 [measure center $sel1 weight mass]
> set com2 [measure center $sel2 weight mass]
> set simdata($i.r) [veclength [vecsub $com1 $com2]]
> puts $fil " $simdata($i.r)"
> }
> set sel3 [atomselect top "resid 125"]
> set sel4 [atomselect top "resname DP0"]
> set fil [open distance_125-DOP_1f.dat w]
> for {set i 1} {$i < 50} {incr i} {
> $sel3 frame $i
> $sel4 frame $i
> set com1 [measure center $sel1 weight mass]
> set com2 [measure center $sel2 weight mass]
> set simdata($i.r) [veclength [vecsub $com1 $com2]]
> puts $fil " $simdata($i.r)"
> }
> quit
>
> I run this code inside the TKconsole and it work even if it stopped before 50 frames.
> The problem is that I need to run it from command line, but from command line, the script don't work.
> In the output file it wrote only first three distances, and after is repeted until the and the same distance.
> Seems to appen that it don't recognize the different frames.
>
> Best regards,
> Domenica