On Wed, Jul 20, 2011 at 5:21 PM, Thomas Holder <spel...@users.sourceforge.net> wrote: >> 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)
Thanks first, but here comes another question, once I touched a transform_by_camera_rotation.py and copy those inside it as following, $ more transform_by_camera_rotation.py #/usr/bin/python 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 PyMOL>transform_by_camera_rotation Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/pymol/parser.py", line 464, in parse exec(layer.com2+"\n",self.pymol_names,self.pymol_names) File "<string>", line 1, in <module> NameError: name 'transform_by_camera_rotation' is not defined I don't know how achieve this part. Thanks again with best regards, > save /tmp/withneworientation.pdb > > Cheers, > Thomas > > -- > Thomas Holder > MPI for Developmental Biology > Spemannstr. 35 > D-72076 Tübingen > ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net