From a866cce7392c7704fbef8d293d371ee4d07d83df Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 15 Jul 2008 00:26:48 +0000 Subject: [PATCH] Provide cross referencing information to the libraries to help find which lanes provide supporting information --- gaworkflow/util/fctracker.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gaworkflow/util/fctracker.py b/gaworkflow/util/fctracker.py index 17fefb6..2f07dce 100644 --- a/gaworkflow/util/fctracker.py +++ b/gaworkflow/util/fctracker.py @@ -6,6 +6,7 @@ installed, so it can run on machines other than the webserver. """ import datetime import os +import re import sys import time @@ -61,6 +62,20 @@ class fctracker: c.close() return table + def _add_lanes_to_libraries(self): + """ + add flowcell/lane ids to new attribute 'lanes' in the library dictionary + """ + library_id_re = re.compile('lane_\d_library_id') + + for fc_id, fc in self.flowcells.items(): + lane_library = [ (x[0][5], x[1]) for x in fc.items() + if library_id_re.match(x[0]) ] + for lane, library_id in lane_library: + if not self.library[library_id].has_key('lanes'): + self.library[library_id]['lanes'] = [] + self.library[library_id]['lanes'].append((fc_id, lane)) + def _get_library(self): """ attach the library dictionary to the instance @@ -106,6 +121,8 @@ class fctracker: run_date = datetime.datetime(*run_date[:6]) row_dict['run_date'] = run_date self.flowcells[row_dict['flowcell_id']] = row_dict + + self._add_lanes_to_libraries() return self.flowcells def recoverable_drive_report(flowcells): @@ -152,3 +169,4 @@ def recoverable_drive_report(flowcells): } report.append(line % (fields)) return os.linesep.join(report) + -- 2.30.2