From: Diane Trout Date: Thu, 12 Feb 2009 22:37:08 +0000 (+0000) Subject: Add load_pipeline_run_xml, a little function that feeds the xml file into X-Git-Tag: 0.2.0.1~27 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=0f97f11c0c24b1efe58fbbe226ddef4a17c31153 Add load_pipeline_run_xml, a little function that feeds the xml file into ElementTree and grabs the useful root --- diff --git a/htsworkflow/pipelines/runfolder.py b/htsworkflow/pipelines/runfolder.py index 10eeee1..3c765ae 100644 --- a/htsworkflow/pipelines/runfolder.py +++ b/htsworkflow/pipelines/runfolder.py @@ -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