mailr24837 - /trunk/pipe_control/structure/mass.py


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

Header


Content

Posted by edward on July 30, 2014 - 17:01:
Author: bugman
Date: Wed Jul 30 17:01:58 2014
New Revision: 24837

URL: http://svn.gna.org/viewcvs/relax?rev=24837&view=rev
Log:
Changed the behaviour of the 
pipe_control.structure.mass.pipe_centre_of_mass() function.

This function returns the CoM and optionally the mass of the structural data 
loaded into the current
data pipe.  However it was matching the structural data to the 
molecule-residue-spin data structure
and skipping spins that were deselected.  This illogical deselection part has 
been eliminated, as
spins can be deselected for various analysis purposes and this should not 
change the CoM.  The
deletion also significantly speeds up the function.


Modified:
    trunk/pipe_control/structure/mass.py

Modified: trunk/pipe_control/structure/mass.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/mass.py?rev=24837&r1=24836&r2=24837&view=diff
==============================================================================
--- trunk/pipe_control/structure/mass.py        (original)
+++ trunk/pipe_control/structure/mass.py        Wed Jul 30 17:01:58 2014
@@ -26,8 +26,6 @@
 from lib.errors import RelaxNoPdbError
 from lib.structure.mass import centre_of_mass
 from lib.warnings import RelaxWarning
-from pipe_control.mol_res_spin import return_molecule, return_residue, 
return_spin
-
 
 
 def pipe_centre_of_mass(atom_id=None, model=None, return_mass=False, 
verbosity=1):
@@ -53,33 +51,20 @@
     coord = []
     element_list = []
     for mol_name, res_num, res_name, atom_num, atom_name, element, pos in 
cdp.structure.atom_loop(atom_id=atom_id, model_num=model, mol_name_flag=True, 
res_num_flag=True, res_name_flag=True, atom_num_flag=True, 
atom_name_flag=True, element_flag=True, pos_flag=True, ave=True):
-        # Initialise the spin id string.
+        # Initialise the spin 
         id = ''
 
         # Get the corresponding molecule container.
-        if mol_name == None:
-            mol_cont = cdp.mol[0]
-        else:
+        if mol_name != None:
             id = id + '#' + mol_name
-            mol_cont = return_molecule(id)
 
         # Get the corresponding residue container.
-        if res_name == None and res_num == None:
-            res_cont = mol_cont.res[0]
-        else:
+        if res_num != None:
             id = id + ':' + repr(res_num)
-            res_cont = return_residue(id)
 
         # Get the corresponding spin container.
-        if atom_name == None and atom_num == None:
-            spin_cont = res_cont.spin[0]
-        else:
+        if atom_num != None:
             id = id + '@' + repr(atom_num)
-            spin_cont = return_spin(id)
-
-        # Deselected spins.
-        if spin_cont and not spin_cont.select:
-            continue
 
         # No element?
         if element == None:




Related Messages


Powered by MHonArc, Updated Wed Jul 30 17:20:03 2014