Molecular Visualization with PyMol

In this session, you will utilize Pymol to view and interrogate biomolecular structures. This program is freely available for Microsoft Windows, Mac OSX, Linux, and UNIX-based computer operating systems. From home (or your home lab), you may download the PyMol structure viewer from the PyMol website:http://pymol.org/

PyMol menu commands will be designated as Button -> button -> button .

PyMol command line commands are indicated after this prompt- PyMol>

In addition to this handout, you can find answers to your questions from the built-in help system and the PyMol wiki page. If you like, you can also look at this quick Reference Sheet for PyMOL: pymolQR.pdf

Section A. Viewing CaM crystal structure

1. Load the PDB file for calmodulin (1CLL)

Calmodulin is a protein involved in the transduction of important intracellular calcium ion signals. We will compare a calcium-bound crystal structure and a calcium-free NMR structure. Open a terminal program, and start the program when prompted, loading the crystal structure:

pymol /home/momokurs/rosetta_workshop/tutorials/day02/sample_files/1CLL.pdb

Pymol is a bigger, newer, and slower program than e.g. Rasmol, so expect it to take a minute to start. Note that there are two windows; the graphical display, and a TCL/TK GUI containing menus, shortcuts, and a text console showing the program's text output. You can enter commands into the command line of either window.

  1. all->S->Show cartoon Look for the small, square, one-letter buttons in the top-right corner of the viewing window to perform (A)ctions, (S)how, (H)ide, (L)abel, and (C)olor the associated objects

  2. 1CLL->H->Hide lines to simplify the display

  3. all->H->Hide waters temporarily remove the waters

  4. 1CLL->C->Color->by ss emphasize secondary structure elements

Compare other coloring schemes, including spectrum (B-factor) and spectrum (rainbow).

  1. Rotate the structure with the left mouse button (button 1)

  2. Translate the structure with the middle mouse button (button 2)

  3. Zoom in on the structure with the right mouse (button 3)

PyMol will be setup in mono viewing mode. If you wish to use stereo viewing (highly recommended), select Display -> Stereo. You can switch between modes with Display -> Stereo Mode to use either cross-eyed (convergent) or wall-eyed (divergent). Stereo-capable graphics cards and/or special glasses are needed for the other modes.


2. Highlight details of the Calcium binding site

  1. PyMol> select calciums, CA/ This is the syntax for specifying atoms by type: Calcium. It simultaneously creates a "selection group" that shows up in the right-hand list, named "calciums"

  2. (calciums)->S->Show spheres to display space-filling Ca2+ ions

  3. PyMol> select loops, (all within 7 of calciums) and not calciums This creates another selection group.

  4. (loops)->S->Show->sticks to display the important residues in the calcium-binding loops

  5. Click the small S button in the bottom right corner to activate the sequence viewer and note that the highlighted residues in the sequence, and also in the scrollbar, include much more than just the chelating residues

  6. Click on the background to clear the selection

  7. Zoom in on the first calcium and select (single click on) five of the chelating residues. Note the highlighting in the sequence viewer, and in its scrollbar. You can click with the middle button (or scrollwheel) to center rotation on the calcium.

  8. (sele)->C->grays->white to remove the colors from the current selection

  9. (sele)->C->by element->_HNOS to color the heteroatoms with the standard CMYK colors

  10. Display->Background->White

  11. Orient the molecule to show the view clearly.

  12. PyMol> ray This generates a ray-traced view which is much nicer than the default view, but which reverts as soon as you rotate the molecule.

  13. File->Save Session->CaMloop.pse to save the session for future work.

Section B. Comparing X-ray vs. NMR structures

Here we will compare structures generated by different techniques, and learn to perform a structural alignment.

1. Load the NMR structure

Start by loading the file.

  1. File -> Reinitialize

  2. File -> Open -> ~/rosetta_workshop/tutorials/day02/sample_files/1DMO.pdb

If you watched the text window, you saw that 30 models were loaded. NMR protein structures are typically reported using multiple models that all fit the experimental restraints. Also notice that the hydrogens are displayed in this model. This is particularly evident if you do: all->S->Show as->spheres

  1. all->S->Show as->cartoon

  2. File -> Open -> ~/rosetta_workshop/tutorials/day02/sample_files/1CLL.pdb

  3. 1CLL>S->show as->cartoon

The two structures are difficult to compare, because of the different orientations. We can improve that by overlaying them.

