From: Bassam Haddad (bhaddad_at_pdx.edu)
Date: Thu Jun 06 2019 - 15:41:21 CDT

set n [molinfo top get numframes]
for { set i 0 } { $i < $n } { incr i } {
    animate goto $i
    $all set user $i
}

This is essentially a script that I ran the other day to play around with
the 'user' variable. Despite it working, there was little to no change in
colour due to the linear increase. If you want to see something more
drastic try the following...

set n [molinfo top get numframes]
for { set i 0 } { $i < $n } { incr i } {
    animate goto $i
    $all set user [expr $i*$i]
}

On Wed, Jun 5, 2019 at 9:57 AM Mustafa Tekpinar <tekpinar_at_buffalo.edu>
wrote:

> Hi,
> I am using VMD for LINUXAMD64, version 1.9.3 and I am trying color a pdb
> trajectory according to a user defined value.
> I wrote the following script based on the previous suggestions.
> #-------------------------------------------------------------------
> mol new test.pdb waitfor all
> set all [atomselect top all]
>
> set n [molinfo top get numframes]
> for { set i 0 } { $i < $n } { incr i } {
> $all frame $i
> $all set user $i
> $all update
> }
> #-------------------------------------------------------------------
> Unfortunately, the script doesn't work. I was just wondering if anybody
> can suggest me something to check or try.
> PS: I am aware that the script colors according to timestep and it is
> already installed in VMD. However, my aim is to add some other data into
> the user field later.
>
> Thanks
> --
> Mustafa Tekpinar, PhD
>
>
>