From: Josh Vermaas (joshua.vermaas_at_gmail.com)
Date: Sun Aug 02 2020 - 16:44:16 CDT

Hi Ameya,

The easy way is to color by "user", and then set the user value by frame.

set sel [atomselect top "all"]
for { set f 0 } { $f < [molinfo top numframes] } { incr f } {
$sel frame $f
if { $f < 50 } {
$sel set user 0
} else {
$sel set user 1
}
}

When you then color by user, the specific frame will have a different color
(taken from the RWB scale). The reason this works is that the "user" field
is stored per-atom and per-frame, while most of the tagging things (resid,
beta, occupancy, etc), are only stored per atom, and the values are shared
for all frames.

-Josh

On Sat, Aug 1, 2020 at 5:23 PM Ameya Harmalkar <aharmal1_at_jhu.edu> wrote:

> Hello,
>
> I am new to VMD and I am trying to generate a trajectory from a set of PDB
> files. I am able to generate a trajectory and it depicts the transition
> that I want it to show.
> I do, however, wish to color the frames in specific colors i.e. say my PDB
> file contains 100 models, and I want to color PDBs from 0-49 to red and
> 50-99 to blue. I have been trying to work around a way to do this, and I am
> not really sure how to use TCL scripts for the same.
> Is there a way to do it? I do realize that there is a RWB type coloring
> based on trajectories, but i want to highlight specific frames in the movie.
> Any guidance/suggestion would be really helpful!
> Thanks,
>
> Ameya
>
>
> Ameya Harmalkar,
>
> Second Year PhD Candidate | Gray Lab
> Department of Chemical and Biomolecular Engineering,
> Whiting School of Engineering | Johns Hopkins University,
> Maryland Hall 303.
>
>