<?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=Andrejoseph</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=Andrejoseph"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Andrejoseph"/>
	<updated>2026-05-16T15:40:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Set_toggle&amp;diff=10062</id>
		<title>Set toggle</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Set_toggle&amp;diff=10062"/>
		<updated>2011-07-14T15:25:11Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview == &lt;br /&gt;
[[Set_toggle]] binds a key to switch on and off a setting.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set_toggle key, setting&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Set_Key]] to find a list of key that can be redefined and [[Settings]] to find a list of settings. You can also use auto-completion.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Associates &amp;quot;F1&amp;quot; to grid_mode setting&lt;br /&gt;
set_toggle F1, grid_mode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# @AUTHOR: Joseph ANDRE&lt;br /&gt;
# Copyright (c) 2011, Joseph ANDRE&lt;br /&gt;
# All rights reserved.&lt;br /&gt;
#&lt;br /&gt;
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following&lt;br /&gt;
# conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following&lt;br /&gt;
#     * disclaimer.&lt;br /&gt;
#     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following&lt;br /&gt;
#     * disclaimer in the documentation and/or other materials provided with the distribution.&lt;br /&gt;
#     * Neither the name of the &amp;lt;ORGANIZATION&amp;gt; nor the names of its contributors may be used to endorse or promote products derived&lt;br /&gt;
#     * from this software without specific prior written permission.&lt;br /&gt;
#&lt;br /&gt;
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT&lt;br /&gt;
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL&lt;br /&gt;
# THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES&lt;br /&gt;
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS&lt;br /&gt;
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE&lt;br /&gt;
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#&lt;br /&gt;
# DATE  : 2011-07-14&lt;br /&gt;
# REV   : 1&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
&lt;br /&gt;
def toggle(setting=[]):&lt;br /&gt;
	setting_value=cmd.get(setting)&lt;br /&gt;
	if cmd.toggle_dict.get(setting_value, 0):&lt;br /&gt;
		cmd.unset(setting)&lt;br /&gt;
	else:&lt;br /&gt;
		cmd.set(setting)&lt;br /&gt;
&lt;br /&gt;
def set_toggle(key, setting):&lt;br /&gt;
	cmd.set_key(key, toggle, [setting])&lt;br /&gt;
&lt;br /&gt;
cmd.auto_arg[1].update({&lt;br /&gt;
   'set_toggle'         : cmd.auto_arg[0]['set'],&lt;br /&gt;
})&lt;br /&gt;
	&lt;br /&gt;
cmd.extend('set_toggle', set_toggle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
[[Set_Key ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library|Set_toggle]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;/div&gt;</summary>
		<author><name>Andrejoseph</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Set_toggle&amp;diff=10061</id>
		<title>Set toggle</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Set_toggle&amp;diff=10061"/>
		<updated>2011-07-14T15:19:24Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview == &lt;br /&gt;
[[Set_toggle]] binds a key to switch on and off a setting.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set_toggle key, setting&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Set_Key]] to find a list of key that can be redefined and [[Settings]] to find a list of settings.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Associates &amp;quot;F1&amp;quot; to grid_mode setting&lt;br /&gt;
set_toggle F1, grid_mode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# @AUTHOR: Joseph ANDRE&lt;br /&gt;
# Copyright (c) 2011, Joseph ANDRE&lt;br /&gt;
# All rights reserved.&lt;br /&gt;
#&lt;br /&gt;
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following&lt;br /&gt;
# conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following&lt;br /&gt;
#     * disclaimer.&lt;br /&gt;
#     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following&lt;br /&gt;
#     * disclaimer in the documentation and/or other materials provided with the distribution.&lt;br /&gt;
#     * Neither the name of the &amp;lt;ORGANIZATION&amp;gt; nor the names of its contributors may be used to endorse or promote products derived&lt;br /&gt;
#     * from this software without specific prior written permission.&lt;br /&gt;
#&lt;br /&gt;
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT&lt;br /&gt;
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL&lt;br /&gt;
# THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES&lt;br /&gt;
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS&lt;br /&gt;
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE&lt;br /&gt;
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#&lt;br /&gt;
# DATE  : 2011-07-14&lt;br /&gt;
# REV   : 1&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
&lt;br /&gt;
def toggle(setting=[]):&lt;br /&gt;
	setting_value=cmd.get(setting)&lt;br /&gt;
	if cmd.toggle_dict.get(setting_value, 0):&lt;br /&gt;
		cmd.unset(setting)&lt;br /&gt;
	else:&lt;br /&gt;
		cmd.set(setting)&lt;br /&gt;
