mailr4963 - /branches/N_state_model/prompt/n_state_model.py


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

Header


Content

Posted by edward on February 13, 2008 - 09:10:
Author: bugman
Date: Wed Feb 13 09:10:29 2008
New Revision: 4963

URL: http://svn.gna.org/viewcvs/relax?rev=4963&view=rev
Log:
Wrote the interface for the n_state_model.CoM() user function.


Modified:
    branches/N_state_model/prompt/n_state_model.py

Modified: branches/N_state_model/prompt/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/prompt/n_state_model.py?rev=4963&r1=4962&r2=4963&view=diff
==============================================================================
--- branches/N_state_model/prompt/n_state_model.py (original)
+++ branches/N_state_model/prompt/n_state_model.py Wed Feb 13 09:10:29 2008
@@ -40,6 +40,60 @@
 
         # Place relax in the class namespace.
         self.__relax__ = relax
+
+
+    def CoM(self, centre=None):
+        """Set the centre of mass (CoM) for the moving domain.
+
+        Keyword Arguments
+        ~~~~~~~~~~~~~~~~~
+
+        centre:  The optional argument for manually specifying the CoM.
+
+
+        Description
+        ~~~~~~~~~~~
+
+        Prior to the calculation of the pivot to centre of mass (pivot-CoM) 
order parameter and
+        subsequent cone of motions, both the pivot point and centre of mass 
must be specified.  This
+        function is used to calculate the centre of mass from the selected 
parts of the structure
+        previously loaded.  That is unless the centre keyword argument has 
been supplied, in which
+        case this vector floating point numbers (of length 3) will be used 
as the CoM.
+
+
+        Examples
+        ~~~~~~~~
+
+        To set the CoM to the N-terminal domain of a previously loaded PDB 
file (the C-terminal
+        domain has been deselected), type:
+
+        relax> n_state_model.CoM()
+
+
+        To set the CoM to the position [0, 0, 1], type one of:
+
+        relax> n_state_model.CoM([0, 0, 1])
+        relax> n_state_model.CoM([0.0, 0.0, 1.0])
+        relax> n_state_model.CoM(centre=[0.0, 0.0, 1.0])
+        """
+
+        # Function intro text.
+        if self.__relax__.interpreter.intro:
+            text = sys.ps3 + "n_state_model.CoM("
+            text = text + "centre=" + `centre` + ")"
+            print text
+
+        # CoM argument.
+        if type(centre) != list:
+            raise RelaxListError, ('centre', centre)
+        if len(centre) != 3:
+            raise RelaxLenError, ("centre of mass", 3)
+        for i in xrange(len(centre)):
+            if type(centre[i]) != int and type(centre[i]) != float:
+                raise RelaxListNumError, ('centre of mass', centre)
+
+        # Execute the functional code.
+        n_state_model_obj.CoM(centre=centre)
 
 
     def model(self, N=None, ref=None):




Related Messages


Powered by MHonArc, Updated Wed Feb 13 09:20:37 2008