[Chimera-users] selecting multiscale model volumes

Thomas Goddard goddard at cgl.ucsf.edu
Mon Jun 26 18:18:57 PDT 2006


Hi Cathy,

  Unfortunately no Chimera commands allow selecting or coloring
multiscale surfaces.  The multiscale tool in general is not well
integrated with the other Chimera capabilities -- like the Actions
Color menu won't color chain surfaces that you select with the mouse.
We plan on fixing this in the future but it may take a while (6 months
or more).

  Everything is possible using Python code, although this can be quite
difficult to figure out.  It is not documented and the best approach is
to ask for examples from us that you can then modify.  Below is code
to color multiscale surfaces with specific matrix subunits and chain IDs.
If you open that file in Chimera (with File / Open..., or with the "open"
command) it will do the type of coloring you requested.  When you modify
the code be careful not to change the indentation since this is important
in Python.

  We could easily do a little better and add a Chimera command so that
you would not have to edit a Python script to specify what residue
ranges and colors to use.

  I am going on vacation tomorrow until July 18 but can make that
command for you when I return.  It just requires some additional
Python code that Chimera will load at startup.

	Tom

----
Python file mmcolor.py follows:

# ----------------------------------------------------------------------------
# Color certain matrix subunits and chains of a multiscale model.
#
def color_multiscale(rgba, model_num, matrix_nums, chain_ids = None):

  import MultiScale
  d = MultiScale.multiscale_model_dialog(True)
  for cp in d.chain_pieces():
    g = cp.surface_group
    if g.model().id == model_num:
      mnum, chain_id = g.oslName.split('.')
      if chain_ids == None or chain_id in chain_ids:
        if int(mnum) in matrix_nums:
          cp.set_color(rgba)

# ----------------------------------------------------------------------------
#
red = (1,0,0,1)         # Red, green, blue, opacity
green = (0,1,0,1)
blue = (0,0,1,1)
cyan = (0,1,1,1)

color_multiscale(blue, 1, range(1,21))   # Color matrix subunits 1-20
color_multiscale(cyan, 1, range(21,41))   # Color matrix subunits 21-40
color_multiscale(green, 1, range(41,61))   # Color matrix subunits 41-60

# Example coloring subunits 1-20, only chains 'A' and 'B'.
#color_multiscale(red, 1, range(1,21), ['A', 'B'])





More information about the Chimera-users mailing list