== Overview ==
This script returns the names of all objects (in state 1) that are within a certain cutoff distance from your provided target. For example, if you load an MD trajectory and are watching the binding pocket, you can select the ligand and then find out which loaded files are within 5 Ang, say, of that ligand atom.
The Code
<source lang="python" enclose="pre">
- -*- coding: utf-8 -*-
- findObjectsNearby.pml -- Get object names within a given radius of the target
def findObjectsNearby( target="", radius=2.0, doPrint=False, fileName="" ):
"""
DESCRIPTION:
finds all PyMOL object names within [radius] Angstroms of [target].
PARAMETERS:
target, the base selection/object around which to search for things
radius, the radius of the sphere centered around target within which to search
doPrint, boolean, if True print the results to console, False no printing
fileName, string, if not blank the list called [fileName] is written to disk
RETURNS:
[list] of results or None if bad input.
NOTES:
* ..→