From: Ajasja Ljubetič (ajasja.ljubetic_at_gmail.com)
Date: Tue Sep 20 2011 - 04:54:54 CDT

Hi,

you have to include the frame you would like to analyse. The first line of
the loop should be:

 [measure dihed "$dihe01" *frame $frame*]

If you have multiple dihedrals to measure it's perhaps faster to call
animate goto $frame just once at the beginning of the loop
(can somebody confirm this?).

Best regards,
Ajasja

On Tue, Sep 20, 2011 at 10:47, Jernej Zidar <jernej.zidar_at_gmail.com> wrote:

> Dear all,
> I have a NAMD-generated trajectory that I would like to analyze. As
> part of that I would like to measure the changes of a dihedral angle
> during the simulation. To do that I prepared the following Tcl script
> (I removed most comments):
> # input
> set input wpoly-opt-cubi-ion
> mol load psf $input.psf dcd $input-prod-cpt.dcd
>
> # output
> set outdi "./ana/dihe-lang.dat"
> set outdiid [open $outdi "w"]
>
> # write header
> set headdi "# frame ALY1 AVA2 APH3 AVA4 ALY5"
> puts $outdiid $headdi
>
> # atom selection
> set dihe01 [[atomselect top "segname O1 and (name O1 C1 C2 CB) and
> residue 0"] get index]
>
> # obtain total number of frames
> set ntot [molinfo top get numframes]
>
> # measure the dihedral and save to output
> for { set frame 0 } { $frame < $ntot } { incr frame } {
> set xdihe01 [measure dihed "$dihe01" ]
> puts $outdiid $frame\t$xdihe01
> }
>
> # close output
> close $outdiid
>
> ------ end of script ---
>
> The problem is that the output file contains the values of $frame
> for all the frames (e.g. going from 0 to 9999), but only the last
> value (e.g. 57.453456) of $dihe01 for all the respective frame
> numbers. I did a Google search and it appears the syntax is OK.
>
> Thanks in advance for any tips,
> Jernej Zidar
>