Main Page: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(Plugins Tutorial updated for PyQt5)
(fellows)
Line 28: Line 28:
{| class="jtable" style="float: left; width: 90%;"
{| class="jtable" style="float: left; width: 90%;"
|+ style="font-size: 1.4em; font-weight: bold; text-align:left; border-bottom: 2px solid #6678b1;" | News & Updates
|+ style="font-size: 1.4em; font-weight: bold; text-align:left; border-bottom: 2px solid #6678b1;" | News & Updates
|-
! POSF
| [https://pymol.org/fellowship New PyMOL fellows announced for 2018-2019]
|-
|-
! Tutorial
! Tutorial
Line 34: Line 37:
! Official Release
! Official Release
| [https://pymol.org PyMOL v2.2 has been released] on July 24, 2018.
| [https://pymol.org PyMOL v2.2 has been released] on July 24, 2018.
|-
! POSF
| [https://pymol.org/fellowship PyMOL Open-Source Fellowship program] accepting applications for 2018-2019
|-
|-
! New Plugin
! New Plugin

Revision as of 06:57, 27 November 2018

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
POSF New PyMOL fellows announced for 2018-2019
Tutorial Plugins Tutorial updated for PyQt5
Official Release PyMOL v2.2 has been released on July 24, 2018.
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...

Translate And Measure

To use, you would call it like :
print translateAndMeasure("molA", "molB", [1,0,0], 4)

which would print "overlap" if any of the atoms in molA or molB were within 4 Angstrom after translating by 1 along X.

Of course, this could be improved to report exactly which atoms were overlapping, or to make distance objects (using cmd.distance) to show them.

<source lang="python"> def translateAndMeasure(selection, other, translationVector, cutoff):

   cmd.translate(translationVector, selection)
   return checkDistances(selection, other, cutoff)

def checkDistances(moleculeA, moleculeB, cutoff):

   ids_A = getIds(moleculeA)
   ids_B = getIds(moleculeB)
   for idA in ids_A:
       for idB in idsB:
           d = distance(moleculeA, idA, moleculeB, idB)
           if d > cutoff: return "overlap"
   return "no overlap"

def distance(a, idA, b, idB):

   atomA = "%s and id %s" % (a, idA)
   atomB = "%s and id %s" % (b, idB)
   return cmd.get_distance(atomA, atomB)

def getIds(selection):

    ..→
A Random PyMOL-generated Cover. See Covers.