mailr12484 - /branches/bmrb/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 February 01, 2011 - 15:51:
Author: bugman
Date: Tue Feb  1 15:51:49 2011
New Revision: 12484

URL: http://svn.gna.org/viewcvs/relax?rev=12484&view=rev
Log:
The molecule number from EntityID is now being used to fill in the model-free 
data.

This is necessary for multiple molecule entries in BMRB files.


Modified:
    branches/bmrb/specific_fns/model_free/bmrb.py

Modified: branches/bmrb/specific_fns/model_free/bmrb.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/specific_fns/model_free/bmrb.py?rev=12484&r1=12483&r2=12484&view=diff
==============================================================================
--- branches/bmrb/specific_fns/model_free/bmrb.py (original)
+++ branches/bmrb/specific_fns/model_free/bmrb.py Tue Feb  1 15:51:49 2011
@@ -134,18 +134,29 @@
             if N == 0:
                 continue
 
+            # The molecule index and name.
+            if 'entity_ids' in keys:
+                mol_index = []
+                for i in range(N):
+                    mol_index.append(int(data['entity_ids'][i]) -1 )
+            else:
+                mol_index = [0]*N
+            mol_names = []
+            for i in range(N):
+                mol_names.append(cdp.mol[mol_index[i]].name)
+
             # Generate the spin IDs.
             spin_ids = []
             for i in range(N):
-                
spin_ids.append(mol_res_spin.generate_spin_id(res_num=data['res_nums'][i], 
spin_name=data['atom_names'][i]))
+                
spin_ids.append(mol_res_spin.generate_spin_id(mol_name=mol_names[i], 
res_num=data['res_nums'][i], spin_name=data['atom_names'][i]))
 
             # Generate the sequence if needed.
-            generate_sequence(N, spin_ids=spin_ids, 
spin_names=data['atom_names'], res_nums=data['res_nums'], 
res_names=data['res_names'])
+            generate_sequence(N, spin_ids=spin_ids, 
spin_names=data['atom_names'], res_nums=data['res_nums'], 
res_names=data['res_names'], mol_names=mol_names)
 
             # Loop over the spins.
             for i in range(N):
                 # Generate a spin ID.
-                spin_id = 
mol_res_spin.generate_spin_id(res_name=data['res_names'][i], 
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_name=data['res_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 Tue Feb 01 16:40:01 2011