Get Coordinates II

From PyMOLWiki
Revision as of 08:35, 30 April 2009 by Inchoate (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
from pymol import cmd
from pymol import stored

stored.xyz = []
cmd.iterate_state(1,"pept","stored.xyz.append([x,y,z])")

# at this point, stored.xyz is a native Python array holding
# the coordinates, which you can modify as required

stored.xyz = map(lambda v:[-v[1],v[0],v[2]],stored.xyz)

# and now you can update the internal coordinate sets

cmd.alter_state(1,"pept","(x,y,z)=stored.xyz.pop(0)")