[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] Modeller API



Hi all,
Apologies for my previous post, it was a bit premature - I've answered my own question, after finding the 'cdpt' member of the python model class (in model.py).  It's is a pointer to the mod_coordinates struct in C containing the coordinate information, so I've been able to write a quick C++ function, called from python using the my_model.cdpt pointer, that reads and changes x,y,z coordinates.  Provided changes are made sensibly and consistently, is this safe to do?  I'm assuming any manipulations at this level would be equivalent to calling model.read()  in the presence of existing coordinate data?
Thanks,
James



2009/1/4 James Irving <">>
Hi,
I have written a number of functions in C++ for structural analysis that I was hoping to interface with Modeller via the Modeller API.  Specifically, I want to transfer coordinates backwards and forwards between a 'model' object and an external representation of coordinate data without having to write out a PDB file and then re-read it in in either direction, to avoid slow and unnecessary I/O and string conversion.  Is this possible?  From the structs in mod_types.h it looks as though it should be, but would it suffice to read and write into mod_model.mod_coordinates and mod_model.mod_sequence (my_model.cd.[x,y,z etc.] and my_model.seq.[irestyp, etc.])?  If anyone has some code (in any language) or suggestions about the best way to go about this, I would greatly appreciate it.
Thanks!
James