[Chimera-users] Chimera X color by attribute middle range value

Zimanyi, Marcell Marcell.Zimanyi at ucsf.edu
Tue Apr 12 17:06:40 PDT 2022

Hi Elaine,

Thank you so much, this is exactly what I was looking for; I have residues colored the way I like now. I appreciate your answer, and I will be sure to join the ChimeraX mailing list as well.

Best wishes,

From: Elaine Meng <meng at cgl.ucsf.edu>
Sent: Monday, April 11, 2022 5:34 PM
To: Zimanyi, Marcell <Marcell.Zimanyi at ucsf.edu>
Cc: chimera-users at cgl.ucsf.edu <chimera-users at cgl.ucsf.edu>; ChimeraX Users Help <chimerax-users at cgl.ucsf.edu>
Subject: Re: [Chimera-users] Chimera X color by attribute middle range value

Hi Marcell!
In ChimeraX, you can control which colors go with which values in the "palette" option of the "color byattribute" command.  This option can take color/value pairs, and the "range" option is not needed in your situation (if I understand correctly).  As you found, if you only give the range, it will spread out the colors evenly.

Here's an example of value,color pairs if you want to color by attribute named "blah" using dodger blue for 0.2, red for 1.0, and gold for 4.0:

color byattr blah palette 0.2,dodgerblue:1.0,red:4.0,gold


There are lots of named colors, although you could use hex codes instead if the named ones aren't quite what you want.

ChimeraX does not yet have a color-by-attribute GUI although that is something we would like to have eventually.  The Color Key tool is just for drawing a color key to explain the coloring, but does not itself affect the structure coloring.

By the way, you may be interested in the chimerax-users at cgl.ucsf.edu mailing list (CC'd on this reply) for questions/discussion specifically about ChimeraX.

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

> On Apr 11, 2022, at 5:07 PM, Zimanyi, Marcell via Chimera-users <chimera-users at cgl.ucsf.edu> wrote:
> Hello Chimera Community,
> I have a .defattr file where I have assigned a value to a few residues on my protein. I'd like to set the range to be 0.2, 1, and 4 so that values with 1.0 will be the middle color. I currently don't see a way to set the middle value for the range. In Chimera, I could set the middle range value in the define attribute GUI. In Chimera X, I'm using color byattribute range 0.2,4 because the range argument will only accept two values. I see that I can bring up the color key gui, but when I change the color key I don't see a way to update the coloring on the residues themselves.
> Could you please help me figure out how to set attribute range with 3 values as in Chimera?
> Thanks,
> Marcell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimera-users/attachments/20220413/43b2f66f/attachment.html>

More information about the Chimera-users mailing list