2. Overlay the two structures

  1. PyMol> align 1CLL,1DMO 
    This performs a sequence alignment, and then attempts to overlay them in space. It doesn't work very well here, because the calcium-free NMR structure exhibits great flexibility in the middle of the central helix. But we can improve this. (Use the Reset button in the TCL/Tk GUI if you need to re-center & zoom the molecules).

  2. PyMol> select n_dmo, resi 1-76 and 1DMO

  3. PyMol>

    select n_cll, resi 1-76 and 1CLL

  4. PyMol> align n_dmo, n_cll This aligns just the n-terminal domains.

This initially looks worse, but we can now animate the calcium-free structure, because it's an ensemble: press the play button (right-pointing triangle) near the bottom right corner. The display is too fast, so use Movie->Frame Rate->5fps to slow it down. You can monitor which frame is displayed using the line immediately above the play button, and examine individual ones. Note that you can freely interact with the models, changing zoom, rotation, display, etc., while the movie is playing.

3. Improving the overlay by improving the selection

An even better structural alignment could be done by superimposing just residues from helices 1 and 4 of 1DMO with the corresponding residues of 1CLL. This will emphasize the difference between the “open” Ca2+-bound state, and the “closed” Ca2+-free state. See if you can perform the alignment using the helix definitions from the pdb file, and the selection syntax found here:

http://pymol.sourceforge.net/newman/user/S0220commands.html

Compare your solution to the one found in the example script here:

/home/momokurs/rosetta_workshop/tutorials/day02/sample_files/alignCaM.pml

Later Addition: Note that newer versions of PyMOL have added newer algorithms that do a better job of structural alignment. Replace the align command above with cealign or super to get better results. See pymolwiki.org for details on these improvements. In addition, for proteins that are very distantly related, it may be necessary to perform the structural alignment using a tool such as dali to do the alignment. You can use the webserver here: ekhidna.biocenter.helsinki.fi/dali_server/start

Section C. Visualizing DNA structures

The techniques learned so far apply equally well to DNA structures.

1. View the DNA-ligand structure

  1. Plugin -> PDB Loader Service -> enter “1DSM” Note the molecule of Duocarmycin SA (DSA) bound in the minor groove of the 10-mer.

  2. 1DSM->S-> show-> surface Then click on the DSA molecule to select it. (sele) ->S-> show-> sticks

    This is a nice quick view, but suppose you want the reverse: DNA as sticks with the ligand as surface. That requires some manual work, because the surface command works on ATOMS, not HETATMs.

  3. Save the molecule into your working directory as 1DSM.pdb and quit pymol.

2. Customizing the view

  1. Edit the pdbfile using 'vim 1DSM.pdb' in a terminal. Change all the HETATM records to ATOM records with the following command (type the colon to enter command mode): 
    ':%s/HETATM/ATOM  /g
    Note the two spaces after ATOM to preserve column alignment. Save the file ':w 1dsm_atoms.pdb'.

  2. Open the new 1dsm_atoms.pdb file in pymol, and create convenient selections by typing the following commands:

    1. select chainA, chain A Then, color this chain by element with cyan carbons and show sticks.

    2. select chainB, chain B Then, color this chain by element with green carbons and show sticks.

    3. select DSA, resi 23

  3. (DSA)->A-> extract object This converts the selection into an object to be surfaced.

  4. (obj01)->S->Show-> surface Then Setting->Transparency->Surface-> 20%

  5. Save the pymol session for future work.

3. Further exploration

Whenever working with Pymol, it can be useful to have a web browser opened to either the manual at the sourceforge.net site (mentioned above) or the pymolwiki.org site. Take a look at each of these for future reference. One fun and informative thing to do in Pymol is to explore the demonstration. Go to wizard->demo->representations, then click on each of the demonstrations on the right.

Finally, there is a sample script available for you in  ~/rosetta_workshop/tutorials/day02/sample_files/startup.pml. This is intended as a useful starting point for visualizing any macromolecular system, as well as for generating publication-quality figures. Open it with a text editor such as nedit or vim, and note the commands used to customize the view, and to create “selection objects” that make it easier to manipulate elements of the structure during the session. Feel free to copy this script to your home directory. Add (or uncomment) selection elements that pertain to your molecule of interest, for example, to highlight the most important residues for catalysis, ligand binding, etc. The skill of using these scripts will substantially increase your productivity in molecular visualization tasks.