Introduction to PyMOL
Queen's University Protein Function Discovery
and Department of Biomedical and Molecular Sciences
Molecular Modelling and Crystallographic Computing Facility
Crystallography and Modelling:

Introduction to PyMOL

PyMOL is a molecular graphics program that can be freely downloaded and installed on Windows or Linux PCs as well as Apple computers running MAC OSX and other UNIX-based systems. The PyMOL web site is at You can download a free "legacy" version from, but I have a more up to date version for educational use only that you can get via the Moodle site for BCHM315. Installation is straightforward:
Standalone PyMOL binaries for Windows provide the easiest (one-step) installation, although I use Debian GNU/Linux or Ubuntu for all my work (PyMOL is available directly from the Debian and Ubuntu repositories).
  1. Download the PyMOL installer file.
  2. Install PyMOL by clicking on "Setup.exe".
  3. PyMOL can now be launched from the Start Menu.
For the BCHM442 class, anyone who has trouble or does not wish to install this on his or her computer, may use a laptop in the Bracken Library elab or may come talk to me to use one of our lab computers for the assignment.

A good introduction to PyMOL can be found at the Pymol WIKI and a more thorough introduction can be found in this tutorial.

  1. After installing PyMOL, start it up and you should see a window that looks like this (all the figures on this page link to larger images):

  2. I prefer a white background, especially for making figures for presentations so change this using the Display -> Background -> White menu items.

  3. If you know the PDB ID of the structure you wish to look at, then the easiest way to load it into PyMOL is via the Plugin menu. Choose the PDB Loader Service and enter the PDB code for the structure you wish to download from the RCSB (Protein Data Bank:

    Alternatively you can type "fetch 1xuu" in the command bar to download and display the structure of "1xuu" or you can search the PDB directly. You can see my very brief introduction to the Protein Data Bank, but you are better off just visiting the PDB at and trying out its search function. If you wish more detailed information about using the PDB, you can click on the "Launch Help System" menu item near the bottom left corner of the PDB menu. There is also a tutorial at (OpenHelix has many bioinformatics tutorials.)
  4. After entering the code, you will see your structure displayed with all bonds drawn as lines and any non-bonded atoms (like waters and metal ions) drawn as red crosses:

  5. In order to get a much simpler view of the structure, left-click (and hold the mouse button down) on the H (meaning "Hide") in the graphic menu on the right for the row labelled (all):

    and move down and select "everything"

  6. Then left-click on the S (meaning "Show") in the row labelled with your PDB code (1xuu) in this case and select cartoon. You should now see a ribbon representation of your structure:

  7. You can move your structure around with the mouse:
    • Press and hold the left button to rotate
    • Press and hold the middle button to translate in the plane of the screen
    • Press and hold the right button to translate into and out of the screen
    • Mouse scroll-wheel (if you have one) to adjust the depth-cueing and clipping planes
    The mouse functions are described in the bottom right corner of the graphic window:

    If you find that the object names are too long to fit within the side panel, just drag the border into the viewing area (see circled tab in the image below):

  8. If, as is the case with this structure, you only see one polypeptide chain drawn on the screen, you may need to use the crystallographic symmetry to generate the other chain of the dimer.

    In this case, try typing the command (in the PyMOL Viewer Window):

    symexp sym, 1xuu, 1xuu, 2.5
  9. You'll now see one or more new objects listed in the graphic menu on the right-hand side.

    If you see too many objects, you can turn on and off the display of the objects by clicking on the grey bar containing the object name:

  10. To make it easier to distinguish the objects, try changing their colours. Click and hold on the "C" next to your object name whose colour you wish to change and you'll see a new menu appear:

    Try selecting "by chain" and you'll see a new menu to the left appear. You can then select "by chain" to get each polypeptide chain in a different colour.
  11. Another way of obtaining a structure of the multimer is via the RCSB PDB web site
  12. After selecting colours and moving the object around to get the view you want, you can save a "png" format graphic image (directly importable into PowerPoint) using the File -> Save Image... menu item

    or by typing the command:
    png 1xuu.png
    This will save a file called "1xuu.png". Alternatively to get a higher quality image, pick the button at the top right of the separate GUI window labelled Ray.

    This will perform a ray-tracing operation to generate a high-quality image complete with shadows. Then use the same image save operation to save a copy of this image for import into your favourite presentation or word processing software or to put on a web page.
  13. You can save your current state with PyMOL by choosing the File -> Save Session... menu item and entering some meaningful name. You can then reload this session into PyMOL at a later time.
  14. If you wish to colour parts of your structure one colour and other parts a different colour, you can use the command line and the residue numbers (and possibly the chain identifier) like this:
    color red, 1xuu & chain a & resi 275-285
    Alternatively, you can "Ctrl-middle-click" on two atoms in the structure and you'll see (pkfrag) appear in the right hand object list. You can then colour that selection with the colour selection tool on that line, or type the command:
    color red, pkfrag
    "Ctrl-middle-click" on the background will clear the pick-list
  15. If you want to get into more complicated uses of PyMOL you may wish to consult my script repository. Note that in order to use any of these scripts you must first use the run command with the name of the python script file:
    and then the commands in that script are available for use within PyMOL
    color_b 1xuu & chain a, gradient=gy, mode=ramp