mailr6716 - /branches/rdc_analysis/generic_fns/structure/internal.py


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

Header


Content

Posted by edward on July 05, 2008 - 01:48:
Author: bugman
Date: Sat Jul  5 01:48:08 2008
New Revision: 6716

URL: http://svn.gna.org/viewcvs/relax?rev=6716&view=rev
Log:
Fix for the atom_connect() method and the creation of the CONECT record.

The atom_connect() method was modified to only append the atom index if it 
wasn't already in the
bonded list.  The CONECT record now uses the atom numbers and not atom 
indecies.


Modified:
    branches/rdc_analysis/generic_fns/structure/internal.py

Modified: branches/rdc_analysis/generic_fns/structure/internal.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/structure/internal.py?rev=6716&r1=6715&r2=6716&view=diff
==============================================================================
--- branches/rdc_analysis/generic_fns/structure/internal.py (original)
+++ branches/rdc_analysis/generic_fns/structure/internal.py Sat Jul  5 
01:48:08 2008
@@ -453,9 +453,11 @@
             if struct_index != None and struct_index != i:
                 continue
 
-            # Update the bonded array structure.
-            self.structural_data[i].bonded[index1].append(index2)
-            self.structural_data[i].bonded[index2].append(index1)
+            # Update the bonded array structure, if necessary.
+            if index2 not in self.structural_data[i].bonded[index1]:
+                self.structural_data[i].bonded[index1].append(index2)
+            if index1 not in self.structural_data[i].bonded[index2]:
+                self.structural_data[i].bonded[index2].append(index1)
 
 
     def atom_loop(self, atom_id=None, str_id=None, model_num_flag=False, 
mol_name_flag=False, res_num_flag=False, res_name_flag=False, 
atom_num_flag=False, atom_name_flag=False, element_flag=False, 
pos_flag=False, ave=False):
@@ -894,7 +896,7 @@
                     # Generate the CONECT record and increment the counter.
                     if flush:
                         # Write the CONECT record.
-                        file.write("%-6s%5s%5s%5s%5s%5s%5s%5s%5s%5s%5s%5s\n" 
% ('CONECT', i+1, bonded[0], bonded[1], bonded[2], bonded[3], '', '', '', '', 
'', ''))
+                        file.write("%-6s%5s%5s%5s%5s%5s%5s%5s%5s%5s%5s%5s\n" 
% ('CONECT', i+1, struct.atom_num[bonded[0]], struct.atom_num[bonded[1]], 
struct.atom_num[bonded[2]], struct.atom_num[bonded[3]], '', '', '', '', '', 
''))
 
                         # Increment the CONECT record count.
                         connect_count = connect_count + 1




Related Messages


Powered by MHonArc, Updated Sat Jul 05 02:00:19 2008