PyMOL Tutorial

Complete Guide from Installation to Creating High-Quality Molecular Images

Introduction

PyMOL is a powerful molecular visualization system used to create high-quality 3D molecular structure images and animations. This tutorial will guide you through the installation and basic usage of PyMOL.

PyMOL has both open-source and commercial versions. This tutorial mainly covers the open-source version.

Installation Steps

Windows Installation

  1. Visit the official PyMOL website to download the installation package
  2. Run the installer and follow the wizard to complete the installation
  3. After installation, launch PyMOL from the Start menu

Linux Installation

# Install using conda
conda install -c conda-forge pymol

# Or install using apt
sudo apt-get install pymol

macOS Installation

# Install using Homebrew
brew install pymol

Basic Usage

1. Load Molecular Structure

# Load structure from PDB
fetch 1AKI

# Load from local file
load myprotein.pdb

2. Basic Display Commands

# Display as lines
show lines

# Display as ball and stick
show sticks

# Display as surface
show surface

# Display as cartoon
show cartoon

3. Color Settings

# Color by secondary structure
color structure

# Color by B-factor
color bfactor

# Custom colors
color red, chain A
color blue, chain B

Advanced Topics

Python Scripting

# Create new object
create new_obj, 1AKI

# Select specific residues
select active_site, resi 20-30

# Measure distance
distance dist, active_site, new_obj

Save Image

# Set image quality
set ray_trace_frames, 1
set ray_trace_color, black

# Save image
ray 1024, 1024
png myimage.png

Create Animation

# Set animation frames
mset 1 x60

# Create rotation animation
mview store, 1
turn y, 360
mview store, 60
mview reinterpolate

# Save animation
mpng frame

Related Tutorials