[Chimera-users] Coloring different set of marker with different radius

Tom Goddard goddard at cgl.ucsf.edu
Tue Jul 8 11:35:59 PDT 2008

Hi Huy,

  Currently a surface can be colored with the color zone dialog with 
only one radius.  If you want to use multiple radii you can change a 
couple lines of the Color Zone Python code as follows.  Edit the file


using any text editor.  (On the Mac this is 
Chimera.app/Contents/Resources/share/ColorZone/__init__.py).   In the 
color_piece() routine around line 66 you'll see the line

    rgba[:,:] = p.color

Add two more lines after that so you have

    rgba[:,:] = p.color
    if not p.vertexColors is None:
        rgba[:,:] = p.vertexColors

Make sure the indentation is as shown since indentation level is 
important in Python.  Next in the color_zone() routine near the top of 
the file (line 13) find the lines

    if auto_update:
        zone_updater.auto_zone(model, points, point_colors, distance)

and put a # character in front of these two lines.

#    if auto_update:
#        zone_updater.auto_zone(model, points, point_colors, distance)

Then restart Chimera and you can use color zone repeatedly on the same 
surface with different radii and different markers selected.  I tested 
it with Chimera 1.2539 (daily build) but it should work with the 1.2470 
production release.

The first code change you made preserves the current coloring of the 
surface when a new color zone is added.  The second change you made 
eliminates automatic coloring updates when the surface shape or coloring 
radius changes.  Without the second change if you move the color zone 
dialog slider to color using a new radius it will update the radius of 
your previous color zone coloring which you do not want.

With these changes Chimera sessions will not save the color zone 
coloring in session files.  More significant changes would be needed to 
allow saving the coloring in sessions with multiple coloring radii.

It is our intent to improve the Color Zone code to make multiple radii 
work.  It is on our Chimera plans web page item 37.



More information about the Chimera-users mailing list