This is a read-only mirror of pymolwiki.org

Main Page

From PyMOL Wiki
Revision as of 03:58, 4 March 2019 by Cchem (talk | contribs) (2 revisions)
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 chains

Included in psico
This command or function is available from psico, which is a PyMOL extension.

Module psico.editing

split_chains is a script that creates for each chain in selection its own object.

This is a core command since PyMOL 1.6.0.0

Usage

split_chains [ selection [, prefix ]]

Example

fetch 2yko 2ykp 2ykq, async=0
split_chains
delete 2yko 2ykp 2ykq
alignto 2yko_A

The Script

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

def split_chains(selection='(all)', prefix=None):

   

DESCRIPTION

   Create a single object for each chain in selection

SEE ALSO

   split_states, http://pymolwiki.org/index.php/Split_object
   
   count = 0
   models = cmd.get_object_list('(' + selection + ')')
   for model in models:
       for chain in cmd.get_chains('(%s) and model %s' % (selection, model)):
           if chain == :
               chain = ""
           count += 1
           if not prefix:
               name = '%s_%s' % (model, chain)
           else:
               name = '%s%04d' % (prefix, count)
  ..→
A Random PyMOL-generated Cover. See Covers.