introduction to pymol
introduction to pymol
Introduction to PyMOL
Copyright Notice
This Tutorial is Copyright (C) 2009 DeLano Scientific LLC. All Rights Reserved. Unauthorized reproduction or
dissemination is prohibited under United States and international copyright laws. "Introduction to PyMOL" is a
PyMOL Incentive Product created for the exclusive use of PyMOL Subscribers who sponsor the effort financially.
Unrestricted distribution of this material could jeopardize the financial integrity of the PyMOL project, so please DO
NOT POST THIS DOCUMENT IN AN INSECURE OR PUBLICLY ACCESSIBLE LOCATION. Current PyMOL
Subscribers may only distribute copies of this tutorial internally to users within their organization who are covered
by the scope of the subscription. If you come into possession of an inappropriate copy of this document, please ei-
ther delete it or contact [email protected] to purchase an appropriate PyMOL Subscription.
2
Introduction to PyMOL
Table of Contents
Introduction 4
About this Booklet 4
Getting Started 4
Mouse Controls 8
Features 11
Visualization Presets 11
Saving Images 12
Taking Measurements: Distances, Angles, Dihedrals, and Neighbors 13
PyMOL Sessions 14
Sequence Viewer 16
Representations and Selections 17
Scenes and Shows 19
Creating Movies 20
Working with Multiple Objects and Selections 21
Alignments 22
Next Steps 29
Other Courses 29
Joining the PyMOL−Users Mailing List 29
Visiting the PyMOLWiki Community Web Site 29
Accessing the Official Documentation Site 29
3
Introduction to PyMOL
Introduction
About this Booklet
Welcome
This is a follow-along guide for the Introduction to PyMOL classroom tutorial taught by DeLano Scientific, LLC. It
covers the basics of PyMOL for medicinal chemists and other industrial scientists, including visualization of protein-
ligand interactions, creating figures, and working with session files.
This tutorial was created for PyMOL version 1.2 or greater running under Windows, Mac, or Linux.
Typographic Conventions
Words typeset in Courier font, such as extend, are commands that can be typed directly into a PyMOL command
line. Keystroke modifier keys are typeset in upper case, where CTRL, ALT, ESC, SHIFT, are “control,” “alt”, “es-
cape,” and “shift,” respectively. The mouse buttons are shown as upper case letters in Courier font, where LEFT,
MID, WHEEL, RIGHT, are the left mouse button, middle mouse button, wheel, and right mouse button, respec-
tively. The word DRAG indicates that a mouse button should be pressed and held while the mouse is moved. For ex-
ample, CTRL-MID-DRAG indicates the user should press and hold the control key, then press and hold the middle
mouse button, and drag the mouse with the control key and middle mouse button held down. Menu navigation is
shown in bold Times font as Menu→SubMenu→... For example, File→Save Image As...→PNG indicates that the
user should click on the File menu, choose the Save Image As submenu, and finally choose PNG, from the submenu.
Getting Started
Requirements
Before starting this tutorial, please ensure that you have the following.
4
Introduction to PyMOL
Please load the structure file 1t46.pdb from disk. To do this, click on the Upper Control Window and choose
File→Open. Then, from the PyMOLTutorials/IntroductionToPyMOL folder on your desktop, please select the
file named 1t46.pdb. Your PyMOL should now look like Figure 2, except that the initial colors may be different.
Figure 1: PyMOL immediately after being Figure 2. Kinase protein, PDB ID 1t46, loaded into
launched on a Windows PC. PyMOL on a Mac.
At this time, please take a moment to familiarize yourself with the behavior of the mouse in PyMOL. Place your
mouse cursor over the protein. Now, press and hold while moving the mouse—aka dragging—with each of the
mouse buttons in turn. As Figure 3 shows, dragging with the left mouse button rotates the scene in the Display;
dragging with the middle mouse button moves the molecule in the plane of the display; and dragging with the right
mouse button zooms in and out.
Don’t worry if you get lost. Just click the Reset button in the Upper Control Window to restore the original view.
5
Introduction to PyMOL
Try It—Using the Viewer Window: Entering Commands and Using the Object
Menu Panel
Please click in the Display Area. Now, press the ESC key. Your command history and other information is shown
here. Press ESC to return to the normal viewing mode. This feature pro-
vides a quick way of viewing PyMOL’s text output. If the Viewer Window
is selected as you type, what you input will appear in the lower command
line.
Type orient and hit enter. The molecule in your scene should now be
oriented, that is, displayed with the longest axis aligned with the x-axis.
Now, please type reset and hit enter. This does the same thing as click-
ing on the Reset button in the Upper Control Window.
Please find the Object Menu Panel in the upper right of the Viewer Win-
dow. An example Object Menu is shown in Figure 5. Here, you’ll see a
list of names. The objects whose names appear with light grey back-
grounds are active, and may appear in the Display Area. Click on the
name to deactivate, or disable, the object, and it will be hidden from view.
Figure 5: Example Object Menu Panel.
Your Object Menu should have entries for all and 1t46, and maybe some- Kinases is a group in which there are five
thing like (sele). Please click on 1t46. This disables it. Click again to re- kinase proteins; kinase2, a protein, is dis-
enable it. abled, all other kinases are enabled. Pro-
teins 1cll and 1ggz are objects. (sele) is a
Each of the five Pop-up Menus, is accessed by clicking on a disabled selection. We will discuss groups,
letter. A→Actions contains lots of preset actions; S→Show allows us to objects and selections later.
6
Introduction to PyMOL
Mouse Modes
Many different tasks can be performed using the mouse inside of PyMOL, through a variety of mouse modes. Each
mouse mode just reassigns the mouse buttons to perform different tasks. PyMOL’s Viewing Mode is used primarily
used to view, rotate, translate, and change the representations of objects. Editing Mode is used to rotate bonds, re-
place atoms, physically move atoms and residues, etc. The mouse mode table for each of these modes is shown, in
Figures 6a and 6b.
Figure 6a: 3-Button Viewing Mode. Figure 6b: 3-Button Editing Mode.
Click the Mouse Mode table to enable 3-Button Viewing and locate the word Selecting, colored green, as shown in
Figure 6a. The red word to the right of Selecting tells which Selecting mode the mouse is in. Clicking on the word
Selecting changes the selection mode. The first mode is Residues, which means that, when we click on any atom
with the mouse in the Display Area, the entire residue in which that atom resides is selected.Other selection modes
are Molecules, which forces PyMOL to select the entire molecule containing the chosen atom; Chains, which will
choose the chain in which the selected residue resides; Objects, which selects the entire object containing the cho-
sen atom; C-alphas, the alpha carbon of the residue for the chosen atom; and Segments which chooses segments,
which are special fields in a PDB file. Keep clicking to cycle through the options until you return to Residues. When
in 3-Button Editing Mode, the word Selecting is replaced with Picking and the mouse is used to pick Atoms which
represent Joints in the molecular graph.
7
Introduction to PyMOL
This one is different from the other in that it will accept pasted text, and you can copy from it. The history and diag-
nostics window is where PyMOL feedback will be shown. For example, if you wanted to calculate the distance be-
tween alpha carbons number 10 and 11 you could type distance 10/CA, 11/CA and the answer would show
up in the window.
Please take a moment to find the following buttons: Reset, Ray, and Builder. As you know Reset restores the origi-
nal orientation of the molecule. Ray is a very frequently used command for making beautiful publication quality
images. We will talk about the Ray command later on. PyMOL has a built-in Builder for building smallmolecule
fragments and peptides. Please click on the Builder button to switch to builder mode (MacPyMOL doesn’t have the
builder, but you can access it by launching MacPyMOL in the PyMOLX11Hybrid mode). The Builder is discussed
in our Advanced Tutorials. Please click on Builder again to enable the default buttons.
Mouse Controls
Many different tasks are performed using the mouse in PyMOL. There is much to learn, but remember you can al-
ways rely on the Mouse Mode table if you get lost. Producing figures that look just right often takes some skilled
mousing. So, let’s continue with the mouse.
Getting Started
A three-button mouse is required for this tutorial, although PyMOL can support other types of mice to a lesser ex-
tent. And, please take note that when using a three-button wheel mouse, there is a difference between clicking the
wheel button and scrolling it up and down. If your mouse click turns on pink squares or small white globes, as in
Figure 8, then you can always turn these off by Left-clicking on a blank part of the Display Area. Lastly,
please make sure you Caps Lock key is not turned on.
8
Introduction to PyMOL
Fig. 8: If you click in the PyMOL Display Area without dragging, you may cause pink boxes (left) or white
globes (right) to appear. For now, just left-click in a blank area to hide them.
Trackball Mode
By default, PyMOL enables the mouse in what is called Trackball Mode. This mode allows us to make precise and
sophisticated motions with the mouse. In this mode, if you click and drag through the center of the screen to rotate
(left image of Figure 9), the scene rotates on an axis parallel to the plane of the screen. However, if you choose a
point on one of the far edges of the Display Area and drag along the edge, the molecule rotates along an axis per-
pendicular to the plane of the screen (like spinning a top; right image of Figure 9).
Figure 9: (Left) Trackball rotations when the mouse passes through the center of the screen; (right) trackball rotations when
the mouse moves along the outer edges of the screen.
9
Introduction to PyMOL
Try It—Centering
When we click—not scroll, but push down—and quickly release the middle mouse button while the cursor is over
an atom, PyMOL will place that atom at the center of the screen. This represents a convenient way to roam around
the protein focusing only on certain atoms. Please give this a try: MID-click from atom to atom in your molecule
to roam around the structure.
Clipping
Before we move on, please click Reset to restore the original view of the molecule. (And, if you are using Win-
dows or Linux, please click on the Viewer Window because we want to work in the Display Area some more.)
Now, using the scroll wheel on the mouse, scroll down, towards yourself. Parts of the molecule should disappear.
Scroll up, away from yourself, and those portions should now reappear. What you are doing is controlling Clipping
in PyMOL. Clipping is a way to focus in on a certain area of the protein while hiding everything else from view.
PyMOL has a near clipping plane and a far clipping plane. The space between those two clipping planes is called the
Clipping Slab. Objects within the clipping slab are visible. Everything outside of the clipping slab is hidden.
PyMOL allows you move the clipping slab while keeping the molecule steady with SHIFT-Scroll. Give it a
shot: when you hold down SHIFT on your keyboard and scroll the wheel on your mouse, parts of the molecule
should appear and disappear, depending on the position of the clipping slab. PyMOL allows you also to move the
molecule and keep the clipping slab steady with CTRL-Scroll. Please try this mode and compare it to the other.
If scrolling to adjust the clipping planes is too coarse, then PyMOL also allows us to SHIFT-RIGHT-drag to
more finely tune the clipping planes. SHIFT-RIGHT-dragUp/Down controls the near clipping plane; and,
SHIFT-RIGHT-dragLeft/Right controls the far clipping plane. If you drag diagonally from the upper right to
lower left corner of the Display Area, you move the clipping plane with respect to the objects. If, however, you drag
diagonally from the upper left to lower right corner, you set the width of the clipping slab.
Well, that’s it for the tour of PyMOL’s Layout and basic mouse usage. Now, let’s check out the some basic features
and common tasks that make your life easier.
10
Introduction to PyMOL
Features
Visualization Presets
Introducing Visualization Presets
The A→Action→Preset→Ligand Sites sub- Figure 11: Menu of visualization pre-sets built into PyMOL.
menu opens to show more refined options,
which render beautiful views of the ligand bind-
ing site as a surface. Please try the various visualization presets on this protein.
Please take a few moments to try each of the presets and consider which might be best suited for your applications.
Before moving on, please choose the A→Action→Preset→Publication preset.
11
Introduction to PyMOL
Saving Images
Once your display is set up, choose File→Save Image As→PNG. PNG, or Portable Network Graphic, is a popular
lossless compressed image format for publishing. PNG files can be read by Microsoft PowerPoint, Microsoft Word,
and many other programs. To save a ray traced image press the Ray button before selecting File→Save Image
As→PNG.
Figure 13: Images insert easily into PowerPoint, Word and other applications. The image at left was ray traced with a transparent
background, and so the title and subtitle in PowerPoint show through. The image at the right was ray traced with an opaque white
background, and so while the text is still there in PowerPoint it is now hidden underneath the white background.
12
Introduction to PyMOL
Lastly, you can use the clipboard to copy images into Figure 14: Zoomed in on a PHE residue.
PowerPoint if you have PyMOL for Windows or
MacPyMOL. Simply setup the scene you want, then
from the Upper Control Window menu choose Edit→Copy to copy the image to the clipboard. Now, in PowerPoint
choose Edit→Copy (or type CTRL-v) to paste the image from computer memory.
13
Introduction to PyMOL
Figure 16: The A common use of the measurement wizard is to create a dashed line between two atoms. To do
hide menu. this, make your measurement and then, on the Pop-up Menu for the measurement object, hide the
label with H→Hide→Labels (see Figure 16). Mistakes in the Measurement Wizard can be reme-
died by choosing Delete Last Object, or by deleting the last measurement object choosing A→Action→Delete, in
the row of the measurement object you wish to delete.
PyMOL Sessions
PyMOL allows you to save your work as a PyMOL Session. Sessions store all of your objects, selections, views,
scenes, representations, etc. This is a good way to save your work for later or share it with others. To create a
PyMOL Session, just click File→Save Session
As and then supply a file name. PyMOL ses-
sions end in .pse. If you’re in a PyMOL session
and want to overwrite a saved .pse file, choose
File→Save Session. When saving a PyMOL
Session, please do not quit the program until
your receive a confirmation that PyMOL has
successfully written your session file. If you
quit without waiting, then your work may not
be saved.
14
Introduction to PyMOL
If you work in a pharmaceutical or biotech company, there may be computational chemists, crystallographers, or
even automated systems that will prepare PyMOL sessions for you. Such prepared sessions are generally accessed
via file servers, database systems, or your intranet. If such a system doesn’t yet exist, consider asking your structural
biologist and computational chemist colleagues about making PyMOL session files available to you.
In the Display Area you can see the structure of Phosphoinositide−Dependent Kinase 1 (PDK1) complexed with the
inhibitor Staurosporine. The structure you are viewing is Protein Data Bank (PDB) structure 1OKY. If you click on
the (+) button next to 1OKY, you see that all four active objects in the Viewer Window start with the prefix 1OKY,
and are contained in a group called 1OKY. Groups
allow you to collect objects under one common name
for better organization. Open groups are prefixed with
minus sign (-) and closed groups are prefixed with a
plus sign (+). Try turning the 1OKY objects on and off
individually. The displays of the protein, the inhibitor,
the solvent, and hydrogen bonds can each be enabled
and disabled independently by clicking on the object
names. Also note that you can click and drag downward
over the object names to toggle display of multiple ob-
jects at once.
Note that there are four atom selections listed at the top of the Upper Control Window: (inhibs), (prots), (solvs), and
(sites). Clicking on its name will activate or deactivate a selection. These selections are useful for changing the way
various groups of atoms are represented across all complexes in the session. For example, the (sites) atom selection
can be used to selectively display a transparent molecular surface on each protein’s active site. To do this, first dis-
able all but one of the protein objects, for example, 1T46.prt (V−Kit). Then select S→Show→Surface, next to the
(sites) selection. A molecular surface will appear on the 1T46.prt object. If you enable the other 1T46 objects, you
can middle click to center and scroll to move the clipping plane to visualize Gleevec inside its binding pocket (see
Figure 18). To remove the surfaces, simply H→Hide→Surface for the (sites) selection. Likewise, you can use the
(inhibs) selection to change how the inhibitors are displayed. For example, try showing spheres for the (inhibs) se-
lection in order to obtain a space−filling view of the inhibitors. Although the input PDB files used to create this ses-
sion did not contain bond valence information, PyMOL will generally attempt to guess bond valences for unknown
residues. To display those bond valences, select Display→Show Valences from the Upper Control Window. Fig-
15
Introduction to PyMOL
Figure 19: Bond valences are now shown on Gleevec (left). A custom representation of the kinase binding pocket, filled
with ADP shown as a surface (right).
ure 19 (left) shows bond valences turned on, and the binding pocket as a surface turned off (right). You can always
use a session file such as this as a starting point for your own customized figures. If you get lost or make a mistake,
you can start over by quitting PyMOL and reopening the original session. Please spend some more time with this
session file until you feel quite comfortable with it.
Sequence Viewer
Using the Sequence Viewer
PyMOL’s sequence viewer, shown in Figure 20, is turned off by default. Please find the S below the mouse mode
table and click it. You can also turn on the sequence viewer by going to Display→Sequence from the Upper Control
Window. You should now have the amino acid sequence of your protein in the familiar one-letter codes. The se-
quence viewer can be used to select residues. Using the left mouse button, please select and drag out a rectangle of
residues in the sequence viewer. The residues selected will be indicated by small purple boxes in the Viewer Win-
dow. Now, try right-clicking on the selected residues in the Sequence Viewer. Notice that a context sensitive pop-up
menu appears. This menu gives you access to a variety of options for this selection.
16
Introduction to PyMOL
Figure 20: Example of using the sequence viewer in PyMOL. Left-click drag to select residues; right
click to open up menus for those residues. The purple dots represent those residues selected from the
sequence viewer. The menus appeared after a left-click on the selected residues in the sequence.
17
Introduction to PyMOL
Please note that the Surface and Mesh representations can take a long time to generate for large molecules. Try
S→Show→As→Surface to see your protein as a surface.
The Show and Hide commands operate on the entire molecule. But, many times when working with molecular
structures, we wish to show some portion of the structure in one representation (eg. the ligand as sticks) and then
show another portion in another representation (eg. the binding pocket as a surface). Well, we can do that in PyMOL
using Selections.
Understanding Selections
Selections in PyMOL are just sets of atoms that you define, and do not have any properties of their own other than a
name. Selection names appear in the viewer window surrounded by parentheses, as in (sele), to distinguish them
from objects. Objects are proteins, molecules, and other entities in PyMOL’s memory, whereas selections are just
listings of atoms in those objects. You can turn selection indicators on and off by clicking their names in the Viewer
Window just as you do for objects, except that only one selection can be turned on, or enabled, at a time. Atoms in
enabled selections are shown in the Display Area with purple boxes over their atom centers. To deselect atoms when
in viewing mode, just left click away from any atoms in the Display Area, click the selection name, or click Deselect
in the Upper Control Window.
18
Introduction to PyMOL
Let’s try a few actions with selections. First, let’s select all the waters and delete them. To do this, turn on the Se-
quence Viewer and then scroll to the end of the sequence. Select all the O residues by left clicking and dragging with
the mouse. Remember mouse selections are additive so, to select all the waters you can, slide the rest into the
Viewer using the grey slider box under the sequence, and then select those, too. Once you’ve selected all of the wa-
ters, please remove them by selecting A→Action→Remove Atoms, for the selection (sele). Please also delete the
selection we made earlier called myFirstSelection. (Hint: an easier way
to remove waters is to select A→Action→Remove Waters.)
Let’s show the ligand as spheres, select it, and then color it ‘wheat.’
Start by selecting S→Show→Organic→Spheres for 1t46. Now, please
find the ligand in your structure. Using the mouse select it and rename
the selection to “myLigand”. Once that is done, please select
S→Show→As→Spheres, and then C→Color→Tints→Wheat, for
this selection.
Here’s a hint: look at the menus shown in Figure 23. Menu options that have a grey border to the right or left, such
as actions, colors, and show, will open up a sub-menu. Those menu items with a solid blue border, such as zoom,
orient, center, do not—clicking on them will perform the given action.
19
Introduction to PyMOL
As this demonstrates, to create a scene we start by positioning molecules, coloring them, setting their representations
and getting the screen to look exactly as desired. Then, to store the scene and assign it a name, we click Sce-
ne→Append in the Upper Control Window. PyMOL automatically assigns a name to the Scene, which we need to
refer to it (eg. “001”). And, now that two or more scenes have been defined, we can switch between them with
Scene→Previous/Next.
Please use Scene→Previous now to return to the first scene. If you prefer, you can also use the Page Down (Pg-
Dn) and Page Up (PgUp) keys to advance forward or retreat backward through the sequence of scenes. Also note
that pressing CTRL−PgDn will insert a new scene after the current one, and CTRL−PgUp will insert a new scene
before the current one.
Creating Movies
Introduction
Movies tell stories better than static images, but complex movies can be difficult and time-consuming to create.
Here, we cover the absolute basics. DeLano Scientific will soon offer additional tutorials focused on intermediate
and advanced moviemaking.
Please find the Movie menu in the Upper Control Window. Take a moment to scan through all the options and sub-
menus.
Movie→Append will add a given number of seconds to a movie, but will not program any content for the new time.
Movie→Program will program a given movie task for a new time of a given duration. PyMOL comes with some
pre-programmed animations. Just select Movie→Program and then choose from Camera Loop, Scene Loop, State
Loop or State Sweep. Camera loops are animations in which the camera pans around a given scenein a rocking,
rolling or combined motion. This is a nice way to visualize a pocket or a simple structure. Other camera loops are x-
rock, x-roll, y-rock and y-roll. A roll is a complete 360 degree rotation about a given axis. A rock is a back-and-forth
20
Introduction to PyMOL
rocking motion. If your movie gets too long, or is not what you want, just select Movie→Reset from the Upper
Control Window.
Before moving on, please clear any movies you have made by selecting Movie→Reset from the Upper Control
Window. Also, please disable all objects except for the first two proteins, 1OKY.prt and 1Z5M.prt.
Figure 24: Grid mode turned off (left) and on (right), where each protein receives its own grid
slot.
Provided that your computer has enough memory and processing power, PyMOL can be used to simultaneously
visualize dozens of structures or more. Structures can be loaded from the File menu one at a time, or if you multiple-
select, many at a time. Alternatively, one can use a script to load multiple files using the load command (or the
fetch command, which loads structures directly from the PDB given appropriate PDB identifiers). Last, if you’re
launching PyMOL from the command line, you can provide file names there—and even use wildcards. For example,
you may type pymol myPDBs/*.pdb to load all the PDB files in the directory named myPDBs.
21
Introduction to PyMOL
Alignments
Sequence Based
PyMOL can perform sequence-driven structure alignment through
the A→Action→Align menu, shown in Figure 25. You can align
all proteins to a currently selected one (A→Action→Align→All
to this), or align proteins one by one (A→Action→Align→To
Molecule). Finer control over the alignment process can be exer-
cised by creating selections that represent the two regions to be
aligned. In this case, one selection (e.g. sel01) should be created in
the target molecule and a second independent selection (e.g. sel02)
should be created in the molecule to be aligned. Then for selection
sel02, you click on the A→Action→Align→To Selection→sel01
to perform a superposition based on only those two regions.
Alignments performed using the A→Action menu are based on a
protein sequence alignment followed by an interactive structure
superposition, and only the CA atom positions are considered.
Greatest control over alignment can be exercised by typing an
align command in the command line. For example, the kinase
structure 1uwh actually contains two copies of the enzyme, chains
A and B, whereas 1t46 only contains one copy. The default align-
ment of 1t46 and 1uwh matches only the 1uwh B chain. To force
alignment of 1t46 against the "A" chain of 1uwh, type the follow-
ing command: align 1t46////CA, 1uwh//A//CA. This
command uses selection macros, which are discussed in the Figure 25: To perform a structure alignment, choose
Advanced Features at the end of this tutorial. PyMOL comes A→Action→Align, as shown in this screenshot.
with a more robust alignment command called super. Use
super if align doesn’t do so well.
22
Introduction to PyMOL
Figure 26: (Left) Thin-slab view of two proteins ready to be fitted. (Right) The red lines shown paired atoms from the two struc-
tures. The goal is to optimally pair and align those atoms to maximize structural overlap.
Please note: to fit atoms you must identify exactly the same number of atoms in one object to fit to the other. Also, no
spaces are allowed inside selection macros.
23
Introduction to PyMOL
To edit bond valences on a Windows PC, please click on the Builder button in Upper Control Window. Next,
CTRL−Right-click to pick the bond whose valence you wish to change. You should see a white band appear
about the bond as in Figure 28. Please cycle through the available bond valences by clicking on the Cycle button in
the Builder area of the Upper Control Window, or by pressing CTRL−W on your keyboard. Once you have set the
correct valence for that bond, you can CTRL−right−click to select the next bond to fix, continuing until all va-
lences have been fixed. Note that PyMOL adds missing hydrogens to the atoms involved in the bond. If hydrogens
are not desired, use A→Actions→Remove Hydrogens for the object, after correcting all of the bond valences.
Figure 28: Cycling valences. First, select the bond with CTRL-right-click. Then type cycle_valence at the command line
or click Cycle in the Builder. Notice the automatic addition of hydrogens. If they are not desired, you can remove them after
setting the valence.
24
Introduction to PyMOL
Now that we know how to make more advanced labels, let’s learn how to customize them using PyMOLs options
for labels. This requires using the set command at the command line.
Label Color
You can set label_color in PyMOL to any valid PyMOL color, for example by typing: set label_color,
blue. Colors can be valid PyMOL color names, found in the color menus for each object or selection. Label Size
You can change the size of the label with set label_size, nSize, where nSize is a number representing
the size of the label. If nSize is positive then the label is rendered at a size of n points (72 points/inch). However if
nSize is less than 0, it is converted to the absolute value and the label is rendered in that many Angstroms. For
example, to render a 14 point font, set label_size, 14; to set labels to be 2 Angstroms (big), set la-
bel_size, -2.
Label Position
In Editing Mode, you can CTRL-Left-drag labels around your scene. Use CTRL-Right-drag to move the
label toward or away from the camera. This is a useful feature as many time a surface or structural feature
will hide a label.
25
Introduction to PyMOL
Saving Coordinates
PyMOL has a limited ability to write out coordinates for input into other programs. The interchange file formats
supported are: PDB (Protein Data Bank), MOL (MDL MOL-file), and MMD (Macromodel). PyMOL can also save
molecules in an internal PKL (Pickle) file format, which is able to preserve all of the molecular information, includ-
ing bond valences and atomic properties, something none of the other file formats do well. To save a molecule, first
make sure that the atoms you wish to save are contained in either a distinct object or are pointed to by a named se-
lection. Then choose File→Save Molecule..., pick the name of the object or selection in the next window, and enter
the filename. Add the correct file name extension is appended to the file name (e.g. ".pdb"), and then click Save.
Probing Electrostatics
Quantitative electrostatics calculations are typically difficult and time-consuming to perform. They require the spe-
cialist skills of a computational chemist to carefully consider missing protein segments and side chain atoms, histi-
dine ionization, and the presence of specific counter-ions from bulk solvent. Furthermore, calculations involving
ligands usually require high-level quantum calculations to obtain reasonable atomic partial charges for novel scaf-
folds. Assuming that such issues have been addressed, PyMOL can call upon the Adaptive Poisson-Boltzmann
Solver (APBS) under a Unix environment to perform quantitative electrostatic calculations. The program can also
read pre-calculated potentials from the Grasp, Delphi, or Zap electrostatics solvers.
In lieu of rigorous calculations, a simple, local (but technically incomplete), quasi-Coulombic calculation can often
help answer the qualitative question, "Is this region of the protein surface likely to be positive, negative, or neutral
relative to the rest of the protein?" PyMOL provides such answers for proteins by performing an automated calcula-
tion that amounts to smoothing out the local charge density from nearby atoms (within 10 β ngstroms), without tak-
ing into account solvent screening effects. To perform this calculation, select Actions→generate→vacuum electro-
statics→protein contact potential. After a minute or two, PyMOL will create a new object with the protein shown
as an electrostatic surface colored blue in the positive regions and red the negative regions. You can then CTRL
−click−and−drag along the slider to change the color levels.
26
Introduction to PyMOL
To run a script, select File→Run, or type "@" followed by the file name path into a command line. The following
example PyMOL command script contains six commands that color and represent the target and ligand in a standard
way. To use a different input structure with this script, you would just update the first command in the file with a
new PDB filename.
27
Introduction to PyMOL
Figure 29: Rotating torsion bonds. Right side of the bond is Figure 30: Similar to Figure 30, but left side of the bond is
selected (left image); and molecule is modified by rotating the selected (left image), and the white cuff indicates this fact, as
torsion bond with CTRL-LeftDrag (right image). Notice it is located on the left half of the bond. (Right image) Mole-
that the white cuff is on the right half of the bond. This indi- cule shown after slight rotation. The right side of the mole-
cates that the right side of the bond will be rotated. The left cule is unchanged.
side is unchanged. Compare this to Figure 30.
28