mailr5038 - /branches/N_state_model/specific_fns/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 20, 2008 - 09:50:
Author: bugman
Date: Wed Feb 20 09:50:38 2008
New Revision: 5038

URL: http://svn.gna.org/viewcvs/relax?rev=5038&view=rev
Log:
Started writing the N-state model cone_pdb() method.


Modified:
    branches/N_state_model/specific_fns/n_state_model.py

Modified: branches/N_state_model/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=5038&r1=5037&r2=5038&view=diff
==============================================================================
--- branches/N_state_model/specific_fns/n_state_model.py (original)
+++ branches/N_state_model/specific_fns/n_state_model.py Wed Feb 20 09:50:38 
2008
@@ -166,6 +166,44 @@
         print "%-40s %.5f rad (%.5f deg)" % ("Cone angle (diffusion in a 
cone)", cdp.theta_diff_in_cone, cdp.theta_diff_in_cone / (2*pi) *360.)
         print "%-40s S_cone = %.5f (S^2 = %.5f)" % ("S_cone (diffusion in a 
cone)", cdp.S_diff_in_cone, cdp.S_diff_in_cone**2)
         print "\n\n"
+
+
+    def cone_pdb(self, cone_type=None, scale=1.0, file=None, dir=None, 
force=False):
+        """Create a PDB file containing a geometric object representing the 
various cone models.
+
+        Currently the only cone types supported are 'diff_in_cone' and 
'diff_on_cone'.
+
+
+        @param cone_type:   The type of cone model to represent.
+        @type cone_type:    str
+        @param scale:       The size of the geometric object is eqaul to the 
average pivot-CoM
+                            vector length multiplied by this scaling factor.
+        @type scale:        float
+        @param file:        The name of the PDB file to create.
+        @type file:         str
+        @param dir:         The name of the directory to place the PDB file 
into.
+        @type dir:          str
+        @param force:       Flag which if set to True will cause any 
pre-existing file to be
+                            overwritten.
+        @type force:        int
+        """
+
+        # Alias the current data pipe.
+        cdp = relax_data_store[relax_data_store.current_pipe]
+
+        # Test if the cone models have been determined.
+        if cone_type == 'diff_in_cone' and not hasattr(cdp, 
'S_diff_in_cone'):
+            raise RelaxError, "The diffusion in a cone model has not yet 
been determined."
+        elif cone_type == 'diff_on_cone' and not hasattr(cdp, 
'S_diff_on_cone'):
+            raise RelaxError, "The diffusion on a cone model has not yet 
been determined."
+
+        # Initialise the atom and atomic connections data structures.
+        atomic_data = {}
+
+        # Add the pivot point.
+        generic_fns.structure.atom_add(atomic_data=atomic_data, atom_id='R', 
record_name='HETATM', atom_name='R', res_name='PIV', res_num=1, 
pos=cdp.pivot_point, element='C')
+
+        print `atomic_data`
 
 
     def default_value(self, param):




Related Messages


Powered by MHonArc, Updated Wed Feb 20 10:00:43 2008