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 script provides methods that create cgos as triangles. It uses code that is ported from this c++ code and seems to be correct!

Here is the script. The last four lines show this in use, by making an ellipse and a toroid and loading them into pymol. This is done most easily by something like "cmd.load_cgo(makeEllipsoid(1, 1, 1, 2, 3, 4), 'ellipsoid')" which makes an ellipsoid at x, y, z = 1, 1, 1 and dimensions 2, 3, 4 and called 'ellipsoid'.

<source lang="python"> from pymol.cgo import BEGIN, COLOR, TRIANGLES, VERTEX, NORMAL, END from pymol import cmd

def signOfFloat(f):

       if f < 0: return -1
       if f > 0: return 1
       return 0

def sqC(v, n):

       return signOfFloat(math.cos(v)) *  math.pow(math.fabs(math.cos(v)), n)

def sqCT(v, n, alpha):

       return alpha + sqC(v, n)

def sqS(v, n):

       return signOfFloat(math.sin(v)) * math.pow(math.fabs(math.sin(v)), n)

def sqEllipsoid(x, y, z, a1, a2, a3, u, v, n, e):

       x = a1 * sqC(u, n) *  ..→
A Random PyMOL-generated Cover. See Covers.