mailr25722 - /branches/frame_order_cleanup/auto_analyses/frame_order.py


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

Header


Content

Posted by edward on September 09, 2014 - 19:33:
Author: bugman
Date: Tue Sep  9 19:33:39 2014
New Revision: 25722

URL: http://svn.gna.org/viewcvs/relax?rev=25722&view=rev
Log:
Added support for axis permutations in the frame order auto-analysis.

This is done by copying the data pipe of the already optimised 
pseudo-elliptic models, permuting the
axes, and performing another optimisation using all RDC and PCS data.  This 
allows the second
solution for these pseudo-elliptic models to be found.  The 2nd pipe is 
included in the model
selection step to allow the best solution for the model to be found.


Modified:
    branches/frame_order_cleanup/auto_analyses/frame_order.py

Modified: branches/frame_order_cleanup/auto_analyses/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/auto_analyses/frame_order.py?rev=25722&r1=25721&r2=25722&view=diff
==============================================================================
--- branches/frame_order_cleanup/auto_analyses/frame_order.py   (original)
+++ branches/frame_order_cleanup/auto_analyses/frame_order.py   Tue Sep  9 
19:33:39 2014
@@ -161,6 +161,66 @@
         self.interpreter.state.save('final_state', dir=self.results_dir, 
force=True)
 
 
+    def axis_permutation_analysis(self, model=None):
+        """Handle the two local minima in the pseudo-elliptic models.
+
+        This involves creating a new data pipe for the pseudo-elliptic 
models, permuting the motional parameters, and performing an optimisation.  
This will explore the second minimum.
+
+
+        @keyword model:     The frame order model to visualise.  This should 
match the model of the current data pipe, unless the special value of 'final' 
is used to indicate the visualisation of the final results.
+        @type model:        str
+        """
+
+        # The title printout.
+        title = model[0].upper() + model[1:]
+        section(file=sys.stdout, text="Axis permutation of the %s frame 
order model"%title, prespace=5)
+
+        # A new model name.
+        perm_model = "%s permuted" % model
+
+        # Copy the data pipe, and add it to the list so it is included in 
the model selection.
+        self.pipe_name_dict[perm_model] = '%s permuted - %s' % (title, 
self.pipe_bundle)
+        self.pipe_name_list.append(self.pipe_name_dict[perm_model])
+        self.interpreter.pipe.copy(pipe_from=self.pipe_name_dict[model], 
pipe_to=self.pipe_name_dict[perm_model])
+
+        # The results file already exists, so read its contents instead.
+        if self.read_results(model=perm_model, 
pipe_name=self.pipe_name_dict[perm_model]):
+            # Re-perform model elimination just in case.
+            self.interpreter.eliminate()
+
+            # The PDB representation of the model and visualisation script 
(in case this was not completed correctly).
+            self.visualisation(model=perm_model)
+
+            # Exit the function.
+            return
+
+        # Permute the axes.
+        self.interpreter.frame_order.permute_axes()
+
+        # Minimise (for the full data set).
+        opt = self.opt_full
+        for i in opt.loop_min():
+            # The numerical optimisation settings.
+            num_int_pts = opt.get_min_num_int_pts(i)
+            if num_int_pts != None:
+                self.interpreter.frame_order.num_int_pts(num=num_int_pts)
+
+            # Perform the optimisation.
+            
self.interpreter.minimise.execute(min_algor=opt.get_min_algor(i), 
func_tol=opt.get_min_func_tol(i), max_iter=opt.get_min_max_iter(i))
+
+        # Results printout.
+        self.print_results()
+
+        # Model elimination.
+        self.interpreter.eliminate()
+
+        # Save the results.
+        self.interpreter.results.write(dir=self.model_directory(perm_model), 
force=True)
+
+        # The PDB representation of the model and visualisation script.
+        self.visualisation(model=perm_model)
+
+
     def check_vars(self):
         """Check that the user has set the variables correctly."""
 
@@ -567,6 +627,10 @@
 
             # The PDB representation of the model and visualisation script.
             self.visualisation(model=model)
+
+            # Perform the axis permutation analysis.
+            if model in [MODEL_PSEUDO_ELLIPSE, 
MODEL_PSEUDO_ELLIPSE_FREE_ROTOR, MODEL_PSEUDO_ELLIPSE_TORSIONLESS]:
+                self.axis_permutation_analysis(model=model)
 
 
     def optimise_rigid(self):
@@ -809,8 +873,8 @@
         """
 
         # Sanity check.
-        if model != 'final' and model != cdp.model:
-            raise RelaxError("The model '%s' does not match the model '%s' 
of the current data pipe." % (model, cdp.model))
+        if model != 'final' and model.replace(' permuted', '') != cdp.model:
+            raise RelaxError("The model '%s' does not match the model '%s' 
of the current data pipe." % (model.replace(' permuted', ''), cdp.model))
 
         # The PDB representation of the model.
         
self.interpreter.frame_order.pdb_model(dir=self.model_directory(model), 
force=True)




Related Messages


Powered by MHonArc, Updated Tue Sep 09 19:40:02 2014