PyMOL Schrödinger

Advanced Scripting Workshop

Part 4: Interactive Automation

When using PyMOL as an interactive GUI application, things can be automated with:

Examples

PML syntax example to show all atoms in sphere representation:

set_key F1, as spheres

Python syntax example to toggle between orthoscopic and perspective camera:

cmd.set_key('F2', lambda: cmd.set('orthoscopic', not cmd.get_setting_int('orthoscopic')))

Cartoon/stick/sphere preset as nice command:

alias nice, as cartoon; show sticks, organic; show spheres, inorganic

Map actions to F-keys

  1. Bind two F-keys to set black and white background color (Use bg_color command)
  2. Bind two F-keys to show and hide the sequence viewer (seq_view setting)
  3. Bind one F-key to toggle the sequence viewer
  4. Bind “ligand zoom” to an F-key (Use zoom or orient and the organic selector)

Map actions to commands

  1. Write a “ligand zoom” command

© 2017 Schrödinger, Inc.