[Chimera-users] colour residue by value

Elaine Meng meng at cgl.ucsf.edu
Tue Sep 28 14:38:48 PDT 2010

Hi Sumitro,
It sounds like you might be thinking of computing the RGB values from some other values yourself, then applying these "manually" with the color command.  You could do that -- it is possible to use R,G,B or R,G,B,A  (where A is opacity for a transparent color) or a Tk code instead of a color name in practically all of the coloring commands, as explained for the "color" command here:


However, if I understand your situation correctly, I recommend instead that you create an attribute definition file (more about this below) to assign values of your custom attribute to residues.  You can read in the file with the command "defattr" and then use the "rangecolor" command to map colors to values.  Then the  "rangecolor" command will do all the RGB interpolating for you.


As an example, here is using the command to show the values of bfactor, which is already assigned when you open a PDB file:

open 1zik
rangecol bfactor min yellow max red

OR, you could give values of the attribute directly instead of min/mid/max, for example

rangecol bfactor 20 blue 50 red 90 yellow

Here is the description of an attribute definition file, including links to several example files:

Then if you named your custom attribute "blah" your commands could look something like

defattr /Users/me/myfiles/blah-definition.txt
rangecol blah min white mid 1,1,.3 max 1,.1,0

I hope this helps,
Elaine C. Meng, Ph.D.                       
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

On Sep 28, 2010, at 2:09 AM, Sumitro Harjanto wrote:
> I am looking into using CHIMERA to create a diagram. Each residue will be coloured according to an assigned value; say if the value is high, the residue will assume a bright red colour; if the value is low, the residue will be coloured light yellow; residue with a medium value will appear somewhat orange.
> So my question will be: is there a way to specify the colour of a residue by its RGB value? And how does the command look like (as I will be scripting to do it in large scale)?
> Thanks! =]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100928/215bb085/attachment.html>

More information about the Chimera-users mailing list