I was trying to write a script that would read in CHARMM trajectory files (DCD) specifically for users who do not have access to the most current version of PyMOL.  I have written a Python script that will interpret a DCD file and load it into the corresponding object but this process is definitely not as fast as the C implementation already available in version 1.2.  I can see where it would be difficult to access the coordinates in the C array via Python.  This is not a pressing need of mine by any means as it was something that I am revisiting (if you recall, I had tried this in the past) as I definitely made some mistakes earlier that made the script very slow and inefficient.  Now, I have an "optimized" version of the Python script with the limitation being the replacement of the coordinates. 


Subject: RE: [PyMOL] Replace Coordinates in State
Date: Mon, 26 Oct 2009 10:54:39 -0700
From: warren@delsci.com
To: magicmen@hotmail.com; pymol-users@lists.sourceforge.net



Unfortunately, there isn’t any way at present to directly expose PyMOL’s internal C coordinate array to Python in an accessible form.  Yes, iterate_state and alter_state are highly inefficient – it would make more sense to provide a means of exporting and re-importing coordinate sets via either native Python lists or, even better, NumPy arrays.  In what form do you have the current coordinate data?





From: Sean Law [mailto:magicmen@hotmail.com]
Sent: Friday, October 23, 2009 4:54 PM
To: pymol-users@lists.sourceforge.net
Subject: [PyMOL] Replace Coordinates in State


Hi All,

I was wondering if there was a faster way to replace all coordinates.  I've used commands such as iterate_state and alter_state before but they are far too slow since they have to iterate over each atom.  Instead, I want to replace one set of coordinates that correspond to a specific state with a different set.  Here's what I have to work with:

I have a list that contains x, y, z coordinates.  Of course, this list can be manipulated and/or separated if necessary.  I'm assuming that the coordinates for a specific state are stored somewhere in memory and I would basically like to replace one set of coordinates with the other.  I would think that something like "pointers or references" would work a lot faster than having to copy the coordinates over (which is typically slow and is likely what alter_state is doing?). In addition, I am dealing with 100+ states using alter_state for each state would be far too slow.

Any suggestions would be greatly appreciated.

Thanks in advance!


Save up to 84% on Windows 7 until Jan 3-eligible CDN College or University students only. Hurry-buy it now for $39.99!

Ready…Set…Get a great deal on Windows 7 See phenomenal deals on Windows 7 now