From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Feb 05 2008 - 14:16:00 CST

Jim,
  Ah. That's a very old script. It has a number of weaknesses
that we've long since addressed by adding new functionality into the
core of VMD so that scripts don't have to do the kind of hoop jumping
that script is (still) doing.

As of VMD 1.8.6, we have new "measure" commands for 'bond', 'angle',
'dihedral' so one doesn't have to do some of the machinations that
the geometry.tcl script you're using was doing. Similarly, it's a much
better idea to use "$sel frame $f" to set the active frame for an atom
selection rather than forcing "display update" calls and using side-effects
of the 'animate' command like some of the old scripts did. Doing "$sel frame"
is also faster because it doesn't force VMD to regenerate all of the
displayed geometry. Beyond that, we actually have "$sel get phi"
and "$sel get psi" commands as built-in atom selection operations.
At some point we should probably rewrite that old geometry.tcl script
using the more modern VMD commands.

Cheers,
  John

On Tue, Feb 05, 2008 at 08:55:29PM +0100, Jim Pfaendtner wrote:
> Hi John,
>
> the phi proc came from geometry.tcl
> (http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/geometry/geometry.tcl
> )
>
> I guess I have to do some re-writing to make it compatible with the
> loop. It just seemed really strange to me that when I typed out the
> three commands manually it worked, but it didn't work within the loop
> itself. The loop I wrote doesn't do anything except run the phi proc
> and animate next 3 times.
>
> Thanks,
> Jim
>
> On Feb 5, 2008, at 8:48 PM, John Stone wrote:
>
> >
> >Jim,
> > Where's the code for your "phi" proc? I don't see it below.
> >Most likely your "phi" proc is incorrectly written.
> >
> >Cheers,
> > John Stone
> > vmd_at_ks.uiuc.edu
> >
> >On Tue, Feb 05, 2008 at 06:26:47PM +0100, Jim Pfaendtner wrote:
> >>Dear VMD-L,
> >>
> >>I am trying to calculate several angles for each frame in my
> >>trajectory. I'm using the geometry.tcl script posted on the vmd
> >>website.
> >>
> >>This code:
> >>
> >>animate read dcd $dcdf beg 0 end $nf waitfor all
> >>animate goto start
> >>
> >>puts [phi 0 PRO 35]
> >>animate next
> >>puts [phi 0 PRO 35]
> >>animate next
> >>puts [phi 0 PRO 35]
> >>animate next
> >>
> >>works fine. It prints out the phi angle or the first three frames in
> >>the trajectory with no problem. When I put this same code in a loop,
> >>it doesn't work at all:
> >>
> >>animate read dcd $dcdf beg 0 end $nf waitfor all
> >>animate goto start
> >>
> >>for { set j 0 } { $j < 3} { incr j } {
> >>puts [phi 0 PRO 35]
> >>animate next
> >>}
> >>
> >>this code just prints out the value from frame 0 three times.
> >>
> >>Does anyone have any suggestions as to why this doesn't work? There
> >>are a number of different ways to code this problem, but this way is
> >>convenient. Also, it's really puzzling to me why this simple loop
> >>isn't working right.
> >>
> >>Any suggestions are greatly appreciated.
> >>
> >>Jim
> >
> >--
> >NIH Resource for Macromolecular Modeling and Bioinformatics
> >Beckman Institute for Advanced Science and Technology
> >University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> >Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> > WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078

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