
Hi Elaine, I am looking into using CHIMERA to create a diagram. Each residue will be coloured according to an assigned value; say if the value is high, the residue will assume a bright red colour; if the value is low, the residue will be coloured light yellow; residue with a medium value will appear somewhat orange. So my question will be: is there a way to specify the colour of a residue by its RGB value? And how does the command look like (as I will be scripting to do it in large scale)? Thanks! =] Cheers, Sumitro Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."

Hi Sumitro, It sounds like you might be thinking of computing the RGB values from some other values yourself, then applying these "manually" with the color command. You could do that -- it is possible to use R,G,B or R,G,B,A (where A is opacity for a transparent color) or a Tk code instead of a color name in practically all of the coloring commands, as explained for the "color" command here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/color.html> However, if I understand your situation correctly, I recommend instead that you create an attribute definition file (more about this below) to assign values of your custom attribute to residues. You can read in the file with the command "defattr" and then use the "rangecolor" command to map colors to values. Then the "rangecolor" command will do all the RGB interpolating for you. <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/rangecolor.html> As an example, here is using the command to show the values of bfactor, which is already assigned when you open a PDB file: open 1zik disp rangecol bfactor min yellow max red OR, you could give values of the attribute directly instead of min/mid/max, for example rangecol bfactor 20 blue 50 red 90 yellow Here is the description of an attribute definition file, including links to several example files: <http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/defineattrib/defineattrib.html#attrfile> Then if you named your custom attribute "blah" your commands could look something like defattr /Users/me/myfiles/blah-definition.txt rangecol blah min white mid 1,1,.3 max 1,.1,0 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 28, 2010, at 2:09 AM, Sumitro Harjanto wrote:
I am looking into using CHIMERA to create a diagram. Each residue will be coloured according to an assigned value; say if the value is high, the residue will assume a bright red colour; if the value is low, the residue will be coloured light yellow; residue with a medium value will appear somewhat orange.
So my question will be: is there a way to specify the colour of a residue by its RGB value? And how does the command look like (as I will be scripting to do it in large scale)? Thanks! =]

Hi Elaine, Thanks for your prompt reply on the previous issue. I have managed to get the colours on the residues. Now I have another problem pertaining to the label. 1. Is there a way to change the colour of the label such that it is different from that of the residue..? 2. How can I change the information on the label such that only the residue's position is shown (omitting the residue's name/type)? Thanks. Cheers, Sumitro From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: Wednesday, September 29, 2010 5:39 AM To: Sumitro Harjanto Cc: Chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] colour residue by value Hi Sumitro, It sounds like you might be thinking of computing the RGB values from some other values yourself, then applying these "manually" with the color command. You could do that -- it is possible to use R,G,B or R,G,B,A (where A is opacity for a transparent color) or a Tk code instead of a color name in practically all of the coloring commands, as explained for the "color" command here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/color.html> However, if I understand your situation correctly, I recommend instead that you create an attribute definition file (more about this below) to assign values of your custom attribute to residues. You can read in the file with the command "defattr" and then use the "rangecolor" command to map colors to values. Then the "rangecolor" command will do all the RGB interpolating for you. <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/rangecolor.html> As an example, here is using the command to show the values of bfactor, which is already assigned when you open a PDB file: open 1zik disp rangecol bfactor min yellow max red OR, you could give values of the attribute directly instead of min/mid/max, for example rangecol bfactor 20 blue 50 red 90 yellow Here is the description of an attribute definition file, including links to several example files: <http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/defineattrib/d efineattrib.html#attrfile> Then if you named your custom attribute "blah" your commands could look something like defattr /Users/me/myfiles/blah-definition.txt rangecol blah min white mid 1,1,.3 max 1,.1,0 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 28, 2010, at 2:09 AM, Sumitro Harjanto wrote: I am looking into using CHIMERA to create a diagram. Each residue will be coloured according to an assigned value; say if the value is high, the residue will assume a bright red colour; if the value is low, the residue will be coloured light yellow; residue with a medium value will appear somewhat orange. So my question will be: is there a way to specify the colour of a residue by its RGB value? And how does the command look like (as I will be scripting to do it in large scale)? Thanks! =] Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."

Hi Sumitro, 1. yes, you can change the color of the labels only, using either the "Actions... Color" menu or the color command. If menu, in version 1.5 (daily build), choose "Actions... Color... all options" and in that dialog set "coloring applies to" to "residue labels" and then do the coloring. In earlier versions, choose "Actions... Color... residue labels" and then use that menu again to do the coloring. Either version, you should probably change back from "residue labels" to "all of the above" again after coloring the labels to avoid later confusion. If command, you would just put a modifier right after the color name. Modifiers include ",l" (letter ell) for labels, ",lr" for residue labels, etc. as documented here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/color.html> Example: color hot pink,lr :52 to color residue label only of residue 52 hot pink. No space after the comma. 2. yes, use menu item "Actions... Label... Residue... custom" to set custom residue label contents. Documented here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/customlabel.html> Best, 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 Oct 5, 2010, at 3:14 AM, Sumitro Harjanto wrote:
Hi Elaine, Thanks for your prompt reply on the previous issue. I have managed to get the colours on the residues. Now I have another problem pertaining to the label.
1. Is there a way to change the colour of the label such that it is different from that of the residue..? 2. How can I change the information on the label such that only the residue’s position is shown (omitting the residue’s name/type)? Thanks. Cheers, Sumitro

