mailr17018 - /trunk/specific_fns/model_free/bmrb.py


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

Header


Content

Posted by edward on June 21, 2012 - 21:49:
Author: bugman
Date: Thu Jun 21 21:49:43 2012
New Revision: 17018

URL: http://svn.gna.org/viewcvs/relax?rev=17018&view=rev
Log:
Fix for reading of BMRB CSA saveframe data - spin IDs generated from the data 
now have molecule info.

This is problematic only in certain edge cases, for example a multi-molecule 
entry.


Modified:
    trunk/specific_fns/model_free/bmrb.py

Modified: trunk/specific_fns/model_free/bmrb.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/model_free/bmrb.py?rev=17018&r1=17017&r2=17018&view=diff
==============================================================================
--- trunk/specific_fns/model_free/bmrb.py (original)
+++ trunk/specific_fns/model_free/bmrb.py Thu Jun 21 21:49:43 2012
@@ -279,10 +279,20 @@
 
         # Get the entities.
         for data in star.chem_shift_anisotropy.loop():
+            # The number of spins.
+            N = bmrb.num_spins(data)
+
+            # No data in the saveframe.
+            if N == 0:
+                continue
+
+            # The molecule names.
+            mol_names = bmrb.molecule_names(data, N)
+
             # Loop over the spins.
             for i in range(len(data['data_ids'])):
                 # Generate a spin ID.
-                spin_id = 
mol_res_spin.generate_spin_id(res_num=data['res_nums'][i], 
spin_name=data['atom_names'][i])
+                spin_id = 
mol_res_spin.generate_spin_id(mol_name=mol_names[i], 
res_num=data['res_nums'][i], spin_name=data['atom_names'][i])
 
                 # Obtain the spin.
                 spin = mol_res_spin.return_spin(spin_id)




Related Messages


Powered by MHonArc, Updated Thu Jun 21 22:20:02 2012