Audience for this tutorial:
This tutorial assumes that you are using a windows OS (although
most of the information would be applicable for other operating systems)
and that you have no problems installing the software required. The
tutorial becomes more advanced so you can skim over what is easily understood
(though there may be some good points raised) until you find what is interesting.
What is PyMOL and where to find it:
PyMOL is a free, open-source tool to visualize
molecules and the homepage is located at
PyMOL Sourceforge homepage.
For the Windows system, the first part to install is the Python
program which is necessary to run PyMOL and then to install PyMOL.
These programs are found on the
PyMOL
project file list page. Download the required programs and install them
(I won't get into which versions). Assuming these first steps are done correctly,
PyMOL should be ready to use.
Data files and script files:
PyMOL reads in molecular coordinates from a .pdb file and
these files can be found at sites such as the
Protein Data Bank. After loading
in a pdb file, it can be manipulated in PyMOL from either the menu's or
from the command line. For creating images it is best to work using the
command line so that your image can be reproduced exactly each time and
to store the commands in a script file. In this manner, you can alter the
script, reload your image and avoid having to type in all the commands
over and over again or remember what menu options you used. Script
files are very easy to use and are simple text files and can be created
and edited using a program such as notepad.
Example molecule and script file:
To see this example, download the pdb file
1KMY.pdb and the associated script file
1KMYsetup.pml and place them directly on c:
(if you want to change this, it can easily be done but for this
example to work without editing they must both be on c:). The pdb file
describe the crystal structure of a two-domain metalloenzyme that contains
non-heme ferrous iron. This enzyme is involved in the degradation of PCB
metabolites. This specific file is the crystal structure of an enzyme-substrate
complex. The substrate is dihydroxybiphenyl and it is directly ligated
to the iron atom via it's two hydroxyl oxygen atoms.
Open up PyMOL and in the PyMOL viewer window (the black window with
the prompt PyMOL> as seen below) type "load c:\1KMY.pdb" (no quotes)
and hit return. This will load the molecule directly and it can be manipulated
from either the command line or using any of the menus. While this is
a good way to play with the molecule, this tutorial will be focused on
using the scripts so to do this first the image must be cleared. Enter
the command "delete all" to remove everything. To load the script, type
"@c:\1KMYsetup.pml" (the @ symbol specifies a script). The script loads
the molecule and performs all the operations specified in the script file.
When working on a molecule it is a good idea to have the script file and
PyMOL open at the same time so that you can switch between the two. After
making changes to the script, delete all in PyMOL and reload the script.
These previously typed commands can be easily accessed in PyMOL by using
the up arrow. In this manner, you can cycle through all previously typed
commands. To view the manuplated parts of the molecule better, it can
be rotated around on the screen by left clicking and dragging on the image.
If you right click and drag, you can zoom in and out of the image.
After loading the image, and with some rotating you
should see something that looks like this:
You can see that as compared to the original file,
the script has changed some colours and highlighted the iron and
the iron ligands.
Discussion of the example script file with extra info:
The script that performed these operations (which can be
viewed by opening the text file in notepad) are:
load c:\1KMY.pdb,main
hide all
show cartoon, all
#colour the structure and mark the iron ligands and iron
color orange
color marine, (resi 1:134)
show spheres, (elem Fe)
color pink, (elem Fe)
show sticks, (elem Fe)
show sticks, (resi 300)
color yellow, (resi 300)
show sticks, (resi 260,210,146)
color blue, (resi 260,210,146)
Going step by step through the code:
load c:\1KMY.pdb,main
hide all
These lines first load the pdb file 1KMY.pdb and call it
main (this name is for easier reference in the script file). Then,
the line 'hide all' hides everything giving you a fresh screen to work
with.
"Show cartoon all" shows in cartoon format the protein structure
giving you the familiar ribbon and helix shape which are specified
in the pdb file. If the secondary structure assignments have not been
made, PyMOL can perform this for you
but it is slow and not recommended
and certainly not for publication. To have PyMOL perform the assignments
add the command "util.ss all" before "show cartoon, all". This secondary
structure assignment takes a few extra seconds.
To create comments, add the # symbol before the text and
PyMOL will ignore everything after the symbol on that line. This is
an easy way to test removing lines of code without actually deleting
them.
The next section of code colour and change the shape of
certain residues and elements. "Color orange" will colour the entire
molecule orange (it could also be written as "color orange, all").
Then the next line "color marine, (resi 1:134) will colour marine all
the residues from 1 to 134 (inclusive). To figure out the residue
number, you can look in the pdb file or you can select the residue and
check to see what PyMOL calls it (more on this later). "Show spheres,
(elem Fe)" shows in the form of a sphere all the Fe elements in the
figure (in this figure, there is only one). "Show sticks, (elem Fe)"
and "show sticks, (resi 300)" both work similar to show spheres only they
draw the molecules in a stick format. To work with a number of residues
in one command, separate the individuals with a comma as in "color blue,
(resi 260,210,146)".