mailr11530 - /1.3/generic_fns/pymol_control.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 18, 2010 - 08:38:
Author: bugman
Date: Wed Aug 18 08:38:35 2010
New Revision: 11530

URL: http://svn.gna.org/viewcvs/relax?rev=11530&view=rev
Log:
Fix for the average domain rotation in pymol.cone_pdb().

The pymol angle should be degrees, and the rotation is passive not active.


Modified:
    1.3/generic_fns/pymol_control.py

Modified: 1.3/generic_fns/pymol_control.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pymol_control.py?rev=11530&r1=11529&r2=11530&view=diff
==============================================================================
--- 1.3/generic_fns/pymol_control.py (original)
+++ 1.3/generic_fns/pymol_control.py Wed Aug 18 08:38:35 2010
@@ -29,7 +29,8 @@
 # Python module imports.
 if dep_check.pymol_module:
     import pymol
-from numpy import float64, zeros
+from math import pi
+from numpy import float64, transpose, zeros
 from os import sep
 from subprocess import PIPE, Popen
 
@@ -290,8 +291,11 @@
     ave_pos_R = zeros((3, 3), float64)
     euler_to_R_zyz(cdp.ave_pos_alpha, cdp.ave_pos_beta, cdp.ave_pos_gamma, 
ave_pos_R)
 
+    # The rotation is passive (need to rotated the moving domain back into 
the average position defined in the non-moving domain PDB frame).
+    R = transpose(ave_pos_R)
+
     # Convert to axis-angle notation.
-    axis, angle = R_to_axis_angle(ave_pos_R)
+    axis, angle = R_to_axis_angle(R)
 
     # The PDB file to rotate.
     for i in range(len(cdp.domain_to_pdb)):
@@ -299,7 +303,7 @@
             pdb = cdp.domain_to_pdb[i][1]
 
     # Execute the pymol command to rotate.
-    pymol_obj.exec_cmd("cmd.rotate([%s, %s, %s], %s, '%s', origin=[%s, %s, 
%s])" % (axis[0], axis[1], axis[2], angle, pdb, cdp.pivot[0], cdp.pivot[1], 
cdp.pivot[2]))
+    pymol_obj.exec_cmd("cmd.rotate([%s, %s, %s], %s, '%s', origin=[%s, %s, 
%s])" % (axis[0], axis[1], axis[2], angle/pi*180.0, pdb, cdp.pivot[0], 
cdp.pivot[1], cdp.pivot[2]))
 
 
 def create_macro(data_type=None, style="classic", colour_start=None, 
colour_end=None, colour_list=None):




Related Messages


Powered by MHonArc, Updated Wed Aug 18 09:00:03 2010