[Chimera-users] Using Chimera from non-chimera python scripts

Eric Pettersen pett at cgl.ucsf.edu
Thu May 10 10:46:38 PDT 2012


On May 10, 2012, at 6:02 AM, Dan Cohen wrote:

> Hello,
>
> I would like to use Chimera python classes from a python script  
> running outside Chimera (part of a larger python project).
> I saw another post that explained that this could be done but I was  
> unclear which of the Chimera functionality can be used
> in this case. In case I want to create an image (e.g. load pdb  
> files, do some editing and then create an image to a file) - can I use
> the "chimera" class or do I need to use something else? (I saw a  
> reference to "midas" classes)
>
> Is there an example for doing that? Processing a file and creating  
> an image in a non-GUI scenario running outside chimera?

Hi Dany,
	You probably want to look over the Chimera Programmer's Guide here:

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

and particularly the "basic primer" here:

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

which covers almost exactly what you're asking for:  making images via  
a script.  As Greg mentioned in his reply, it is far easier to run  
Python scripts using Chimera as the Python interpreter than using a  
separate Python and importing Chimera modules.  Also as Greg  
mentioned, you would need to use the "headless" version of Chimera if  
you don't want the Chimera interface displayed as the script runs  
(which is also mentioned in the latter link above).

--Eric

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20120510/9da9ad55/attachment.html>


More information about the Chimera-users mailing list