<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BorisKheyfets</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BorisKheyfets"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/BorisKheyfets"/>
	<updated>2026-05-16T16:51:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Set_Key&amp;diff=268</id>
		<title>Talk:Set Key</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Set_Key&amp;diff=268"/>
		<updated>2012-11-20T10:47:27Z</updated>

		<summary type="html">&lt;p&gt;BorisKheyfets: Created page with &amp;quot;Today I tried  &amp;lt;pre&amp;gt;cmd.set_key('ALT-x', cmd.turn, ('x',90))&amp;lt;/pre&amp;gt;  and it gave an error -- the problem is the Alt-x combination. Other combinations seem to be working well. I'm ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Today I tried&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cmd.set_key('ALT-x', cmd.turn, ('x',90))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and it gave an error -- the problem is the Alt-x combination. Other combinations seem to be working well. I'm on PyMOL 1.5.0.3.&lt;/div&gt;</summary>
		<author><name>BorisKheyfets</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:BorisKheyfets&amp;diff=3243</id>
		<title>User:BorisKheyfets</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:BorisKheyfets&amp;diff=3243"/>
		<updated>2012-10-27T09:47:03Z</updated>

		<summary type="html">&lt;p&gt;BorisKheyfets: Created page with &amp;quot;== Emacs == Emacs is text editor in which You can easily write functions which transform text. * Simple emacs mode for [https://github.com/bk322/bk_elisps/blob/master/modes/bk-pm...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Emacs ==&lt;br /&gt;
Emacs is text editor in which You can easily write functions which transform text.&lt;br /&gt;
* Simple emacs mode for [https://github.com/bk322/bk_elisps/blob/master/modes/bk-pml-mode.el PyMOL's pml scripts]&lt;br /&gt;
* Simple emacs mode for [https://github.com/bk322/bk_elisps/blob/master/modes/bk-pdb-mode.el pdb files] (I'm only interested in ATOM records)&lt;br /&gt;
&lt;br /&gt;
== [http://pygments.org/ Pygments] ==&lt;br /&gt;
I use [http://sphinx.pocoo.org sphinx] for notes of all kinds. And sphinx uses pygments to color code. So I write pygment lexers (highlight rules).&lt;br /&gt;
* Simple pygments lexer for [https://github.com/bk322/bk_pygments/wiki PyMOL's pml scripts]&lt;br /&gt;
* Simple pygments lexer for [https://github.com/bk322/bk_pygments/tree/master/ProteinDataBank pdb files] (I'm only interested in ATOM records)&lt;br /&gt;
&lt;br /&gt;
== PyMOL scripts ==&lt;br /&gt;
I do coarse grained molecular dynamics in Gromacs. &lt;br /&gt;
* [https://github.com/bk322/bk_simulates/tree/master/bk_pml PyMOL scripts]&lt;/div&gt;</summary>
		<author><name>BorisKheyfets</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Set_Key&amp;diff=9820</id>
		<title>Set Key</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Set_Key&amp;diff=9820"/>
		<updated>2012-10-23T15:39:49Z</updated>

		<summary type="html">&lt;p&gt;BorisKheyfets: /* PYTHON EXAMPLE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''set_key''' binds a specific python function to a key press.&lt;br /&gt;
&lt;br /&gt;
===PYMOL API (ONLY)===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.set_key( string key, function fn, tuple arg=(), dict kw={})&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PYTHON EXAMPLE===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
&lt;br /&gt;
def make_it_blue(object): cmd.color(&amp;quot;blue&amp;quot;,object)&lt;br /&gt;
&lt;br /&gt;
cmd.set_key( 'F1' , make_it_blue, [ &amp;quot;object1&amp;quot; ] )&lt;br /&gt;
# would turn object1 blue when the F1 key is pressed and&lt;br /&gt;
# (in order to use it one has to make a selection called&lt;br /&gt;
# object1)&lt;br /&gt;
 &lt;br /&gt;
cmd.set_key( 'F2' , make_it_blue, [ &amp;quot;object2&amp;quot; ] )&lt;br /&gt;
# would turn object2 blue when the F2 key is pressed.&lt;br /&gt;
 &lt;br /&gt;
cmd.set_key( 'CTRL-C' , cmd.zoom )   &lt;br /&gt;
cmd.set_key( 'ALT-A' , cmd.turn, ('x',90) )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===KEYS WHICH CAN BE REDEFINED===&lt;br /&gt;
 F1 to F12&lt;br /&gt;
 left, right, pgup, pgdn, home, insert&lt;br /&gt;
 CTRL-A to CTRL-Z &lt;br /&gt;
 ALT-0 to ALT-9, ALT-A to ALT-Z&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
[[Button]] [[Check Key]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Set Key]]&lt;/div&gt;</summary>
		<author><name>BorisKheyfets</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Label&amp;diff=13855</id>
		<title>Label</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Label&amp;diff=13855"/>
		<updated>2012-10-15T13:21:01Z</updated>

		<summary type="html">&lt;p&gt;BorisKheyfets: /* Labels Using One Letter Abbreviations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Pl.png|right|500px]]&lt;br /&gt;
&lt;br /&gt;
The [[Label]] command controls how PyMOL draws text labels for PyMOL objects.&lt;br /&gt;
&lt;br /&gt;
= Details =&lt;br /&gt;
Labeling is important so there are many options for your fine tuning needs.  You can change the [[Label_size|label size]], [[Label_color|label color]], positioning, [[Label_font_id|font]], the [[Label_outline_color|label outline color]] that masks the font and much, much more.&lt;br /&gt;
&lt;br /&gt;
You can have PyMOL label atoms by properties or arbitrary strings as you want; you can even use Unicode fonts for special symbols like, &amp;lt;math&amp;gt;\alpha, \beta, \pm, \textrm{\AA}&amp;lt;/math&amp;gt;, etc.&lt;br /&gt;
&lt;br /&gt;
The following gallery shows some examples of how extensible the [[Label]] command is.  &lt;br /&gt;
&amp;lt;gallery heights=&amp;quot;180px&amp;quot; widths=&amp;quot;200px&amp;quot; align=&amp;quot;center&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Label_pre.png|Simple label&lt;br /&gt;
Image:New_fonts.jpeg|Example showing usage of Unicode fonts for special characters, see [[label_font_id]].&lt;br /&gt;
Image:Font_ex.png|Another example with Unicode fonts&lt;br /&gt;
Image:Label_ex.png|Example label&lt;br /&gt;
Image:Ls0.png|Label shadows turned off&lt;br /&gt;
Image:Ls2.png|Label shadows turned on&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Built-in Object Properties==&lt;br /&gt;
Aside from arbitrary string labels, like &amp;quot;This is the catalytic residue&amp;quot; for an atom/residue you can also use the following built-in molecular properties:&lt;br /&gt;
* '''name''', the atom name&lt;br /&gt;
* '''resn''', the residue name&lt;br /&gt;
*'''resi''', the residue number/identifier&lt;br /&gt;
*'''chain''', the chain name&lt;br /&gt;
*'''q''', charge&lt;br /&gt;
*'''b''', the occupancy/b-factor&lt;br /&gt;
*'''segi''', the segment identifier&lt;br /&gt;
*'''type''' ''(ATOM,HETATM)'', the type of atom&lt;br /&gt;
*'''formal_charge''', the formal charge&lt;br /&gt;
*'''partial_charge''', the partial charge&lt;br /&gt;
*'''numeric_type''', the numeric type&lt;br /&gt;
*'''text_type''', the text type&lt;br /&gt;
&lt;br /&gt;
You can use one of these properties as:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# simple example: label residue 22's atoms with their names&lt;br /&gt;
label i. 22, name&lt;br /&gt;
&lt;br /&gt;
# Label residue #44's alpha carbon with it's residue name, residue number and B-factor.&lt;br /&gt;
label n. CA and i. 44, &amp;quot;(%s, %s, %s&amp;quot;) % (resn, resi, b)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the syntax and examples below for more info.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
To use the label command follow this syntax:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# labeling syntax&lt;br /&gt;
label [ selection[, expression]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where '''selection''' is some object/selection you want to label and '''expression''' is some string (or set of strings) which PyMOL is to use to label the given selection.&lt;br /&gt;
&lt;br /&gt;
We have plenty of examples.  See [[#Examples|the examples]] below.&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
Here are all the label settings and their general effect.  For each label setting, see the respective web page for more details.&lt;br /&gt;
&lt;br /&gt;
'''[[label_angle_digits]]'''&lt;br /&gt;
:: sets the number of decimals in angle label.&lt;br /&gt;
'''[[label_distance_digits]]'''&lt;br /&gt;
:: sets the number of decimals in distance label.&lt;br /&gt;
'''[[label_shadow_mode]]'''&lt;br /&gt;
:: sets whether or not PyMOL will ray trace shadows for your label text.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_shadow_mode, 2&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_color]]'''&lt;br /&gt;
:: sets the color of the label text.  Note that you can have labels of different colors for different objects or selections. Some examples:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# per-object:&lt;br /&gt;
set label_color, color-name, object-name  #eg, set label-color, magenta, /protein&lt;br /&gt;
&lt;br /&gt;
# per-atom:&lt;br /&gt;
set label_color, color-name, selection    #eg, set label-color, marine, /protein/A/A/23/CA&lt;br /&gt;
&lt;br /&gt;
# another example&lt;br /&gt;
fragment arg&lt;br /&gt;
label all, name&lt;br /&gt;
set label_color, yellow, arg&lt;br /&gt;
set label_color, red, elem c&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''[[label_font_id]]'''&lt;br /&gt;
:: sets the font to render your label.  There are 12 different fonts from 5&amp;amp;mdash;16.  Numbers 15 and 16 are special for unicode.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_font_id, 12&amp;lt;/source&amp;gt;. See the [[label_font_id]] page for explicit examples on how to use unicode characters in PyMOL labels.&lt;br /&gt;
'''[[label_size]]'''&lt;br /&gt;
:: sets the size of the text.  You can use positive numbers 2, 3, 4, etc for point sizes, or negative numbers for Angstrom-based sizes. Default is 14 points. Labels in Angstrom-size scale with the distance from the front plane, labels in point-size don't.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_size, -2  #results in a size of 2 Angstroms&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_digits]]'''&lt;br /&gt;
:: sets the number of decimals in label. It affects all digits only if label_distance_digits or label_dihedral_digits or label_angle_digits are set to -1.&lt;br /&gt;
'''[[label_outline_color]]'''&lt;br /&gt;
:: each label is outlined (so you can do white-on-white labels, for example).  This options sets the color of the label outline.  Eg. &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_outline_color, orange&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_dihedral_digits]]'''&lt;br /&gt;
:: sets the number of decimals in dihedral label.&lt;br /&gt;
'''[[label_position]]'''&lt;br /&gt;
:: sets any offset from the original X,Y,Z coordinates for the label.  If you like to use the mouse, you can enter [[edit_mode]] and '''ctrl-middle-click''' to drag labels around; '''ctrl-shift-left_click''' will let you move the labels in the z-direction. '''&amp;quot;Save labels&amp;quot;-workaround''' If you want to save the position of your labels, the best way might be to create a new object and move the atoms in this object. Since the labels are positioned from the atom positions this is an indirect way of moving the labels and being able to save them.&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#1.&lt;br /&gt;
# make a very simple label on the 14th alpha carbon.&lt;br /&gt;
label n. CA and i. 14, &amp;quot;This is carbon 14.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#2.&lt;br /&gt;
# make a fake scene label; use this to label entire scenes, not just atoms/bonds.&lt;br /&gt;
pseudoatom foo&lt;br /&gt;
label foo, &amp;quot;Once upon a time...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#3.&lt;br /&gt;
# make a huge label&lt;br /&gt;
set label_size, -5&lt;br /&gt;
pseudoatom foo&lt;br /&gt;
label foo, &amp;quot;This is large text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#4. Partial Charge&lt;br /&gt;
label (chain A),chain&lt;br /&gt;
label (n;ca),&amp;quot;%s-%s&amp;quot; % (resn,resi)&lt;br /&gt;
label (resi 200),&amp;quot;%1.3f&amp;quot; % partial_charge&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#5. The gallery image above Label_ex.png was created with this code&lt;br /&gt;
#   and finally, some labels were moved around in '''edit_mode'''.&lt;br /&gt;
label (resi 200),&amp;quot;%1.3f&amp;quot; % b&lt;br /&gt;
set label_font_id, 10&lt;br /&gt;
set label_size, 10&lt;br /&gt;
&lt;br /&gt;
#6. This example shows how to label a selection with the &lt;br /&gt;
#   XYZ coordinates of the atoms &lt;br /&gt;
from pymol import stored&lt;br /&gt;
stored.pos = []&lt;br /&gt;
# select the carbon atoms in my hetero atoms to label&lt;br /&gt;
select nn, het and e. C&lt;br /&gt;
# get the XYZ coordinates and put htem into stored.pos&lt;br /&gt;
iterate_state 1, (nn), stored.pos.append((x,y,z))&lt;br /&gt;
# label all N atoms.  You need the pop() function or else&lt;br /&gt;
# PyMOL will complain b/c you didn't provide enough coords.&lt;br /&gt;
label nn, (&amp;quot;%5.5s, %5.5s, %5.5s&amp;quot;) %  stored.pos.pop()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= User Comments =&lt;br /&gt;
==Labels Using ID Numbers==&lt;br /&gt;
The following commnent,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label SELECTION, &amp;quot; %s&amp;quot; % ID &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
labels the SELECTION with atom ID numbers.&lt;br /&gt;
&lt;br /&gt;
You can make more complicated selections/lables such as&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label SELECTION, &amp;quot; %s:%s %s&amp;quot; % (resi, resn, name)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which will give you something like &amp;quot;GLU:139 CG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Labels Using One Letter Abbreviations==&lt;br /&gt;
* First, Add this to your $HOME/.pymolrc  file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# start $HOME/.pymolrc modification&lt;br /&gt;
one_letter ={'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \&lt;br /&gt;
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y',    \&lt;br /&gt;
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A',    \&lt;br /&gt;
'GLY':'G', 'PRO':'P', 'CYS':'C'}&lt;br /&gt;
# end modification&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second, instead of:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label n. ca, resn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
use:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label n. ca, one_letter[resn]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or: ( to get something like D85)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label n. ca, &amp;quot;%s%s&amp;quot; %(one_letter[resn],resi)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Labels and defer_builds_mode==&lt;br /&gt;
If You have a weak video card, You might want to set&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set defer_builds_mode, 5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It helps a lot but breaks labels rendering. You can use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set defer_builds_mode, 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
instead.&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
[[:Category:Labeling]]&lt;br /&gt;
&lt;br /&gt;
All the settings posted above.&lt;br /&gt;
&lt;br /&gt;
[[Category:Labeling|Label]]&lt;br /&gt;
[[Category:Commands|Label]]&lt;/div&gt;</summary>
		<author><name>BorisKheyfets</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Label&amp;diff=13854</id>
		<title>Label</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Label&amp;diff=13854"/>
		<updated>2012-10-15T13:20:36Z</updated>

		<summary type="html">&lt;p&gt;BorisKheyfets: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Pl.png|right|500px]]&lt;br /&gt;
&lt;br /&gt;
The [[Label]] command controls how PyMOL draws text labels for PyMOL objects.&lt;br /&gt;
&lt;br /&gt;
= Details =&lt;br /&gt;
Labeling is important so there are many options for your fine tuning needs.  You can change the [[Label_size|label size]], [[Label_color|label color]], positioning, [[Label_font_id|font]], the [[Label_outline_color|label outline color]] that masks the font and much, much more.&lt;br /&gt;
&lt;br /&gt;
You can have PyMOL label atoms by properties or arbitrary strings as you want; you can even use Unicode fonts for special symbols like, &amp;lt;math&amp;gt;\alpha, \beta, \pm, \textrm{\AA}&amp;lt;/math&amp;gt;, etc.&lt;br /&gt;
&lt;br /&gt;
The following gallery shows some examples of how extensible the [[Label]] command is.  &lt;br /&gt;
&amp;lt;gallery heights=&amp;quot;180px&amp;quot; widths=&amp;quot;200px&amp;quot; align=&amp;quot;center&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Label_pre.png|Simple label&lt;br /&gt;
Image:New_fonts.jpeg|Example showing usage of Unicode fonts for special characters, see [[label_font_id]].&lt;br /&gt;
Image:Font_ex.png|Another example with Unicode fonts&lt;br /&gt;
Image:Label_ex.png|Example label&lt;br /&gt;
Image:Ls0.png|Label shadows turned off&lt;br /&gt;
Image:Ls2.png|Label shadows turned on&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Built-in Object Properties==&lt;br /&gt;
Aside from arbitrary string labels, like &amp;quot;This is the catalytic residue&amp;quot; for an atom/residue you can also use the following built-in molecular properties:&lt;br /&gt;
* '''name''', the atom name&lt;br /&gt;
* '''resn''', the residue name&lt;br /&gt;
*'''resi''', the residue number/identifier&lt;br /&gt;
*'''chain''', the chain name&lt;br /&gt;
*'''q''', charge&lt;br /&gt;
*'''b''', the occupancy/b-factor&lt;br /&gt;
*'''segi''', the segment identifier&lt;br /&gt;
*'''type''' ''(ATOM,HETATM)'', the type of atom&lt;br /&gt;
*'''formal_charge''', the formal charge&lt;br /&gt;
*'''partial_charge''', the partial charge&lt;br /&gt;
*'''numeric_type''', the numeric type&lt;br /&gt;
*'''text_type''', the text type&lt;br /&gt;
&lt;br /&gt;
You can use one of these properties as:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# simple example: label residue 22's atoms with their names&lt;br /&gt;
label i. 22, name&lt;br /&gt;
&lt;br /&gt;
# Label residue #44's alpha carbon with it's residue name, residue number and B-factor.&lt;br /&gt;
label n. CA and i. 44, &amp;quot;(%s, %s, %s&amp;quot;) % (resn, resi, b)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the syntax and examples below for more info.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
To use the label command follow this syntax:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# labeling syntax&lt;br /&gt;
label [ selection[, expression]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where '''selection''' is some object/selection you want to label and '''expression''' is some string (or set of strings) which PyMOL is to use to label the given selection.&lt;br /&gt;
&lt;br /&gt;
We have plenty of examples.  See [[#Examples|the examples]] below.&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
Here are all the label settings and their general effect.  For each label setting, see the respective web page for more details.&lt;br /&gt;
&lt;br /&gt;
'''[[label_angle_digits]]'''&lt;br /&gt;
:: sets the number of decimals in angle label.&lt;br /&gt;
'''[[label_distance_digits]]'''&lt;br /&gt;
:: sets the number of decimals in distance label.&lt;br /&gt;
'''[[label_shadow_mode]]'''&lt;br /&gt;
:: sets whether or not PyMOL will ray trace shadows for your label text.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_shadow_mode, 2&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_color]]'''&lt;br /&gt;
:: sets the color of the label text.  Note that you can have labels of different colors for different objects or selections. Some examples:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# per-object:&lt;br /&gt;
set label_color, color-name, object-name  #eg, set label-color, magenta, /protein&lt;br /&gt;
&lt;br /&gt;
# per-atom:&lt;br /&gt;
set label_color, color-name, selection    #eg, set label-color, marine, /protein/A/A/23/CA&lt;br /&gt;
&lt;br /&gt;
# another example&lt;br /&gt;
fragment arg&lt;br /&gt;
label all, name&lt;br /&gt;
set label_color, yellow, arg&lt;br /&gt;
set label_color, red, elem c&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''[[label_font_id]]'''&lt;br /&gt;
:: sets the font to render your label.  There are 12 different fonts from 5&amp;amp;mdash;16.  Numbers 15 and 16 are special for unicode.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_font_id, 12&amp;lt;/source&amp;gt;. See the [[label_font_id]] page for explicit examples on how to use unicode characters in PyMOL labels.&lt;br /&gt;
'''[[label_size]]'''&lt;br /&gt;
:: sets the size of the text.  You can use positive numbers 2, 3, 4, etc for point sizes, or negative numbers for Angstrom-based sizes. Default is 14 points. Labels in Angstrom-size scale with the distance from the front plane, labels in point-size don't.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_size, -2  #results in a size of 2 Angstroms&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_digits]]'''&lt;br /&gt;
:: sets the number of decimals in label. It affects all digits only if label_distance_digits or label_dihedral_digits or label_angle_digits are set to -1.&lt;br /&gt;
'''[[label_outline_color]]'''&lt;br /&gt;
:: each label is outlined (so you can do white-on-white labels, for example).  This options sets the color of the label outline.  Eg. &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_outline_color, orange&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_dihedral_digits]]'''&lt;br /&gt;
:: sets the number of decimals in dihedral label.&lt;br /&gt;
'''[[label_position]]'''&lt;br /&gt;
:: sets any offset from the original X,Y,Z coordinates for the label.  If you like to use the mouse, you can enter [[edit_mode]] and '''ctrl-middle-click''' to drag labels around; '''ctrl-shift-left_click''' will let you move the labels in the z-direction. '''&amp;quot;Save labels&amp;quot;-workaround''' If you want to save the position of your labels, the best way might be to create a new object and move the atoms in this object. Since the labels are positioned from the atom positions this is an indirect way of moving the labels and being able to save them.&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#1.&lt;br /&gt;
# make a very simple label on the 14th alpha carbon.&lt;br /&gt;
label n. CA and i. 14, &amp;quot;This is carbon 14.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#2.&lt;br /&gt;
# make a fake scene label; use this to label entire scenes, not just atoms/bonds.&lt;br /&gt;
pseudoatom foo&lt;br /&gt;
label foo, &amp;quot;Once upon a time...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#3.&lt;br /&gt;
# make a huge label&lt;br /&gt;
set label_size, -5&lt;br /&gt;
pseudoatom foo&lt;br /&gt;
label foo, &amp;quot;This is large text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#4. Partial Charge&lt;br /&gt;
label (chain A),chain&lt;br /&gt;
label (n;ca),&amp;quot;%s-%s&amp;quot; % (resn,resi)&lt;br /&gt;
label (resi 200),&amp;quot;%1.3f&amp;quot; % partial_charge&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#5. The gallery image above Label_ex.png was created with this code&lt;br /&gt;
#   and finally, some labels were moved around in '''edit_mode'''.&lt;br /&gt;
label (resi 200),&amp;quot;%1.3f&amp;quot; % b&lt;br /&gt;
set label_font_id, 10&lt;br /&gt;
set label_size, 10&lt;br /&gt;
&lt;br /&gt;
#6. This example shows how to label a selection with the &lt;br /&gt;
#   XYZ coordinates of the atoms &lt;br /&gt;
from pymol import stored&lt;br /&gt;
stored.pos = []&lt;br /&gt;
# select the carbon atoms in my hetero atoms to label&lt;br /&gt;
select nn, het and e. C&lt;br /&gt;
# get the XYZ coordinates and put htem into stored.pos&lt;br /&gt;
iterate_state 1, (nn), stored.pos.append((x,y,z))&lt;br /&gt;
# label all N atoms.  You need the pop() function or else&lt;br /&gt;
# PyMOL will complain b/c you didn't provide enough coords.&lt;br /&gt;
label nn, (&amp;quot;%5.5s, %5.5s, %5.5s&amp;quot;) %  stored.pos.pop()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= User Comments =&lt;br /&gt;
==Labels Using ID Numbers==&lt;br /&gt;
The following commnent,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label SELECTION, &amp;quot; %s&amp;quot; % ID &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
labels the SELECTION with atom ID numbers.&lt;br /&gt;
&lt;br /&gt;
You can make more complicated selections/lables such as&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label SELECTION, &amp;quot; %s:%s %s&amp;quot; % (resi, resn, name)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
which will give you something like &amp;quot;GLU:139 CG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Labels Using One Letter Abbreviations==&lt;br /&gt;
* First, Add this to your $HOME/.pymolrc  file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# start $HOME/.pymolrc modification&lt;br /&gt;
one_letter ={'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \&lt;br /&gt;
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y',    \&lt;br /&gt;
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A',    \&lt;br /&gt;
'GLY':'G', 'PRO':'P', 'CYS':'C'}&lt;br /&gt;
# end modification&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Second, instead of:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label n. ca, resn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
use:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label n. ca, one_letter[resn]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or: ( to get something like D85)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label n. ca, &amp;quot;%s%s&amp;quot; %(one_letter[resn],resi)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Labels Using One Letter Abbreviations==&lt;br /&gt;
If You have a weak video card, You might want to set&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set defer_builds_mode, 5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It helps a lot but breaks labels rendering. You can use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set defer_builds_mode, 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
instead.&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
[[:Category:Labeling]]&lt;br /&gt;
&lt;br /&gt;
All the settings posted above.&lt;br /&gt;
&lt;br /&gt;
[[Category:Labeling|Label]]&lt;br /&gt;
[[Category:Commands|Label]]&lt;/div&gt;</summary>
		<author><name>BorisKheyfets</name></author>
	</entry>
</feed>