Extensions with C code

Jerome Nilmeier has some questions about writing C code extensions to Chimera. ------- Start of forwarded message ------- Date: Sun, 31 Oct 2004 18:42:34 -0800 (PST) From: Jerome Nilmeier <jnilmeier@yahoo.com> Subject: rudimentary chimera questions To: goddard@cgl.ucsf.edu Hello Tom: I'm not sure exactly who to ask about this... I am a UCSF grad student, and I'd like to use chimera for my reserach. I am thinking of trying to interface some c code with chimera, and had just a couple of basic questions: 1) how do you access the information about loaded molecules from the idle prompt? I went through the example, but it doesn't say how to work with molecules that have been loaded using the menu. 2) I was trying to use swig to generate a python wrapper...so far without success. Do you have a recommended (hopefully straightforward) method for interfacing python with c code? Any help you could offer would be most appreciated. Thank you, Jerome ------- End of forwarded message -------

Since you are at UCSF and in the same department as us, why don't you come by N453 Genentech Hall and talk to us. We can probably figure out how best to help you easier in person than in email. That said ... For accessing chimera's molecular data from python, see the examples in the Chimera Programmer's Guide, <http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/Examples/index.html>. Specifically the use of chimera.openModels.list() in the Molecular Editing example. Please give us feedback on the examples so we can improve them. For generating a python wrapper for C code, the first question is why? Generally, you should prototype your code in python first and only after profiling convert part of it to C (or C++). The exception is when you wish to use an existing library. swig is the best supported wrapping tool out there. It has extensive documentation and examples at <http://www.swig.org>. For C code, there is also Pyrex, <http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/>. If you want a wrapper for C++ code, then we prefer our own wrappy tool (currently only available on our systems), but you should look at boost::python, <http://www.boost.org>. Hope this helps, Greg Couch UCSF Computer Graphics Lab gregc@cgl.ucsf.edu On Mon, 1 Nov 2004, Thomas Goddard wrote:
Date: Mon, 1 Nov 2004 09:34:33 -0800 (PST) From: Thomas Goddard <goddard@cgl.ucsf.edu> To: chimera-dev@cgl.ucsf.edu Subject: [chimera-dev] Extensions with C code
Jerome Nilmeier has some questions about writing C code extensions to Chimera.
------- Start of forwarded message -------
Date: Sun, 31 Oct 2004 18:42:34 -0800 (PST) From: Jerome Nilmeier <jnilmeier@yahoo.com> Subject: rudimentary chimera questions To: goddard@cgl.ucsf.edu
Hello Tom:
I'm not sure exactly who to ask about this... I am a UCSF grad student, and I'd like to use chimera for my reserach. I am thinking of trying to interface some c code with chimera, and had just a couple of basic questions:
1) how do you access the information about loaded molecules from the idle prompt? I went through the example, but it doesn't say how to work with molecules that have been loaded using the menu.
2) I was trying to use swig to generate a python wrapper...so far without success. Do you have a recommended (hopefully straightforward) method for interfacing python with c code?
Any help you could offer would be most appreciated.
Thank you, Jerome
------- End of forwarded message ------- _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
participants (2)
-
Greg Couch
-
Thomas Goddard