User Tools

Site Tools


Core Commands

First you need load a structure into PyMOL. Use

  • fetch – to load molecules directly from the protein data bank.
    fetch 1dn2


  • load – to load structures from your local disk.
    load 1dn2.pdb

The most important visualization commands in PyMOL are:

  • show – for showing representations:
    show cartoon
    show surface
  • hide – for hiding those same representations:
    hide surface
    hide lines
    hide nonbonded


  • color – for coloring those representations:
    color red
    color green

When used as shown above, they affect any and all structures loaded into PyMOL. However, their scope can be restricted through use of selection expressions and name patterns in order to affect specific atoms or objects only.

show surface, 1hpv
show cartoon, chain b
show spheres, 1vgc and resi 95
color yellow, name ca

The next core commands are:

  • zoom – for focusing the view on specific atoms:
    zoom resi 110-120
    zoom all
  • label – for creating labels:
    label name ca, resn+resi
    label 1hpv//B/25/CG, "Active Site"
    label solvent, "%1.1f"%b


  • select – for creating a list of atoms that you can refer to over and over again:
    select 30s_loop, 30-34/
    show sticks, 30s_loop
    color pink, 30s_loop and elem C


  • enable and disable commands allow you to toggle the display of selection indicators and entire objects:
    disable 30s_loop
    disable 1hpv
    enable 1btu

The three core commands for creating measurement objects are:

  • distance – for measuring distances:
    distance measure01, b/46/ce, b/53/cg

    or hydrogen bonds:

    dist hbond01, chain a, chain b, mode=2
  • angle – for measuring angles:
    angle measure02, b/37/ca, b/37/cb, b/37/og


  • dihedral – for measuring dihedral angles:
    dihedral measure03, a/18/n, a/18/ca, a/18/cb, a/18/cg

Once you are ready to create a final image:

  • draw – prepares an OpenGL-based image:
    draw 1600,1200
  • ray – prepares a ray-traced image that can have shadows as well as better lighting than OpenGL:
    ray 1200, 900


  • png – will write your image out to disk in PNG format:
    png my_image.png

See Also

command/core_set.txt · Last modified: 2013/08/19 21:01 (external edit)