[chimera-dev] gzipped PDB files

Eric Pettersen pett at cgl.ucsf.edu
Thu Jun 6 13:34:01 PDT 2002


On Wednesday, June 5, 2002, at 10:48 PM, Mike Liang wrote:

> Hi! Can you guys allow opening of gzipped PDB files?  Or alternatively
> open a 'string' that contains the contents from a PDB file. This way i'll
> just do something like data=gzip.open('filename').read() and feed data
> into the open command (kind of how you guys do 'VRML').

Hi Mike,
	This is currently kind of tricky because the C++ PDB-reading code takes 
a file name as an argument, not a string or compressed file name.  What you 
need to do is uncompress into a temporary file and use chimera.openModels.
open() to open it.  And delete it when chimera quits (when the 
chimera.APPQUIT trigger fires).
	In the future, the open panel will open compressed files using much the 
same strategy as above, and will extrude an API to allow you get an 
uncompressed file from a compressed one, with the temp file deletion 
handled automatically.

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         pett at cgl.ucsf.edu
                         http://www.cgl.ucsf.edu




More information about the Chimera-dev mailing list