Hi Padma, We have developed a Chimera tool to color by bfactor or other attributes but it is not yet released. We expect to have a new release in the middle of May. Here are a couple approaches you could use now. You can use the color command like the following to color all atoms with bfactor between 10 and 15 green. color green @/bfactor>=10 and bfactor<=15 You could put a series of these commmands in a file to color several intervals different colors to get a rainbow effect. Use the "open" command to run the file of coloring commands. A more flexible route is to use some Python code. Putting the code shown below in a file bcolor.py and then opening this file will make a rainbow coloring by bfactor for the selected atoms. A fancier version of this could have a dialog popup to specify bfactor range and colors. If you make a molecular surface with Actions/Surface/Show the default coloring of this surface is to use the atom colors. So coloring the atoms by any of the above means will allow you to get the same coloring on a surface. Tom ----- code bcolor.py follows: # ----------------------------------------------------------------------------- # def color_atoms_by_bfactor(atoms, b0, rgb0, b1, rgb1): for a in atoms: if hasattr(a, 'bfactor'): b = a.bfactor if b < b0: f = 0 elif b < b1: f = (b - b0) / (b1 - b0) else: f = 1 r,g,b = ((1-f)*rgb0[0] + f*rgb1[0], (1-f)*rgb0[1] + f*rgb1[1], (1-f)*rgb0[2] + f*rgb1[2]) import chimera a.color = chimera.MaterialColor(r,g,b) # ----------------------------------------------------------------------------- # from chimera import selection atoms = selection.currentAtoms() # currently selected atoms b0 = 5 rgb0 = (0,0,1) # blue b1 = 20 rgb1 = (1,0,0) # red color_atoms_by_bfactor(atoms, b0, rgb0, b1, rgb1)
To: Thomas Goddard <goddard@cgl.ucsf.edu> Subject: One more Chimera question! From: Padmaja Natarajan <nataraja@scripps.edu> Date: Fri, 23 Apr 2004 13:31:38 -0700
Hi Tom,
Is it possible to make a molecular surface based on PDB coordinates and be able to view this surface colored (as a spectrum going from blue for smallest to red for largest value), depending on values stored in say B-factor column of the PDB file. (as shown in figure below created using AVS)
thanks again regards Padma
On Friday, April 23, 2004, at 02:22 PM, Thomas Goddard wrote:
We have developed a Chimera tool to color by bfactor or other attributes but it is not yet released. We expect to have a new release in the middle of May.
Hi Padma, I'd like to supplement Tom's answer to say that an undocumented version of the coloring tool he refers to did make it into the 1917 snapshot release, which you could download, or you can use the alternatives Tom described instead. If you do go with the 1917 release, you bring up the coloring tool by selecting your model in the Model Panel and clicking the "render attrs..." button. In the dialog that comes up in response you would pick "Attibutes of: atoms", and then "attribute: bfactor". This will show you a histogram of the bfactor values and 3 color markers used to indicate the color range to use. You can ctrl-click on the histogram to add/delete markers. Normal clicking on a marker will allow you to adjust its color using the color well beneath the histogram. You can also drag the markers left/right with the mouse or type in a value for you last selected marker in the "Value" entry field. This interface will be changed and improved in the next release, but is basically functional for what you want to do now. Eric Pettersen UCSF Computer Graphics Lab pett@cgl.ucsf.edu http://www.cgl.ucsf.edu
participants (2)
-
Eric Pettersen
-
Thomas Goddard