PyMOL is a powerful and versatile program for molecular graphics, based on the C and Python programming languages (which you don't need to know in order to use the program!), and with an easy-to-use Tcl/Tk-based GUI. It can be run interactively (using menu-driven commands and options) or via input scripts/macros, but most efficiently by a combination of both approaches. Some PyMOL examples are illustrated here in the form of input macros (.pml files) and their corresponding graphical outputs (.png files). These examples barely scrape the surface of what PyMOL is capable of -- one can nest PyMOL macros within macros, use the PyMOL API to write customized Python modules that automate routine tasks and enable new functionalities, make animations such as the ones below (or above!), etc.… As an example, the animated "Cams PyMOL Page" logo at the top of this page was produced via a Python script that utilizes PyMOL's Compiled Graphics Objects (CGO; see below).

To get started with the examples below:


^ PyMOL Examples:
[Windows users may experience problems viewing full-size thumbnails due to incompatibilies between Internet Explorer, XHTML frames, and JavaScript. If so, click here for a non-frames version of this page, but note that the non-frames version may not be as current as this one (compare the "Page last touched" fields). Also note that this problem does not occur with Mozilla Firefox.]
Task Input files (click on filename) Output (click on thumbnail or text link)
[Ribbon diagrams!] The crystal structure of Pyrobaculum aerophilum (Pae) SurEα reveals a dimer in the asymmetric unit of a P3121 cell. We want a simple ribbon diagram of the dimer, as viewed down the NCS 2-fold. PaeSurE_simple_ribbons.pml
[PyMOL script file with some descriptive comments]
PaeSurE_dimer.pdb
[PDB file in which SeMet's have been changed to MET, because I was too lazy to have PyMOL properly deal with METs]
[PaeSurE_simple_ribbons.png]
PaeSurE_simple_ribbons.png
[Surfaces!] The crystal structure of Pyrobaculum aerophilum (Pae) SmAP1 reveals a heptamer in the asymmetric unit of a C2221 cell. A 14-mer is created by one of the crystallographic 2-folds. We want to display a ribbon diagram of the 14-mer, clearly illustrating the surface area that's buried in the heptamer···heptamer interface. PaeSmAP1_14mer_interface.pml
[PyMOL script file with lots of descriptive comments]
gpa14mer_buriedsurface.pdb
[PDB-formatted file with modified B-factors that describe whether the atom is part of the interface (B>1.0) or not (B=0.0)] PaeSmAP1_14mer_buried_surface.CNS.inp
[CNS input file to produce the above PDB file with atomic B-factors assigned to 0.0 or 1.0]
[PaeSmAP1_14mer_interface.png]
PaeSmAP1_14mer_interface.png
[Ribbons, spheres, etc.!] The crystal structure of Methanobacterium thermautotropicum (Mth) SmAP1 reveals a 14-mer in the asymmetric unit of a P21 cell. Several ligands (such as UMP, MPD, etc.) are bound to this 14-mer. We want to display a ribbon diagram of the 14-mer viewed down the 7-fold axis, illustrating the protein as ribbons and the ligands as color-coded CPK spheres. MthSmAP1_ribbons_and_ligands.pml
[PyMOL script file]
mth_p21.pdb
[PDB file for final, refined structure]
[MthSmAP1_ribbons_and_ligands.png]
MthSmAP1_ribbons_and_ligands.png
[Electron densities!] The crystal structure of Pyrobaculum aerophilum (Pae) SurEα reveals a dimer in the asymmetric unit of a P3121 cell. We want a figure of two types of electron density, centered on Ser99 from chain 'B': {2Fo-Fc,Φcalc} electron density and experimentally-phased (MAD) density maps {FMAD; Φcalc}. One PyMOL script produces both maps as separate panels (overlaying them in one panel is messy). PaeSurE_densities_Ser99.pml
[PyMOL script file with some descriptive comments]
PaeSurE_fordensity.pdb
[PDB file in which SeMet's have been changed to MET, because I was too lazy to have PyMOL properly deal with METs]
dm_phex20_ncs.xplor
[XPLOR map file calculated with experimental/MAD phases]
map2fofc_nonds.xplor
[XPLOR 2Fo-Fc map calculated from model phases]
ElectronDensities.tgz
[tarball of all files for this example]
[PaeSurE_2fofc_Ser99.png]
PaeSurE_2fofc_Ser99.png
[PaeSurE_Fobs_Ser99.png]
PaeSurE_Fobs_Ser99.png
[Ligands, distances, etc.!] The crystal structure of Mth SmAP1 reveals a 14-mer in the asymmetric unit of a P21) cell. Several ligands (such as UMP, MPD, etc.) are bound to this 14-mer. We want to display the 14-mer and one of its 14 MPD-binding sites, showing: (i) Mth SmAP1 as sticks; (ii) electron density for MPD and proximal SmAP1 residues; (iii) distances between MPD···protein contacts (e.g., H-bonds). MthSmAP1_MPD_density.pml
[PyMOL script file with some descriptive comments]
mth_p21_ump.pdb
[PDB file containing Mth 14-mer, waters, MPDs, UMPs, uridines, etc.]
mth_map2fofc.xplor
[XPLOR map file calculated with 2Fo-Fc coefficients]
mth_mapfofc.xplor
[XPLOR map file calculated with Fo-Fc coefficients]
LigandsDistancesEtc.tgz
[tarball of all files for this example]
[MthSmAP1_MPD_density.png]
MthSmAP1_MPD_density.png
[Sequence conservation!] An example of one way to illustrate sequence conservation information on a protein 3D structure. We have done something like an MSA to get residue conservation scores, and now want to display these scores on a surface rendering of a representative 3D structure for this protein family. README.txt
[Explanation of how to go about this]
1L5X.pdb
[Sample PDB file]
1l5x_conserved_sites.txt
[Sample sequence conservation data for 1L5X (totally synthetic!); file format described in the header of the map_conservation_to_B.pl script.]
map_conservation_to_B.pl
[Perl script that processes 1L5X.pdb and 1l5x_conserved_sites.txt inputs to yield 1l5x_scores.pdb output file.]
1L5X_scores.pdb
[Output file in which B-factor fields are replaced by scores from 1l5x_conserved_sites.txt.]
color_b.py
[Robert Campbell's color_b Python module]
[SequConserv_example_1l5x.png]
SequConserv_example_1l5x.png
[Animations!] The crystal structure of Pae SurEα reveals a dimer in the asymmetric unit of a P3121 cell. We want to render one of the monomers as a ribbon diagram and make a movie of it spinning about the y-axis. This animation uses frames which are anti-aliased and ray-traced, so the size may be unreasonable. Icannotfindit.sorry
[…but visit the PyMOL manual; movies are easy.]
[PaeSurE_movie.gif]
PaeSurE_movie.gif
[Sausages!] The crystal structure of Pae SmAP3 reveals a 28-mer in the asymmetric unit of a P21 cell, organized as tangential tetradecamers which are each composed of apical and equatorial heptamers. We want a "sausage"-style cartoon representation of the backbones for one of the 14-mers, with the tube diameter scaled by values in the B-factor field (which, in the case of this crystal structure, are actual B-factors). See the PyMOL v0.97 patch below for more information. pymol-0.97cam.patch.tgz
[See the description of this patch in the Scripts, modules, patches, etc. section below.]
1M5Q.pdb
[SmAP3 28-mer as PDB entry 1M5Q]
[PaeSmAP3_sausage.png]
PaeSmAP3_sausage.png
[CGO Representations!] The structure of Mth SmAP1 in the P212121 crystal form reveals a quasihexagonal packing in which individual heptamers stack upon one another to form cylindrical tubes, and the head-to-tail association of heptamers imparts a defined polarity on the tubes. We want a coarse-grained representation of the overall crystal packing in order to illustrate this peculiar feature, and one approach to achieve this is via PyMOL's builtin Compiled Graphics Object (CGO) facilities. Therefore, each SmAP1 heptamer was represented by a heptagonal CGO plate constructed such that the vertices of each TRIANGLE_FAN correspond to the same residue in each monomer. Download the tarball camsCGOstuff.tar.bz2 and see the section below for more information about the Perl and Python scripts used for this. camsCGOstuff.tar.bz2
[See the description of this tarball in the Scripts, modules, patches, etc. section below.]
[MthSmAP1_camsCGOstuff.png]
MthSmAP1_camsCGOstuff.png
[Averaging structures!] Some methods of protein structural analysis produce multiple conformers of the same protein structure -- e.g., the bundle of structures resulting from an NMR structure determination or the ensemble of structures from MD simulations. Such bundles may be analyzed by calculating the average 3D structure (literally, the atom-specific average of x, y, z coordinates of each residue), and also by calculating two types of residue-specific RMSDs -- (i) with respect to the average structure, or (ii) as an average over all n(n-1)/2 unique pairs within the bundle, irrespective of the averaged structure. Given a PDB file consisting of multiple 3D structural models of the same protein, we want to calculate the average structure as well as these two types of RMSDs. Also, the average structure will be displayed as a variable-diameter ("putty" or "sausage") cartoon in which tube diameters are scaled by residue-specific RMSDs. README.txt
[Overview of how to go about this]
average3d.py
[The Python module for doing these calculations]
1T3V.pdb
[Sample PDB file of an NMR bundle with 22 conformers]
1T3V_average3d_example.pml.py
[Sample PyMOL macro (written in the Python API, not PyMOL's scripting language) providing several examples of using average3d.py with the 1T3V structures, visualizing the resulting RMSDs via putty cartoons, writing the RMSD data to files, etc..]
1C89.pdb
[Sample PDB file of an NMR bundle with 40 conformers]
1C89_average3d_example.pml.py
[Sample PyMOL macro corresponding to usage of average3d.py with the 1C89 structures.]
[Average3dExample.png]
Average3dExample.png
(1T3V in top row, 1C89 in bottom row)

^ Perl scripts, Python modules, patches, etc. for PyMOL (animations and other miscellaneity):

^ Electrostatics in PyMOL via Michael Lerner's APBS module: [outdated]