mailr14907 - /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 October 24, 2011 - 17:55:
Author: bugman
Date: Mon Oct 24 17:55:26 2011
New Revision: 14907

URL: http://svn.gna.org/viewcvs/relax?rev=14907&view=rev
Log:
Bug fix for the pymol.cone_pdb user function for when there is no average 
domain position.

This is necessary for the old 2-domain N-state model analysis type.


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=14907&r1=14906&r2=14907&view=diff
==============================================================================
--- 1.3/generic_fns/pymol_control.py (original)
+++ 1.3/generic_fns/pymol_control.py Mon Oct 24 17:55:26 2011
@@ -304,23 +304,25 @@
     # Rotate to the average position.
     #################################
 
-    # The average position rotation.
-    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(R)
-
-    # The PDB file to rotate.
-    for i in range(len(cdp.domain_to_pdb)):
-        if cdp.domain_to_pdb[i][0] != cdp.ref_domain:
-            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/pi*180.0, pdb, cdp.pivot[0], 
cdp.pivot[1], cdp.pivot[2]))
+    # Check if there is an average position.
+    if hasattr(cdp, 'ave_pos_alpha'):
+        # The average position rotation.
+        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(R)
+
+        # The PDB file to rotate.
+        for i in range(len(cdp.domain_to_pdb)):
+            if cdp.domain_to_pdb[i][0] != cdp.ref_domain:
+                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/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 Mon Oct 24 23:40:02 2011