PyMOL Schrödinger
13th European User Group Meeting
Basel, September 23rd-25th, 2013

Workshop: PyMOL – 3D visualization and presentation

Part 1: Basic Introduction


pretty.png

Making a nice ray-traced figure

In this exercise we learn how to save a transparent PNG image that can be used for printing or for PowerPoint presentations.

  1. External window menu: File > Open > Desktop/3_PyMOL/1rx1.pdb, or type:
    load ~/Desktop/3_PyMOL/1rx1.pdb
  2. Object menu panel: A > preset > pretty
  3. External window menu: Display > Background > white, or type:
    bg_color white
  4. External window menu: Display > Background > Opaque (uncheck), or type:
    unset opaque_background
  5. External window: hit Ray button, or type:
    ray
  6. External window: File > Save Image As > PNG..., or type:
    png ~/Desktop/3_PyMOL/pretty.png
  7. Advanced: Save image with specific size and DPI resolution:
    png ~/Desktop/3_PyMOL/pretty.png, width=10cm, dpi=300, ray=1

Distance measurement

Using the Measurement Wizard

In this exercise we measure the size of a protein by measuring the distance between two atoms.

  1. Download (a.k.a. fetch) a PDB structure by typing:
    fetch 1rx1
  2. External window: hit Orient button, or type:
    orient
  3. External window menu: Wizard > Measurement
  4. Now pick the left-most and the right-most atoms with the left mouse button

Part 2: Volume Visualization


Electron density

Visualizing Electron Density as Volume

In this exercise we download an electron density map from the electron density server and visualize it with a multi-colored volume.

  1. Fetch a Ubiquitin structure and electron density map from the PDB/EDS:
    fetch 1ubq
    fetch 1ubq, type=2fofc
    
  2. Object menu panel: 1ubq_2fofc > A > volume > default
  3. Now the Volume button on the external window became active, click on it. On the graph, drag the colored dots and click on the graph to add new colors, until it looks similar to the next figure:

  1. Have a look at a phenylalanine residue, either using the sequence viewer, or by typing:
    zoom byres first resn PHE
  2. Use your mouse to explore the density, center on atoms with middle-click. Adjust the clipping slab by scrolling the mouse wheel. Pay attention to the high density of backbone oxygens, nicely highlighted by our color gradient.

Electrostatics

Visualizing Electrostatic Potential as Volume

In this exercise we calculate an electrostatic potential and visualize it with a symmetric blue-red colored volume.

  1. fetch 1rx1 (as in Part 1)
  2. Object menu panel: 1rx1 > A > generate > vacuum electrostatics
  3. Object menu panel: 1rx1_e_map > A > volume > default
  4. Volume Panel, make symmetric red+blue ramp.

Part 3: Movie Making


Morphing

Morphing

In this exercise we generate an interpolated morph between two conformations to visualize conformational change.

  1. Load two conformations of adenylate kinase:
    fetch 1akeA 4akeA
  2. Superpose the two structures, either from the object menu panel with A > align > to molecule, or by typing:
    align 1akeA, 4akeA
  3. Now create a morph with A > generate > morph > to molecule, or by typing:
    morph morph01, 1akeA, 4akeA
  4. You get a new 30-state object named morph01. We want to create one of the simples movies from that, playing the states back and forth.
  5. In the external window menu, got to Movie > Program > State Sweep > Full Speed > no pause or type:
    mset 1-30 30-1
  6. Hit the play button.

Scene based movie

In this exercise we define several scenes and turn those into a movie.

  1. fetch 1rx1 and show with preset > pretty (like in Part 1)
  2. External window menu: Scene > Append, or type:
    scene new, store
  3. External window menu: Scene > Buttons, or type:
    set scene_buttons
    A scene button will appear in the lower left corner.
  4. Bring Ligand into focus:
    Object menu panel: 1rx1 > A > generate > selection > organic
    Object menu panel: (1rx1_organic) > A > orient
  5. Do again: Scene > Append
  6. Show ligand interactions:
    Object menu panel: (1rx1_organic) > A > find > polar contacts > to any excluding solvent
    Object menu panel: 1rx1 > S > lines
  7. Do again: Scene > Append
  8. Show binding pocket as surface:
    Object menu panel: 1rx1 > S > surface
    Object menu panel: 1rx1 > C > by rep > surface > grays > gray50
  9. Rotate the view using the mouse to nicely look into the pocket, then do again: Scene > Append
  10. External window menu: Movie > Program > Scene Loop > Steady > 1 second each

Part 4: Scripting

Create a pymolrc startup script for PyMOL customization

On Windows: Start > Run and then paste    On Unix, Linux, Mac OS X: Open a terminal and type
notepad "%HOMEDRIVE%%HOMEPATH%\pymolrc.pml"
nano ~/.pymolrc

A text editor will open with an empty file. Now copy and paste the following into the editor.

# proof of concept: change background color
bg blue

# some nice settings
set seq_view
set scene_buttons

# add a custom python function as new command nice and bind to F1 key
python
def nice(selection="all"):
    cmd.color("atomic", "(%s) and not elem C" % selection)
    cmd.show_as("cartoon", selection)
    cmd.show("sticks", "(%s) and organic" % selection)
    cmd.show("spheres", "(%s) and inorganic" % selection)
cmd.extend("nice", nice)
cmd.set_key("F1", nice)
python end

# end of pymolrc file

Save the file and launch PyMOL. You should see a blue background. Fetch PDB 1rx1 (as in Part 1) and hit the F1 key, this should show a nice cartoon with ligand representation. You should also see the sequence viewer by default.

Install and use a plugin with the Plugin Manager

We want to install the bbPlane command from the PyMOLWiki, which can visualize peptide bonds:

http://pymolwiki.org/index.php/bbPlane

Launch PyMOL. In the external window menu, go to Plugin > Plugin Manager > Install New Plugin. Copy and paste the given URL to the Install from PyMOLWiki field and hit Fetch. After confirming the popup messages, the plugin can be used.

Fetch some PDB (as in Part 1), and type into the PyMOL command line:

bbPlane

You should see rectangular planes along the protein backbone.