From: Vlad Cojocaru (vlad.cojocaru_at_mpi-muenster.mpg.de)
Date: Mon Apr 27 2015 - 11:24:46 CDT

Hi Josh,

Oh, yes, thanks .. Did not realize that "cv frame n" has to used to
reset the frame.

Best
Vlad

On 04/27/2015 05:58 PM, Josh Vermaas wrote:
> Hi Vlad,
>
> Here is the body of the loop I tend to use:
>
> colvars frame $i
> colvars update
> puts [colvars colvar "name" value]
>
> -Josh Vermaas
>
> On 04/27/2015 09:27 AM, Vlad Cojocaru wrote:
>> Dear all,
>>
>> I am trying to use the cv command to output the value of a colvar for
>> each frame of a trajectory (example script below). However, the
>> script prints only the value corresponding to the last frame (e.g. if
>> I load 50 frames it writes 50 times "Frame: 49; Colvar: 2.567"). Am I
>> doing something wrong or missing something in the script ?
>>
>> I am using VMD compiled from CVS on 7th of April 2015
>>
>> Thanks for any advice
>> Vlad
>>
>> --- example script ---
>>
>> mol new "topology"
>> mol addfile "trajectory" waitfor all
>>
>> cv molid 0
>> cv configfile "configfile"
>>
>> set numFrames [ molinfo 0 get numframes ]
>>
>> for { set frame 0 } { $frame < $numFrames } { incr frame } {
>> animate goto $frame
>> cv colvar "name" update
>> set colvarValue [ cv colvar "name" value ]
>> puts "Frame: $frame; Colvar: $colvarValue"
>> }
>>
>>
>>
>
>
>

-- 
Dr. Vlad Cojocaru
Computational Structural Biology Laboratory
Department of Cell and Developmental Biology
Max Planck Institute for Molecular Biomedicine
Röntgenstrasse 20, 48149 Münster, Germany
Tel: +49-251-70365-324; Fax: +49-251-70365-399
Email: vlad.cojocaru[at]mpi-muenster.mpg.de
http://www.mpi-muenster.mpg.de/43241/cojocaru