Jump to content

Main Page

From PyMOL Wiki
Revision as of 02:52, 4 December 2025 by JustinOConnor (talk | contribs)
hosted by
Welcome to the PyMOL Wiki!
The community-run support site for the PyMOL molecular viewer.
To request a new account, email SBGrid at: accounts (@) sbgrid dot org
Quick Links
Tutorials Table of Contents Commands
Script Library Plugins FAQ
Gallery | Covers PyMOL Cheat Sheet (PDF) Getting Help
News & Updates
New Setup PyMOL-open-source-windows-setup v3.1 has been released on January 20, 2025. More information under Windows Install.
New Plugin PySSA aims to combine PyMOL and ColabFold to enable the prediction and analysis of 3D protein structures for the scientific end-user. v1.0 has been released on July 10, 2024.
Official Release PyMOL v3.0 has been released on March 12, 2024.
New Plugin CavitOmiX calculate Catalophore™ cavities, predict protein structures with OpenFold by NVIDIA-BioNeMo, ESMFold and retrieve Alphafold models
Official Release PyMOL v2.5 has been released on May 10, 2021.
Python 3 New Python 3 compatibility guide for scripts and plugins
POSF New PyMOL fellowship announced for 2022-2023
Tutorial Plugins Tutorial updated for PyQt5
New Plugin PICv is a new plugin for clustering protein-protein interactions and visualization with available data from PDBe
Selection keywords New polymer.protein and polymer.nucleic selection keywords. Thanks everyone who participated in the poll!
Plugin Update MOLE 2.5 is an updated version of channel analysis software in PyMOL
New Script dssr_block is a wrapper for DSSR (3dna) and creates block-shaped nucleic acid cartoons
Older News See Older News.
Did you know...
NOTOC NOEDITSECTION
Type Python Script
Download scripts/draw_rotation_axis.py
Author(s) Pablo Guardado Calvo
License
This code has been put under version control in the project Pymol-script-repo

This script will draw a CGO cylinder representing a rotation axis for a given transformation. It's very useful for drawing the axes of rotational symmetry in an oligomeric assembly.

The idea is to align two molecules/domains/chains/selections (using cmd.super) and extract the trasformation (TTT) matrix (T). The direction of the rotation axis, and a point are obtained from T and are used to create a cgo object representing the axis. The script generates two measures: one in the graphical screen (the rotation axis value, and the norm of the translation vector along the rotation axis) and some basic information in the command-line (the transformation matrix, the rotation angle, distance between centroids, and some pml lines that you can use to reproduce the axis...)

As always with these type of things, you have to use it at your own risk. I did not try all possible combinations, but if you find a bug, do not hesitate to contact me (pablo.guardado@gmail.com) or try to modify the code for yourself to correct it.

To load the script just type:

run path-to-the-script/draw_rotation_axis.py

or if you want something more permanent add the previous line to your .pymolrc file

The script works just typing:

draw_axis('selection1', 'selection2')

Please, pay attention to the apostrophes around the selections, you MUST use them. Also works with chains:

draw_axis('chain A', 'chain B')

or objects:

draw_axis('obj01', 'obj02')

Also, you can play a bit with the length, width and color of the axis.

draw_axis('selection1', 'selection2', scale_factor, width, r1, g1, b1, r2, g2, b2)

scale_factor = to control the length of the axis, the default is 20

width = to control the width of the axis. Default is 0.6

r1, g1, b1 = first RGB color code. Default is 1, 1, 1

r2, g2, b2 = second RGB color code to create the gradient. Default is 1, 0, 0.

To create a single color axis, just made r1,g1,b1=r2,g2,b2

Examples

# download the source and save as draw_rotation_axis.py
run draw_rotation_axis.py
fetch 2vak
# calculate rotation axis between chains A and B
draw_axis('chain A', 'chain B')
# Another example, calculate the rotation axis of an homodimer
run draw_rotation_axis.py
fetch 3rfg
# calculate rotation axis between chains A and B
draw_axis('chain A', 'chain B')
# Clearly, each of the domains are made up with motifs with internal symmetry
draw_axis('resi 200-236 and chain A', 'resi 238-274 and chain A', 20, 0.6, 1, 0, 0, 1, 0, 0)
# Also, you can create first the selections and use them to calculate the axis
sele selection1, resi 200-236 and chain A
sele selection2, resi 238-274 and chain A
draw_axis('selection1', 'selection2', 20, 0.6, 1, 0, 0, 1, 0, 0)
# will produce the same result.





A Random PyMOL-generated Cover. See Covers.