mailr25795 - in /branches/frame_order_cleanup/specific_analyses/frame_order: data.py geometric.py


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

Header


Content

Posted by edward on September 12, 2014 - 15:45:
Author: bugman
Date: Fri Sep 12 15:45:45 2014
New Revision: 25795

URL: http://svn.gna.org/viewcvs/relax?rev=25795&view=rev
Log:
The frame_order.pdb_model user function can now properly handle a failed 
pivot optimisation.

This is when the pivot point optimises to a coordinate outside of the PDB 
limits.

Now all calls to specific_analyses.frame_order.data.generate_pivot() from the 
module
specific_analyses.frame_order.geometric set the pdb_limit flag to True.  This 
allows all
representation objects to be within the PDB limits.  The algorithm in 
generate_pivot() has been
extended to allow higher positive values, as the real PDB limits are 
[-999.999, 9999.999].  And a
RelaxWarning is called when the pivot is outside to tell the user about it.


Modified:
    branches/frame_order_cleanup/specific_analyses/frame_order/data.py
    branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py

Modified: branches/frame_order_cleanup/specific_analyses/frame_order/data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/data.py?rev=25795&r1=25794&r2=25795&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/data.py  
(original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/data.py  Fri 
Sep 12 15:45:45 2014
@@ -24,9 +24,11 @@
 
 # Python module imports.
 from numpy import array, float64, zeros
+from warnings import warn
 
 # relax module imports.
 from lib.errors import RelaxError
+from lib.warnings import RelaxWarning
 from lib.geometry.rotations import euler_to_R_zyz
 from pipe_control import pipes
 from pipe_control.interatomic import interatomic_loop
@@ -164,11 +166,23 @@
 
     # PDB limits.
     if pivot != None and pdb_limit:
+        # The original pivot, as text.
+        orig_pivot = "[%.3f, %.3f, %.3f]" % (pivot[0], pivot[1], pivot[2])
+
+        # Check each coordinate.
+        out = False
         for i in range(3):
-            if pivot[i] < -1000.0:
-                pivot[i] = -999.999
-            elif pivot[i] > 1000.0:
-                pivot[i] = 999.999
+            if pivot[i] <= -1000.0:
+                pivot[i] = -950.0
+                out = True
+            elif pivot[i] > 10000.0:
+                pivot[i] = 9500.0
+                out = True
+
+        # Failure.
+        if out:
+            new_pivot = "[%.3f, %.3f, %.3f]" % (pivot[0], pivot[1], pivot[2])
+            warn(RelaxWarning("The pivot point %s is outside of the PDB 
coordinate limits of [-999.999, 9999.999], shifting to %s." % (orig_pivot, 
new_pivot)))
 
     # Return the pivot.
     return pivot

Modified: 
branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py?rev=25795&r1=25794&r2=25795&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py   
  (original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py   
  Fri Sep 12 15:45:45 2014
@@ -80,8 +80,8 @@
         mol = structure.get_molecule(mol_name, model=model_nums[i])
 
         # The pivot points.
-        pivot1 = generate_pivot(order=1, sim_index=sim_indices[i])
-        pivot2 = generate_pivot(order=2, sim_index=sim_indices[i])
+        pivot1 = generate_pivot(order=1, sim_index=sim_indices[i], 
pdb_limit=True)
+        pivot2 = generate_pivot(order=2, sim_index=sim_indices[i], 
pdb_limit=True)
 
         # A single z-axis, when no rotor object is present.
         if cdp.model in [MODEL_ISO_CONE_TORSIONLESS]:
@@ -182,7 +182,7 @@
         mol = structure.get_molecule('cones', model=model_nums[i])
 
         # The 1st pivot point.
-        pivot = generate_pivot(order=1, sim_index=sim_indices[i])
+        pivot = generate_pivot(order=1, sim_index=sim_indices[i], 
pdb_limit=True)
 
         # The rotation matrix (rotation from the z-axis to the cone axis).
         R = zeros((3, 3), float64)
@@ -344,8 +344,8 @@
         T = eye(3)
 
     # The pivot points.
-    pivot1 = generate_pivot(order=1)
-    pivot2 = generate_pivot(order=2)
+    pivot1 = generate_pivot(order=1, pdb_limit=True)
+    pivot2 = generate_pivot(order=2, pdb_limit=True)
 
     # The models to loop over.
     model_nums = [None]
@@ -430,8 +430,8 @@
     # Loop over the models.
     for i in range(len(model_nums)):
         # The pivot points.
-        pivot1 = generate_pivot(order=1, sim_index=sim_indices[i])
-        pivot2 = generate_pivot(order=2, sim_index=sim_indices[i])
+        pivot1 = generate_pivot(order=1, sim_index=sim_indices[i], 
pdb_limit=True)
+        pivot2 = generate_pivot(order=2, sim_index=sim_indices[i], 
pdb_limit=True)
 
         # The single rotor models.
         if cdp.model in [MODEL_ROTOR, MODEL_FREE_ROTOR, MODEL_ISO_CONE, 
MODEL_ISO_CONE_FREE_ROTOR, MODEL_PSEUDO_ELLIPSE, 
MODEL_PSEUDO_ELLIPSE_FREE_ROTOR]:




Related Messages


Powered by MHonArc, Updated Fri Sep 12 16:00:02 2014