[chimera-dev] Re: chimera

Thomas Goddard goddard at cgl.ucsf.edu
Tue Sep 16 22:25:36 PDT 2003


Hi Matt,

  Below is example python code to start Chimera and open PDB 1zzz.
For it to work you have to set the LD_LIBRARY_PATH environment
variable before running python to include the chimera/lib directory.
If you start it from your own Python program you can pass Python
objects directly to Chimera.  This is simplest if your program uses
Tkinter, since Chimera needs the Tkinter event loop to run in order
to update the graphics and accept user input.

       Tom

#
# Need to set LD_LIBRARY_PATH environment variable to <chimera-home>/lib
# before running python2.2.
#
# On linux your python2.2 must have the dl module.  This module is not
# standard on linux.  It is included in the Python included with Chimera.
#
chimera_home = '/usr/local/chimera-1700'
import sys
import os.path
sys.path.insert(0, os.path.join(chimera_home, 'share'))
sys.path.insert(0, os.path.join(chimera_home, 'lib'))
os.environ['CHIMERA'] = chimera_home
import chimeraInit
chimeraInit.init([], eventloop = False)
import chimera
chimera.openModels.open('1zzz', 'PDBID')	# Will download from web.
chimera.tkgui.eventLoop()		  # Doesn't return until Chimera quits


--------------------------
> Date: Tue, 16 Sep 2003 22:12:26 -0500
> From: Matthew Dougherty <matthewd at bcm.tmc.edu>
> To: goddard at cgl.ucsf.edu
> Subject: chimera
> 
> Tom-
> 
> I was wondering if I can run chimera using an embedded python.
> If so can I send python data objects to it through my main program?
> 
> Matt
> 
> ------------------------------------------
>      Matthew Dougherty/713-747-5433
> National Center for Macromolecular Imaging
>        Baylor College of Medicine
> 


More information about the Chimera-dev mailing list