This is a read-only mirror of

Main Page

From PyMOL Wiki
Jump to navigation Jump to search
hosted by SBGridlogo2.jpg
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
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 fellows announced for 2018-2019
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...


This is a simple script to generate a repeating atom lattice. It just writes atoms in PDB format, and PyMOL will automatically connect adjacent atoms when loading the PDB file. You may adjust the c and/or x_shift, y_shift arrays to obtain different geometries, and the number of iterations in the loops to adjust the lattice size.

See also the thread on pymol-users mailing list.

<syntaxhighlight lang="python"> from numpy import array

  1. coordinates of the repeating unit (from cyclohexane)

c = array([[ 0.064, 2.851, -1.085 ],

          [ 0.260,   1.969,   0.159 ]])

x_shift = array([ 1.67441517, -0.91605961, 1.66504574]) y_shift = array([-0.69477826, -0.40578592, 2.40198410])

  1. template string for PDB hetatom line

s = 'HETATM %4d C03 UNK 1 %8.3f%8.3f%8.3f 0.00 0.00 C '

out = open('lattice.pdb', 'w')

i = 0 for x in range(10):

   for y in range(10):
       for v in (c +  ..→
A Random PyMOL-generated Cover. See Covers.