mailr6437 - in /1.3/data: mol_res_spin.py pipe_container.py


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

Header


Content

Posted by edward on June 22, 2008 - 19:30:
Author: bugman
Date: Sun Jun 22 19:30:30 2008
New Revision: 6437

URL: http://svn.gna.org/viewcvs/relax?rev=6437&view=rev
Log:
Added molecular information to the XML results file.


Modified:
    1.3/data/mol_res_spin.py
    1.3/data/pipe_container.py

Modified: 1.3/data/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/mol_res_spin.py?rev=6437&r1=6436&r2=6437&view=diff
==============================================================================
--- 1.3/data/mol_res_spin.py (original)
+++ 1.3/data/mol_res_spin.py Sun Jun 22 19:30:30 2008
@@ -27,6 +27,7 @@
 # relax module imports.
 from prototype import Prototype
 from relax_errors import RelaxError
+from relax_xml import fill_object_contents
 
 
 """The molecule-residue-spin containers."""
@@ -484,3 +485,27 @@
 
         # Otherwise.
         return False
+
+
+    def xml_create_element(self, doc, element):
+        """Create an XML elements for each molecule.
+
+        @param doc:     The XML document object.
+        @type doc:      xml.dom.minidom.Document instance
+        @param element: The element to add the molecule XML elements to.
+        @type element:  XML element object
+        """
+
+        # Loop over the molecules.
+        for i in xrange(len(self)):
+            # Create an XML element for this molecule and add it to the 
higher level element.
+            mol_element = doc.createElement('mol')
+            element.appendChild(mol_element)
+
+            # Set the molecule attributes.
+            mol_element.setAttribute('name', self[i].name)
+            mol_element.setAttribute('index', `i`)
+            mol_element.setAttribute('desc', 'Molecule')
+
+            # Add all simple python objects within the MoleculeContainer to 
the XML element.
+            fill_object_contents(doc, mol_element, object=self[i], 
blacklist=['name', 'res'] + self[i].__class__.__dict__.keys())

Modified: 1.3/data/pipe_container.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/pipe_container.py?rev=6437&r1=6436&r2=6437&view=diff
==============================================================================
--- 1.3/data/pipe_container.py (original)
+++ 1.3/data/pipe_container.py Sun Jun 22 19:30:30 2008
@@ -186,6 +186,9 @@
         if hasattr(self, 'structure'):
             self.xml_create_str_element(doc, element)
 
+        # Add the molecule-residue-spin data.
+        self.mol.xml_create_element(doc, element)
+
 
     def xml_create_str_elem(doc, element):
         """Create an XML element for the structural information.




Related Messages


Powered by MHonArc, Updated Sun Jun 22 19:40:12 2008