Author: bugman
Date: Fri Jan 30 18:04:44 2015
New Revision: 27402
URL: http://svn.gna.org/viewcvs/relax?rev=27402&view=rev
Log:
Implemented the data store Sequence_alignments.from_xml() method.
This method is required for being able to read RelaxListType objects from the
XML file.
Modified:
trunk/data_store/seq_align.py
Modified: trunk/data_store/seq_align.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/data_store/seq_align.py?rev=27402&r1=27401&r2=27402&view=diff
==============================================================================
--- trunk/data_store/seq_align.py (original)
+++ trunk/data_store/seq_align.py Fri Jan 30 18:04:44 2015
@@ -151,6 +151,27 @@
return self[i]
+ def from_xml(self, sequence_alignments_node, file_version=1):
+ """Recreate the analyses data structure from the XML analyses node.
+
+ @param sequence_alignments_node: The sequence alignments XML node.
+ @type sequence_alignments_node: xml.dom.minicompat.Element instance
+ @keyword file_version: The relax XML version of the XML
file.
+ @type file_version: int
+ """
+
+ # Get all the alignment nodes.
+ align_nodes =
sequence_alignments_node.getElementsByTagName('sequence_alignment')
+
+ # Loop over the nodes.
+ for node in align_nodes:
+ # Add a blank alignment container.
+ self.append(Alignment(object_ids=[]))
+
+ # Recreate the analysis container.
+ self[-1].from_xml(node, file_version=file_version)
+
+
class Alignment(Element):
"""Container for an individual sequence alignment."""
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits