mailr18031 - /trunk/generic_fns/structure/geometric.py


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

Header


Content

Posted by edward on November 26, 2012 - 12:21:
Author: bugman
Date: Mon Nov 26 12:21:05 2012
New Revision: 18031

URL: http://svn.gna.org/viewcvs/relax?rev=18031&view=rev
Log:
The axis for PDB geometric cone can now be turned off in the 
create_cone_pdb() function.

The axis_flag keyword argument is now accepted and if False will cause the 
axis to be excluded.
This is useful for the frame order cones for example as its own {x,y,z}-axis 
system is created.


Modified:
    trunk/generic_fns/structure/geometric.py

Modified: trunk/generic_fns/structure/geometric.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/geometric.py?rev=18031&r1=18030&r2=18031&view=diff
==============================================================================
--- trunk/generic_fns/structure/geometric.py (original)
+++ trunk/generic_fns/structure/geometric.py Mon Nov 26 12:21:05 2012
@@ -313,7 +313,7 @@
     mol.atom_connect(index1=atom_num-2, index2=origin_atom)
 
 
-def create_cone_pdb(mol=None, cone=None, start_res=1, apex=None, axis=None, 
R=None, inc=None, scale=30.0, distribution='regular', file=None, dir=None, 
force=False):
+def create_cone_pdb(mol=None, cone=None, start_res=1, apex=None, axis=None, 
R=None, inc=None, scale=30.0, distribution='regular', file=None, dir=None, 
force=False, axis_flag=True):
     """Create a PDB representation of the given cone object.
 
     @keyword mol:           The molecule container.
@@ -340,6 +340,8 @@
     @type dir:              str
     @param force:           Flag which if set to True will overwrite any 
pre-existing file.
     @type force:            bool
+    @keyword axis_flag:     A flag which if True will create the cone's axis.
+    @type axis_flag:        bool
     """
 
     # The cone axis default of the z-axis.
@@ -366,12 +368,14 @@
     if hasattr(mol, 'atom_num'):
         start_atom = mol.atom_num[-1]+1
 
-    # Add the apex.
-    mol.atom_add(pdb_record='HETATM', atom_num=start_atom, atom_name='R', 
res_name='APX', res_num=start_res, pos=apex, element='C')
-
-    # Generate the axis vectors.
-    print("\nGenerating the axis vectors.")
-    res_num = generate_vector_residues(mol=mol, vector=dot(R, axis), 
atom_name='Axis', res_name_vect='AXE', res_num=start_res+1, origin=apex, 
scale=scale)
+    # The axis.
+    if axis_flag:
+        # Add the apex.
+        mol.atom_add(pdb_record='HETATM', atom_num=start_atom, 
atom_name='R', res_name='APX', res_num=start_res, pos=apex, element='C')
+
+        # Generate the axis vectors.
+        print("\nGenerating the axis vectors.")
+        res_num = generate_vector_residues(mol=mol, vector=dot(R, axis), 
atom_name='Axis', res_name_vect='AXE', res_num=start_res+1, origin=apex, 
scale=scale)
 
     # Generate the cone outer edge.
     print("\nGenerating the cone outer edge.")




Related Messages


Powered by MHonArc, Updated Mon Nov 26 12:40:02 2012