<source lang="python">
import math
from pymol import querying
from pymol.cgo import *
from pymol import cmd
- NOTE!! : These packages (numarray, Scientific) must be present in pymol's
- '$PYMOLDIR/py23/lib/python2.3/site-packages/' directory!!
- OR..if you are using Mac PyMOL 0.99beta19 or later then the system installs will be used
from numarray import *
from numarray.ma import average
from numarray import linear_algebra as la
from Scientific.Geometry import Vector, Tensor, Transformation
def boundingBox(selectionName, colourRGB=[1,1,1]):
"""
The main function to call :
run "box.py"
boundingBox("peptide")
Should make a box around "peptide" (assuming it exists!). For a different colour use:
boundingBox("peptide", colourRGB=[1, 0, 1])
Or whatever. The box should be a cgo called 'peptide-box' (for this example).
"""
model = querying.get_model(selectionName)
coords = model.get_coord_list()
#find the least square plane ..→