mailr5583 - /1.3/generic_fns/structure/scientific.py


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

Header


Content

Posted by edward on April 11, 2008 - 14:53:
Author: bugman
Date: Fri Apr 11 14:53:13 2008
New Revision: 5583

URL: http://svn.gna.org/viewcvs/relax?rev=5583&view=rev
Log:
A few fixes for the atom_loop() structural API method (for Scientific).


Modified:
    1.3/generic_fns/structure/scientific.py

Modified: 1.3/generic_fns/structure/scientific.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/scientific.py?rev=5583&r1=5582&r2=5583&view=diff
==============================================================================
--- 1.3/generic_fns/structure/scientific.py (original)
+++ 1.3/generic_fns/structure/scientific.py Fri Apr 11 14:53:13 2008
@@ -107,21 +107,22 @@
 
             # Other molecules.
             elif struct.molecules:
-                for mol in struct.molecules:
-                    comps.append(mol)
-                    molecule.append('other')
+                for key in struct.molecules:
+                    for mol in struct.molecules[key]:
+                        comps.append(mol)
+                        molecule.append(key)
 
             # We have a problem!
             else:
                 raise RelaxNoPdbChainError
 
             # Loop over each individual molecules.
-            for mol in comps:
+            for i in xrange(len(comps)):
                 # The molecule name.
-                if mol.chain_id:
-                    mol_name = chain.chain_id
-                elif chain.segment_id:
-                    mol_name = chain.segment_id
+                if hasattr(comps[i], 'chain_id') and comps[i].chain_id:
+                    mol_name = comps[i].chain_id
+                elif hasattr(comps[i], 'segment_id') and comps[i].segment_id:
+                    mol_name = comps[i].segment_id
                 else:
                     mol_name = None
 
@@ -130,7 +131,7 @@
                     continue
 
                 # Loop over the residues of the protein in the PDB file.
-                for res in chain.residues:
+                for res in comps[i].residues:
                     # Residue number and name.
                     if molecule == 'nucleic acid':
                         res_name = res.name[-1]




Related Messages


Powered by MHonArc, Updated Fri Apr 11 16:40:10 2008