From 8172b45ee7af8edd6a1fe1e4892d5cc0c97fde54 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 29 May 2008 00:01:50 +0000 Subject: [PATCH] Some of the older flow cells used a default genome for eland instead of specifying the genome path for each lane. This patch will look up in the chipwidedefaults for the eland_genome if it isn't found in the lane specific parameters --- gaworkflow/pipeline/gerald.py | 15 +++++++++++---- gaworkflow/pipeline/runfolder.py | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gaworkflow/pipeline/gerald.py b/gaworkflow/pipeline/gerald.py index 1a6bce1..f4f0cbc 100644 --- a/gaworkflow/pipeline/gerald.py +++ b/gaworkflow/pipeline/gerald.py @@ -36,12 +36,12 @@ class Gerald(object): def __get_attribute(self, xml_tag): subtree = self._gerald.tree.find('LaneSpecificRunParameters') container = subtree.find(xml_tag) - if container is None or \ - len(container.getchildren()) != LANES_PER_FLOWCELL: + if container is None: + return None + if len(container.getchildren()) != LANES_PER_FLOWCELL: raise RuntimeError('GERALD config.xml file changed') lanes = [x.tag.split('_')[1] for x in container.getchildren()] index = lanes.index(self._key) - #element = container.find(self._key) element = container[index] return element.text def _get_analysis(self): @@ -49,7 +49,14 @@ class Gerald(object): analysis = property(_get_analysis) def _get_eland_genome(self): - return self.__get_attribute('ELAND_GENOME') + genome = self.__get_attribute('ELAND_GENOME') + # default to the chipwide parameters if there isn't an + # entry in the lane specific paramaters + if genome is None: + subtree = self._gerald.tree.find('ChipWideRunParameters') + container = subtree.find('ELAND_GENOME') + genome = container.text + return genome eland_genome = property(_get_eland_genome) def _get_read_length(self): diff --git a/gaworkflow/pipeline/runfolder.py b/gaworkflow/pipeline/runfolder.py index 1219627..19962b1 100644 --- a/gaworkflow/pipeline/runfolder.py +++ b/gaworkflow/pipeline/runfolder.py @@ -33,7 +33,7 @@ class PipelineRun(object): FLOWCELL_ID = 'FlowcellID' def __init__(self, pathname=None, firecrest=None, bustard=None, gerald=None, xml=None): - self.pathname = pathname + self.pathname = os.path.normpath(pathname) self._name = None self._flowcell_id = None self.firecrest = firecrest @@ -60,7 +60,7 @@ class PipelineRun(object): flowcell_id = 'unknown' logging.warning( - "Flowcell idwas not found, guessing %s" % ( + "Flowcell id was not found, guessing %s" % ( flowcell_id)) self._flowcell_id = flowcell_id return self._flowcell_id -- 2.30.2