Hi Rachel, Attached is Python code that prints the unit cell axes of open PDB models to the reply log. You open the PDB models, then open this script, and the results appear in the reply log (menu Favorites / Reply Log), for example: 1a0m.pdb unit cell axes a axis = 44.400 0.000 0.000 b axis = 0.000 44.400 0.000 c axis = 0.000 0.000 23.500 I figured out the needed Chimera calls by looking at the Chimera Python code for the Unit Cell tool located in your Chimera distribution in chimera/share/UnitCell/__init__.py and I homed in on the show_outline_cb() function to quickly figure out the attached code. On the Mac this code is in Chimera.app/Contents/Resources/share/UnitCell/__init__.py and to look inside the Chimera.app folder click on its icon with the ctrl key held and select "Show Package Contents". Tom
*From: *Rachel Karchin *Date: *March 4, 2008 5:42:36 PM PST
Me again. Is there a way to get the coordinates of the unit cell vertices or the plane equation from Chimera running through a python script?
Tx!!
-- rk
# Get currently opened PDB models from chimera import openModels, Molecule mlist = openModels.list(modelTypes = [Molecule]) # Print crystal unit cell axes for each molecule. from PDBmatrices.crystal import crystal_parameters, unit_cell_axes for m in mlist: a, b, c, alpha, beta, gamma, space_group, zvalue = \ crystal_parameters(m.pdbHeaders) a_axis, b_axis, c_axis = unit_cell_axes(a, b, c, alpha, beta, gamma) print m.name, 'unit cell axes:' print ' a axis = %8.3f %8.3f %8.3f' % tuple(a_axis) print ' b axis = %8.3f %8.3f %8.3f' % tuple(b_axis) print ' c axis = %8.3f %8.3f %8.3f' % tuple(c_axis)