Main Page

From PyMOLWiki
Revision as of 05:27, 19 February 2019 by Speleo3 (talk | contribs) (2to3)
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
Python 3 New Python 3 compatibility guide for scripts and plugins
Official Release PyMOL v2.3 has been released on February 11, 2019.
POSF New PyMOL fellows announced for 2018-2019
Tutorial Plugins Tutorial updated for PyQt5
New Plugin ProBiS H2O is a new plugin for identification of conserved waters in protein structures.
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...

Split selection

Given an initial selection, Split_selection will create two new selections. One, called 'lo,' will have all the atoms with IDs lower than your input atom (actually input residue's alpha carbon); and the second selection is 'hi,' which contains the atoms with IDs higher than the initial (residue's alpha carbon) atom.

The Code

<source lang="python"> import pymol from pymol import cmd

def get_index_list(s): """ Given an atom selection, return the list of atom IDs in this selection """ return map(lambda x: x.index, cmd.get_model(s).atom)

def get_single_index(s): """ Get the ID of the first alpha carbon in the selection, S """ # assume CA return get_index_list( "n. CA and (br. %s)" % s)[0]

def split_selection(s): """ PARAMS s An atom selection.

RETURNS None

SIDE EFFECTS Creates two new selections, called lo and hi. Lo will have ..→

A Random PyMOL-generated Cover. See Covers.