[Chimera-users] changing the content and colour of labels
meng at cgl.ucsf.edu
Thu Oct 7 10:21:02 PDT 2010
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 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! =]
> From: Elaine Meng [mailto:meng at cgl.ucsf.edu]
> Sent: Wednesday, October 06, 2010 12:10 AM
> To: Sumitro Harjanto
> Cc: chimera-users at 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:
> 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:
> 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)?
> 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 at cgl.ucsf.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chimera-users