[Chimera-users] Get xpos and ypos of selected residues automatically
Elaine Meng
meng at cgl.ucsf.edu
Thu Jun 3 09:33:11 PDT 2010
Dear Wei,
You will probably need to use the regular (3D) labels instead, at least for the residues. If you have some title or text that always goes in a particular place on the screen, for example across the top, it could be done with 2D labels. However, if you want labels automatically near some atoms or residues but you don't know ahead of time where they will be in the window, use the regular labels. I have been working on something similar myself...
How to make regular (3D) labels in figures look better:
(a) use bigger font size, and perhaps bold font style.
(b) use Z-offset to bring them forward so they will be in front, less likely to be blocked by other stuff.
More about each of these below...
(a) You can give each label a different color if you want (for example, with the color command), but the limitation with the regular labels is that they must all be in the same font size and style. Another limitation is that currently you can't set the font size and style with commands; you have to do it ahead of time (but only once): choose Preferences from the Favorites menu, go to category: Background, set label font size and style, click Save.
<http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/preferences.html#Background>
(b) In the label/rlabel commands, you can specify a Z-offset.
<http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/label.html>
<http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/rlabel.html>
For example, these commands set the view to show some set of residues, label them with a Z-offset of 2.5 angstroms, change label colors:
windowsize 600 500
open 1add
ribscale licorice
alias motif :15.a,17.a,214.a,217.a,238.a,295.a,296.a
show motif
focus motif &~ @n,ca,c,o
rlabel offset 0,0,2.5 motif
color dodger blue,l
color red,l motif & :asp,glu
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 Jun 3, 2010, at 12:04 AM, wei li wrote:
> Dear all,
> Here is my problem:
> I need to write a cmd script to use 2dlables automatically assign some annotations to some selected residues for many different proteins. However, I did not know the xpos and ypos for these residues and for different proteins there will be different residues which need to be assigned.
> So, is there any method to get the xpos and ypos via some commands when I only know the residue identifiers?
> Thanks
>
> Wei Li
> 2010-6-3
More information about the Chimera-users
mailing list