Main Page

From PyMOLWiki
Revision as of 21:32, 15 July 2022 by JarrettJohnson (talk | contribs) (PyMOL 2022-2023 Fellowship Date change)
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 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...

SelectClipped

This script selects those atoms that are between the near and far clipping plane.

Usage

select_clipped [name [, selection [, state]]]

The Code

from pymol import cmd

def clipped_by(at,v):
   x,y,z = at.coord
   nz = v[2]*(x-v[12])+v[5]*(y-v[13])+v[8]*(z-v[14])-v[11]
   return nz > v[15] and nz < v[16]

def clipped(selection="all",state=1):
   v = cmd.get_view()
   return [ i.id for i in cmd.get_model(selection,state).atom if clipped_by(i,v) ]

def select_clipped(name='clipped', selection='all', state=1):
    '''
DESCRIPTION

    Select atoms between clipping planes

USAGE

    select_clipped [name [, selection [, state]]]
    '''
    state = int(state)
    cmd.select(name, 'none')
    for model in cmd.get_object_list('(' + selection + ')'):
        cmd.select_list('__tmp', model, clipped('(%s) and (%s)' % (model, selection), state))
        cmd.select(name, '__tmp', merge=1)
    cmd.delete('__tmp')

cmd.extend('select_clipped', select_clipped)

To use this script save it to ..→

A Random PyMOL-generated Cover. See Covers.