|
From: Thomas H. <sp...@us...> - 2011-07-20 09:21:43
|
> Thanks, but I still failed to get this new pdb.
>
> File -- Save molecular -->
>
> I wish the present coordinate will be saved as a new pdb after rotation.
I guess with present coordinate you mean what you see on screen. To get
this you need to transform the atom coordinates by current camera
orientation before saving to file.
This python code will do that:
def transform_by_camera_rotation():
view = list(cmd.get_view())
M = view[0:3] + [-view[12]] + \
view[3:6] + [-view[13]] + \
view[6:9] + [-view[14]] + \
view[12:15] + [1.]
cmd.transform_selection('(all)', M, transpose=1)
cmd.set_view([1,0,0,0,1,0,0,0,1] + view[9:])
cmd.extend('transform_by_camera_rotation', transform_by_camera_rotation)
Example:
fetch 2xwu
orient
transform_by_camera_rotation
save /tmp/withneworientation.pdb
Cheers,
Thomas
--
Thomas Holder
MPI for Developmental Biology
Spemannstr. 35
D-72076 Tübingen
|