&lt;br /&gt;
def set_toggle(key, setting):&lt;br /&gt;
	cmd.set_key(key, toggle, [setting])&lt;br /&gt;
&lt;br /&gt;
cmd.auto_arg[1].update({&lt;br /&gt;
   'set_toggle'         : cmd.auto_arg[0]['set'],&lt;br /&gt;
})&lt;br /&gt;
	&lt;br /&gt;
cmd.extend('set_toggle', set_toggle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
[[Set_Key ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library|Set_toggle]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;/div&gt;</summary>
		<author><name>Andrejoseph</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Set_toggle&amp;diff=10060</id>
		<title>Set toggle</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Set_toggle&amp;diff=10060"/>
		<updated>2011-07-14T12:08:10Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: Created page with &amp;quot;== Overview ==  Set_toggle binds a key to switch on and off a setting.  == Syntax == &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt; set_toggle key, setting &amp;lt;/source&amp;gt;  See Set_Key to find a list ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview == &lt;br /&gt;
[[Set_toggle]] binds a key to switch on and off a setting.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set_toggle key, setting&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Set_Key]] to find a list of key that can be redefined and [[Settings]] to find a list of settings.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Associates &amp;quot;F1&amp;quot; to grid_mode setting&lt;br /&gt;
set_toggle F1, grid_mode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# @AUTHOR: Joseph ANDRE&lt;br /&gt;
# Copyright (c) 2011, Joseph ANDRE&lt;br /&gt;
# All rights reserved.&lt;br /&gt;
#&lt;br /&gt;
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following&lt;br /&gt;
# conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following&lt;br /&gt;
#     * disclaimer.&lt;br /&gt;
#     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following&lt;br /&gt;
#     * disclaimer in the documentation and/or other materials provided with the distribution.&lt;br /&gt;
#     * Neither the name of the &amp;lt;ORGANIZATION&amp;gt; nor the names of its contributors may be used to endorse or promote products derived&lt;br /&gt;
#     * from this software without specific prior written permission.&lt;br /&gt;
#&lt;br /&gt;
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT&lt;br /&gt;
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL&lt;br /&gt;
# THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES&lt;br /&gt;
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS&lt;br /&gt;
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE&lt;br /&gt;
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#&lt;br /&gt;
# DATE  : 2011-07-14&lt;br /&gt;
# REV   : 1&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
def toggle(setting=[]):&lt;br /&gt;
	setting_value=cmd.get(setting)&lt;br /&gt;
	if setting_value.isdigit():&lt;br /&gt;
		if int(setting_value) == 1:&lt;br /&gt;
			cmd.set(setting,&amp;quot;0&amp;quot;)&lt;br /&gt;
		else :&lt;br /&gt;
			cmd.set(setting,&amp;quot;1&amp;quot;)&lt;br /&gt;
	elif setting_value.isalpha():&lt;br /&gt;
		if setting_value == &amp;quot;on&amp;quot;:&lt;br /&gt;
			cmd.set(setting,&amp;quot;off&amp;quot;)&lt;br /&gt;
		else :&lt;br /&gt;
			cmd.set(setting,&amp;quot;on&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
def set_toggle(key, setting):&lt;br /&gt;
	global sett&lt;br /&gt;
	sett = [setting]&lt;br /&gt;
	cmd.set_key(key, toggle, sett)&lt;br /&gt;
&lt;br /&gt;
cmd.extend('set_toggle', set_toggle)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
[[Set_Key ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library|Set_toggle]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;/div&gt;</summary>
		<author><name>Andrejoseph</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Andrejoseph&amp;diff=2996</id>
		<title>User:Andrejoseph</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Andrejoseph&amp;diff=2996"/>
		<updated>2011-06-24T09:32:29Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: Created page with &amp;quot;My name is Joseph ANDRE. I'm Ph.D student in molecular modelling on tubulin.  I use PyMOL to produce figures and analyse molecular dynamics trajectories.  = My ~/.pymolrc = &amp;lt;sour...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name is Joseph ANDRE. I'm Ph.D student in molecular modelling on tubulin.&lt;br /&gt;
&lt;br /&gt;
I use PyMOL to produce figures and analyse molecular dynamics trajectories.&lt;br /&gt;
&lt;br /&gt;
= My ~/.pymolrc =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# SYSTEM&lt;br /&gt;
set fetch_path, /home/joseph/Documents/structure/&lt;br /&gt;
&lt;br /&gt;
# GUI&lt;br /&gt;
set internal_gui_mode, 0&lt;br /&gt;
set bg_rgb, [0.3,0.3,0.3]&lt;br /&gt;
viewport 1400,600&lt;br /&gt;
set overlay, 4&lt;br /&gt;
set orthoscopic,1&lt;br /&gt;
set seq_view_label_spacing, 10&lt;br /&gt;
set seq_view_label_start, 10&lt;br /&gt;
&lt;br /&gt;
# STYLE&lt;br /&gt;
set valence, 1&lt;br /&gt;
set stick_radius,0.1&lt;br /&gt;
color grey90, element C&lt;br /&gt;
set spec_power, -1&lt;br /&gt;
set spec_reflect, 0.05&lt;br /&gt;
set ambient, 0.1&lt;br /&gt;
## CARTOON&lt;br /&gt;
set cartoon_fancy_helices,1&lt;br /&gt;
set cartoon_loop_radius,0.1&lt;br /&gt;
set cartoon_dumbbell_radius,0.1&lt;br /&gt;
set cartoon_dumbbell_width, 0.08&lt;br /&gt;
set cartoon_highlight_color, grey40&lt;br /&gt;
set cartoon_dumbbell_length, 1.2&lt;br /&gt;
set cartoon_rect_width,0.08&lt;br /&gt;
set cartoon_rect_length, 1.2&lt;br /&gt;
set cartoon_color, grey80, ss L&lt;br /&gt;
set cartoon_color, orange, ss H&lt;br /&gt;
set cartoon_color, deepteal, ss S&lt;br /&gt;
set cartoon_discrete_colors, 1&lt;br /&gt;
&lt;br /&gt;
# SCRIPTS&lt;br /&gt;
&lt;br /&gt;
# ALIASES&lt;br /&gt;
alias hide_lines_nonpolar_h, hide lines, e. H and neighbor e. C&lt;br /&gt;
alias hide_sticks_nonpolar_h, hide sticks, e. H and neighbor e. C&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrejoseph</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Label&amp;diff=13846</id>
		<title>Label</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Label&amp;diff=13846"/>
		<updated>2009-07-24T13:53:49Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Pl.png|right|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
The [[Label]] command controls how PyMOL draws text labels for PyMOL objects.  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&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;&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 sizes for Angstrom-based sizes: A 2Ang font woukld then be -2.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_size, -2&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 beeing 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;
=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>Andrejoseph</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Label&amp;diff=13845</id>
		<title>Label</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Label&amp;diff=13845"/>
		<updated>2009-07-24T13:44:35Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Pl.png|right|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
The [[Label]] command controls how PyMOL draws text labels for PyMOL objects.  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&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;
:: defines the number of decimals in angle label&lt;br /&gt;
'''[[label_distance_digits]]'''&lt;br /&gt;
:: defines 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;&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 sizes for Angstrom-based sizes: A 2Ang font woukld then be -2.  Eg: &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_size, -2&amp;lt;/source&amp;gt;&lt;br /&gt;
'''[[label_digits]]'''&lt;br /&gt;
:: (no idea)&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;
:: (no idea)&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 beeing 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;
=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>Andrejoseph</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Selection_Algebra&amp;diff=8770</id>
		<title>Selection Algebra</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Selection_Algebra&amp;diff=8770"/>
		<updated>2007-12-07T10:32:07Z</updated>

		<summary type="html">&lt;p&gt;Andrejoseph: /* Selection Operator/Modifier Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Selection Algebra==&lt;br /&gt;
===Intro===&lt;br /&gt;
Selections can be made more precise or inclusive by combining them with logical operators, including the boolean '''and''', '''or''', and '''not'''. The boolean '''and''' selects only those items that have both (or all) of the named properties, and the boolean '''or''' selects items that have either (or any) of them. Venn diagrams show that '''and ''' selects the areas of overlap, while '''or''' selects both areas. &lt;br /&gt;
&lt;br /&gt;
http://pymol.sourceforge.net/newman/user/S0220venn.jpg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Selection Operator/Modifier Table===&lt;br /&gt;
Selection operators and modifiers are listed below. The dummy variables ''s1'' and ''s2'' stand for selection-expressions such as &amp;quot;chain a&amp;quot; or &amp;quot;hydro.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;TABLE BORDER=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TH ALIGN=&amp;quot;CENTER&amp;quot; WIDTH=&amp;quot;100&amp;quot;&amp;gt;Operator&amp;lt;/TH&amp;gt;&amp;lt;TH&amp;gt;Short form&amp;lt;/TH&amp;gt;&lt;br /&gt;
&amp;lt;TH&amp;gt;Effect&amp;lt;/TH&amp;gt;&lt;br /&gt;
&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;not&amp;lt;I&amp;gt;s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;!&amp;lt;I&amp;gt;s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD&amp;gt;Selects atoms that are not included in &amp;lt;I&amp;gt;s&amp;lt;/I&amp;gt;1&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select sidechains, ! bb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 and&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 &amp;amp;amp;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD&amp;gt;Selects atoms included in both&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 and&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select far_bb, bb &amp;amp;amp;farfrm_ten&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 or&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 |&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects atoms included in either&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 or&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select all_prot, bb | sidechain&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects atoms in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 whose&lt;br /&gt;
 identifiers name, resi, resn, chain and segi &amp;lt;strong&amp;gt;&amp;lt;u&amp;gt;all&amp;lt;/u&amp;gt;&amp;lt;/strong&amp;gt; match atoms in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select same_atms, pept in prot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 like&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 l.&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects atoms in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 whose identifiers name and resi match atoms in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select similar_atms, pept like prot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 gap&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 gap&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects all atoms whose van der Waals radii are separated from the van der Waals radii of&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 by a minimum of&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt; Angstroms.&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select farfrm_ten, resi 10 gap 5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 around&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 a.&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects atoms with centers within&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt; Angstroms of the center of any atom in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select near_ten, resi 10 around 5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 expand&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 e.&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Expands&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 by all atoms within&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt; Angstroms of the center of any atom in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select near_ten_x, near10 expand 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 within X of&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;amp;nbsp;&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 w. X of&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&amp;amp;nbsp;&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects atoms in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 that are within X Angstroms of the&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;2&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select bbnearten, bb w. 4 of resi 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;byres&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;br.&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Expands selection to complete residues&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select complete_res, br. bbnear10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;byobject&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;bo.&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Expands selection to complete objects&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select near_obj, bo. near_res&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;neighbor&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&lt;br /&gt;
&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;nbr.&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Selects atoms directly bonded to&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select vicinos, neighbor resi 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;TR&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 extend&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;TD ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 ?&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Extends&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1 by&amp;lt;I&amp;gt; X&amp;lt;/I&amp;gt; bonds connected to atom in&amp;lt;I&amp;gt; s&amp;lt;/I&amp;gt;1&lt;br /&gt;
&amp;lt;pre&amp;gt;PyMOL&amp;gt; select connect_x, near10 extend 3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;
&amp;lt;/TABLE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
Logical selections can be combined. For example, you might select atoms that are part of chain a, but not residue number 125:&lt;br /&gt;
      &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   PyMOL&amp;gt; select chain a and (not resi 125)      # selects atoms that are part of&lt;br /&gt;
                                                 # chain a, but not &lt;br /&gt;
                                                 # residue number 125.&lt;br /&gt;
&lt;br /&gt;
   PyMOL&amp;gt; select (name cb or name cg1 or name cg2) and chain A    # These two &lt;br /&gt;
                                                                  # selections are &lt;br /&gt;
   PyMOL&amp;gt; select name cb+cg1+cg2 and chain A                      # equivalent.&lt;br /&gt;
                                                                  # select c-beta's,&lt;br /&gt;
                                                                  # c-gamma-1's and &lt;br /&gt;
                                                                  # c-gamma-2's &lt;br /&gt;
                                                                  # that are &lt;br /&gt;
                                                                  # in chain A.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the results of groups of arithmetic operations, the results of groups of logical operations depend on which operation is performed first. They have an order of precedence. To ensure that the operations are performed in the order you have in mind, use parentheses:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;   byres ((chain a or (chain b and (not resi 125))) around 5) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PyMOL will expand its logical selection out from the innermost parentheses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Selector Quick Reference]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Selecting|Selection Algebra]]&lt;/div&gt;</summary>
		<author><name>Andrejoseph</name></author>
	</entry>
</feed>