Hi Elaine, Regarding point (2): changing the content of the label, other than using the gui menu, can I do it through command line? I am dealing with quite a large number of residues for labeling. So if I can automate the process through scripting will be good. I came across this command rlabel which allows me to label the residues, but it seems to, by default, print out labels with both residue position along the chain and 3-letter code, which I would like to omit. I read its documentation but doesn't seem to allow me to change the content of the label printed out through this command. I am exploring labelopt also, but I am not too sure if it is helpful. Please advise, thanks! =] Cheers, sum From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: Wednesday, October 06, 2010 12:10 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] changing the content and colour of labels Hi Sumitro, 1. yes, you can change the color of the labels only, using either the "Actions... Color" menu or the color command. If menu, in version 1.5 (daily build), choose "Actions... Color... all options" and in that dialog set "coloring applies to" to "residue labels" and then do the coloring. In earlier versions, choose "Actions... Color... residue labels" and then use that menu again to do the coloring. Either version, you should probably change back from "residue labels" to "all of the above" again after coloring the labels to avoid later confusion. If command, you would just put a modifier right after the color name. Modifiers include ",l" (letter ell) for labels, ",lr" for residue labels, etc. as documented here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/color.html> Example: color hot pink,lr :52 to color residue label only of residue 52 hot pink. No space after the comma. 2. yes, use menu item "Actions... Label... Residue... custom" to set custom residue label contents. Documented here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/customlabel.html> Best, 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 Oct 5, 2010, at 3:14 AM, Sumitro Harjanto wrote: Hi Elaine, Thanks for your prompt reply on the previous issue. I have managed to get the colours on the residues. Now I have another problem pertaining to the label. 1. Is there a way to change the colour of the label such that it is different from that of the residue..? 2. How can I change the information on the label such that only the residue's position is shown (omitting the residue's name/type)? Thanks. Cheers, Sumitro Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."

Hi Sumitro, Sorry, I can't think of any way to show only the residue number as the label using Chimera commands. If by "large number" you meant several residues in one structure, you can just select them all at the same time and use the custom residue labeling from the menu (described in earlier message) once. However, if you meant you are processing a lot of different structures, one structure at a time, that would be inconvenient. As usual, it can be done in python. It is beyond my knowledge, but happily Eric has supplied the following code that will do it for the currently selected residues. I guess you could put it in a *.py file and have your Chimera command script open that file. from chimera.selection import currentResidues for r in currentResidues(): r.label = r.id.position 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 Oct 5, 2010, at 8:27 PM, Sumitro Harjanto wrote:
Hi Elaine,
Regarding point (2): changing the content of the label, other than using the gui menu, can I do it through command line?
I am dealing with quite a large number of residues for labeling. So if I can automate the process through scripting will be good.
I came across this command rlabel which allows me to label the residues, but it seems to, by default, print out labels with both residue position along the chain and 3-letter code, which I would like to omit. I read its documentation but doesn’t seem to allow me to change the content of the label printed out through this command.
I am exploring labelopt also, but I am not too sure if it is helpful.
Please advise, thanks! =]
Cheers, sum
From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: Wednesday, October 06, 2010 12:10 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] changing the content and colour of labels
Hi Sumitro, 1. yes, you can change the color of the labels only, using either the "Actions... Color" menu or the color command.
If menu, in version 1.5 (daily build), choose "Actions... Color... all options" and in that dialog set "coloring applies to" to "residue labels" and then do the coloring. In earlier versions, choose "Actions... Color... residue labels" and then use that menu again to do the coloring. Either version, you should probably change back from "residue labels" to "all of the above" again after coloring the labels to avoid later confusion.
If command, you would just put a modifier right after the color name. Modifiers include ",l" (letter ell) for labels, ",lr" for residue labels, etc. as documented here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/color.html> Example: color hot pink,lr :52 to color residue label only of residue 52 hot pink. No space after the comma.
2. yes, use menu item "Actions... Label... Residue... custom" to set custom residue label contents. Documented here: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/customlabel.html>
Best, 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 Oct 5, 2010, at 3:14 AM, Sumitro Harjanto wrote:
Hi Elaine, Thanks for your prompt reply on the previous issue. I have managed to get the colours on the residues. Now I have another problem pertaining to the label.
1. Is there a way to change the colour of the label such that it is different from that of the residue..? 2. How can I change the information on the label such that only the residue’s position is shown (omitting the residue’s name/type)? Thanks. Cheers, Sumitro
Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you." _______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Elaine Meng
-
Sumitro Harjanto