
Hi All, Is there a way to color the ribbon with a gradient? In my case, it has to be an increasing and then decreasing gradient. Ex: Let's say I have data that shows that a certain region of a protein is highly dynamic. This region consists of approx 11 residues and the most dynamic region in these 11 are the residues 5,6 and 7. Now, I need to color the ribbon in such a way that residues 1 and 11 are the same color (green), 2 and 10 (yellow), 3 and 9 (light orange) 4 and 8 (orange) 5,6 and 7 (red). I could do this by coding it but it becomes a step gradient and it doesn't look so good plus if I need to do this for residues in a bunch of proteins/peptides, the task quickly becomes tedious. I would rather write 2 lines of code for the complete protein than write 1 line/residue/protein. Any ideas? Thanks in advance Vamsee

Hi Vamsee, You can assign "attribute" values to the residues <http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/defineattrib/defineattrib.html> ... then map attribute value to colors using "Render by Attribute" or command "rangecolor" <http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/render/render.html#render> <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/rangecolor.html> It depends what you mean by gradient: While the mapping of values to colors is continuous (colors will be interpolated), the ribbon "piece" for each residue is only a single color, so you will see color boundaries between residues unless their values are very similar. For example, the following command would color a ribbon by the built-in attribute named kdHydrophobicity (amino acid hydrophobicity on the Kyte-Doolittle scale). Values -4 and lower would be shown with lime green, then up to 0 gradually interpolated to white, then up to 4 r interpolated up to orange. rangecol kdHydrophobicity,r -4 lime green 0 white 4 orange There is a simple format for reading in your own custom attributes: <http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/defineattrib/defineattrib.html#attrfile> ... or if you have only a few values to assign, you can do them one at a time with command "setattr": <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/setattr.html> See also tutorials, including: B-factor coloring <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/bfactor.html> Surface properties <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/surfprop.html> Attributes <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/attributes.html> I hope this helps, Elaine ---------- 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 10, 2012, at 12:59 PM, vamsee wrote:
Hi All, Is there a way to color the ribbon with a gradient? In my case, it has to be an increasing and then decreasing gradient. Ex: Let's say I have data that shows that a certain region of a protein is highly dynamic. This region consists of approx 11 residues and the most dynamic region in these 11 are the residues 5,6 and 7. Now, I need to color the ribbon in such a way that residues 1 and 11 are the same color (green), 2 and 10 (yellow), 3 and 9 (light orange) 4 and 8 (orange) 5,6 and 7 (red). I could do this by coding it but it becomes a step gradient and it doesn't look so good plus if I need to do this for residues in a bunch of proteins/peptides, the task quickly becomes tedious. I would rather write 2 lines of code for the complete protein than write 1 line/residue/protein. Any ideas? Thanks in advance Vamsee
participants (2)
-
Elaine Meng
-
vamsee