From 01a87014e57b568f4a6c330342c50d68b7d78b57 Mon Sep 17 00:00:00 2001 From: Rami Rauch Date: Sat, 25 Apr 2009 00:03:34 +0000 Subject: [PATCH] added: assembles reads count per Lane, besides total per Flowcell, for the ByFlowcell parse-query --- htswfrontend/htswfrontend/htsw_reports/libinfopar.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htswfrontend/htswfrontend/htsw_reports/libinfopar.py b/htswfrontend/htswfrontend/htsw_reports/libinfopar.py index 6d46880..8c5f0c5 100644 --- a/htswfrontend/htswfrontend/htsw_reports/libinfopar.py +++ b/htswfrontend/htswfrontend/htsw_reports/libinfopar.py @@ -25,7 +25,7 @@ class LibInfoHandler(ContentHandler): self.Msg = 'OK' def startElement(self, name, attrs): - try: + try: if name == 'Library': self.currlibid = attrs.get('Name',"") elif name == 'Track' and self.searchTerm == self.currlibid: @@ -44,7 +44,7 @@ class LibInfoHandler(ContentHandler): class LibInfoHandlerByFlowCell(ContentHandler): def __init__ (self, searchTerm): self.searchTerm = searchTerm - self.LanesCount, self.ReadsCount = 0, 0 + self.LanesCount, self.ReadsCount, self.LaneReadsCount = 0, 0, [0,0,0,0,0,0,0,0] self.Msg = 'OK' def startElement(self, name, attrs): @@ -52,6 +52,8 @@ class LibInfoHandlerByFlowCell(ContentHandler): if name == 'Track' and attrs.get('Flowcell',"") == self.searchTerm: self.LanesCount += len(attrs.get('Lane',"")) self.ReadsCount += int(attrs.get('Count',"")) + self.LaneReadsCount[int(attrs.get('Lane',""))-1] += int(attrs.get('Count',"")) + except: self.Msg = 'failed parsing xml file' return @@ -76,6 +78,9 @@ def getLibReads(search_term,search_by): arRes = [] arRes.append(curHandler.LanesCount) arRes.append(curHandler.ReadsCount) + + if search_by == 'ByFC': arRes.append(curHandler.LaneReadsCount) + arRes.append(curHandler.Msg) return arRes -- 2.30.2