mailr5891 - /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 21, 2008 - 00:29:
Author: bugman
Date: Mon Apr 21 00:24:21 2008
New Revision: 5891

URL: http://svn.gna.org/viewcvs/relax?rev=5891&view=rev
Log:
The Scientific_data.attached_atom() method now returns the atom information.


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=5891&r1=5890&r2=5891&view=diff
==============================================================================
--- 1.3/generic_fns/structure/scientific.py (original)
+++ 1.3/generic_fns/structure/scientific.py Mon Apr 21 00:24:21 2008
@@ -262,13 +262,25 @@
                 for res, res_num, res_name in self.__residue_loop(mol, 
mol_type, sel_obj):
                     # Loop over the atoms of the residue.
                     for atom in res:
+                        # Atom number, name, and position.
+                        atom_num = atom.properties['serial_number']
+                        atom_name = atom.name
+                        element = atom.properties['element']
+                        pos = atom.position.array
+
                         # Skip non-matching atoms.
-                        if sel_obj and not 
sel_obj.contains_spin(atom.properties['serial_number'], atom.name, res_num, 
res_name, mol_name):
+                        if sel_obj and not sel_obj.contains_spin(atom_num, 
atom_name, res_num, res_name, mol_name):
                             continue
 
                         # More than one matching atom!
                         if atom_found:
                             raise RelaxError, "The atom_id argument " + 
`atom_id` + " must correspond to a single atom."
+
+        # Return the atom info.
+        if atom_found:
+            return atom_num, atom_name, element, pos
+        else:
+            return None, None, None, None
 
 
     def load_structures(self, file_path, model=None, verbosity=False):




Related Messages


Powered by MHonArc, Updated Mon Apr 21 00:40:27 2008