[chimera-dev] Chimera programming in Solaris
Thomas Goddard
goddard at cgl.ucsf.edu
Fri Sep 3 12:12:26 PDT 2004
Hi Hongbo,
If you want to use the crystallographic unit cell capabilities of
Chimera in your own Python program you can use the Python module
chimera/share/PDBmatrices. This module contains code to use the MTRIX
and CRYST1 records and SMTRY remarks in PDB files to produce the
correct tranformation matrices to position asymmetric units.
The chimera/share/UnitCell Python module is almost entirely
Chimera-specific user interface that you will not be able to use
outside of Chimera. But it will be worth looking at the
make_unit_cell_cb() and transforms() routines in
chimera/share/UnitCell/__init__.py to see how the PDBmatrices module
is used.
The PDBmatrices module is independent of all other Chimera code
except for some routines to convert between 3 by 4 matrices, and
Chimera's Xform object which you will not need. Several PDBmatrices
routines expect to get the PDB file headers as a Python dictionary
where the key is the first word of a PDB header line (eg. CRYST1,
MTRIX, ...), and the value is a list of all header lines having that
first word. Chimera provides this dictionary of headers, but you
will not be able to use that part of Chimera (written in C++) on Solaris
so your own code will need to be able to read PDB files to make the
dictionary of headers. Also the PDBmatrices module only produces the
needed transformation matrices. You would have to read PDB coordinates
and apply those matrices to get the unit cell coordinates.
Tom
More information about the Chimera-dev
mailing list