[Chimera-users] HELP: I'm wondering about how to access the surface data

Thomas Goddard goddard at cgl.ucsf.edu
Mon Apr 19 11:07:20 PDT 2010


You cannot easily start Python and import Chimera.  There are a few 
reasons for this.  1) An environment variable needs to be set 
(LD_LIBRARY_PATH) so Chimera libraries can be found, 2) an environment 
variable (PYTHONPATH) needs to be set so Python can find Chimera 
modules, 3) Chimera requires exactly the Python binary that comes with 
it so that the dozens of compiled modules work correctly and unicode 
handling is done as expected.  Because of the difficulties we don't 
support importing Chimera in an already running Python -- but with work 
you could figure it out.

The Chimera programming documentation describes how to get surface 
geometry from a surface model:

http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Reference/surface.html

To calculate the surface in the first place you need to look at the 
Python code I mentioned.  Unfortunately, most Python routines Chimera 
provides are not documented, so you will have to read the code that 
comes with the Chimera distribution in the "share" directory.  Another 
aid is to look at the Chimera Python scripts web page:

http://plato.cgl.ucsf.edu/trac/chimera/wiki/Scripts


   Tom




> Thank you!
> So I can't just open a new python script and import chimera without ./chimera
>
> I still don't know how to get the surface data(It's all triangles right?)
> say:
>>>> import chimera
>>>> mlist = chimera.openModels.list()
>>>> molecule = mlist[0]
> Then what should I do to get the surface calculated and get the data?
>
>> Forgot to mention the mscalc Python interface is the Python
>> MolecularSurface module found in
>>
>>       chimera/share/MoleculeSurface
>>
>> or on the Mac in
>>
>>       Chimera.app/Contents/Resources/share/MoleculeSurface
>>
>> Look at the calcsurf.py code which runs the mscalc stand-alone program
>>
>> (include in Chimera) and look at msurf.py if you are interested in the
>>
>> Chimera SurfaceModel class which displays the surface in the graphics
>>
>> window.
>>
>>       Tom
>>
>>
>>
>>> Hi chimera users,
>>> I'm wondering about several question:
>>> I installed chimera in my home dir, what's path to import  in python?
>>> how can I access the data generated by mscalc in python?
>>>
>>



More information about the Chimera-users mailing list