Add load_pipeline_run_xml, a little function that feeds the xml file into
authorDiane Trout <diane@caltech.edu>
Thu, 12 Feb 2009 22:37:08 +0000 (22:37 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 12 Feb 2009 22:37:08 +0000 (22:37 +0000)
ElementTree and grabs the useful root

htsworkflow/pipelines/runfolder.py

index 10eeee1ccef5d1e7fda2c4100af01713d74910cd..3c765ae8ab25b148bc37238ad621f0f9b148711f 100644 (file)
@@ -136,6 +136,19 @@ class PipelineRun(object):
         tree = ElementTree.parse(filename).getroot()
         self.set_elements(tree)
 
+def load_pipeline_run_xml(pathname):
+    """
+    Load and instantiate a Pipeline run from a run xml file
+
+    :Parameters: 
+      - `pathname` : location of an run xml file
+
+    :Returns: initialized PipelineRun object
+    """
+    tree = ElementTree.parse(pathname).getroot()
+    run = PipelineRun(xml=tree)
+    return run
+
 def get_runs(runfolder):
     """
     Search through a run folder for all the various sub component runs