From: Vermaas, Joshua (Joshua.Vermaas_at_nrel.gov)
Date: Fri Jun 29 2018 - 12:27:47 CDT

Hi Vincius,

Check the range for the color scale (under the trajectory tab). It defaults to the range present in the active frame, and as it happens, the range at the end of your trajectory (the default active frame), is 0. Set the color scale range manually, and you'll be fine. I also noticed from your script that you do something potentially non-scalable. Generally, you want to delete atomselections after you are done, as there is a hard cap on the number of atomselections available. Otherwise, you could also try something like this:

set r14 [atomselect top "resid 14"]
set uservalues [list 0 100 0 100 0 100]
for { set f 0 } { $f < [llength $uservalues } { incr f } {
$r14 frame $f
$r14 set user [lindex $uservalues $f]
}

This only uses a single atomselection to do the highlighting, so long as the values are know ahead of time (in the uservalues field).

-Josh

On 2018-06-28 18:26:03-06:00 Cruzeiro,Vinicius Wilian D wrote:

Hello Josh,

Thanks for your suggestion and for your help. I tried your suggestion directly from the Tk console and it works fine there. However, when I put it into a script (see files attached) and do the command "source cphemd_script.tcl" it doesn't work. In this case I see all residues white in all frames. It is like the script were not being read. However, when I place other commands in the script, like to move a atom, this additional command works fine but the coloring still doesn't work. Therefore the script is being processed by VMD. Thus, I am not sure if my issue is particular to my VMD installation. This is my VMD version:

VMD for LINUXAMD64, version 1.9.4a12 (December 21, 2017)

I would appreciate if you could try to reproduce my issue at your end. I am loading VMD with the following command:

vmd mp8_is.prmtop mp8_is.prod.nc

In case the issue is reproduced there, do you see any problems with my script? Am I missing something there?

Best,

Vinícius Wilian D Cruzeiro

PhD Candidate
Department of Chemistry, Physical Chemistry Division
University of Florida, United States

Voice: +1(352)846-1633

________________________________
From: Vermaas, Joshua <Joshua.Vermaas_at_nrel.gov>
Sent: Thursday, June 28, 2018 6:53:00 PM
To: vmd-l_at_ks.uiuc.edu; Cruzeiro,Vinicius Wilian D
Subject: RE: Different colors of a residue at different frames
Set the user field, and color by user. The beta field is global across frames, but the user, user2, user3, and user4 fields are specific to a given frame.

-Josh

On 2018-06-28 15:57:11-06:00 owner-vmd-l_at_ks.uiuc.edu wrote:

Dear VMD experts,

I am trying to write a TCL script where I am able to control the color of different residues in different frames. I believe the command to select a given residue in a given frame would be, for example:

atomselect top "resid 10" frame 5

I am now struggling to change the color of only this residue at only a single frame. I already tried changing the "Coloring Method" selection to Beta and the following command:

atomselect0 set beta 100

By doing this I was able to change the color of only the residue 5, however, any change I make gets applied to all frames. Is there a solution that would be "frame-specific"?

Thank you very much,

Best regards,

Vinícius Wilian D Cruzeiro

PhD Candidate
Department of Chemistry, Physical Chemistry Division
University of Florida, United States

Voice: +1(352)846-1633