From 19c8354508f44ea94feb9b0e7e9f1862c394da7c Mon Sep 17 00:00:00 2001 From: Rami Rauch Date: Tue, 2 Dec 2008 21:29:25 +0000 Subject: [PATCH] added checking on parser Status check: if !='OK' print err message and skip the count printing --- .../htswfrontend/htsw_reports/reports.py | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/htswfrontend/htswfrontend/htsw_reports/reports.py b/htswfrontend/htswfrontend/htsw_reports/reports.py index b6496f0..0121759 100755 --- a/htswfrontend/htswfrontend/htsw_reports/reports.py +++ b/htswfrontend/htswfrontend/htsw_reports/reports.py @@ -104,11 +104,16 @@ def report1(request): else: cnt = 0 for R1 in repReads: - cnt = R1.aligned_m_reads()[1] - if cnt > 0: - str += "
" - str += "%1.2f" % (cnt/1000000.0)+" M" - else: str += "
0 Reads" + rres = R1.aligned_m_reads() + # Check data sanlty + if rres[2] != 'OK': + str += '
'+rres[2] + else: + cnt = rres[1] + if cnt > 0: + str += "
" + str += "%1.2f" % (cnt/1000000.0)+" M" + else: str += "
0 Reads" str += "
"+R1.library_id+", "+R1.condition.nickname+"
" str += "
" str += '' @@ -136,11 +141,16 @@ def report1(request): else: cnt = 0 for R1 in repReads: - cnt = R1.aligned_m_reads()[1] - if cnt > 0: - str += "
" - str += "%1.2f" % (cnt/1000000.0)+" M" - else: str += "
0 Reads" + rres = R1.aligned_m_reads() + # Check data sanlty + if rres[2] != 'OK': + str += '
'+rres[2] + else: + cnt = rres[1] + if cnt > 0: + str += "
" + str += "%1.2f" % (cnt/1000000.0)+" M" + else: str += "
0 Reads" str += "
"+R1.library_id+", "+R1.condition.nickname+"
" str += "
" str += '' @@ -239,11 +249,16 @@ def report_RM(request): #for RNA-Seq and Methyl-Seq else: cnt = 0 for R1 in repReads: - cnt = R1.aligned_m_reads()[1] - if cnt > 0: - str += "
" - str += "%1.2f" % (cnt/1000000.0)+" M" - else: str += "
0 Reads" + rres = R1.aligned_m_reads() + # Check data sanlty + if rres[2] != 'OK': + str += '
'+rres[2] + else: + cnt = rres[1] + if cnt > 0: + str += "
" + str += "%1.2f" % (cnt/1000000.0)+" M" + else: str += "
0 Reads" str += "
"+R1.library_id+", "+R1.condition.nickname+", "+R1.library_species.common_name+"
" str += "
\""+R1.library_name+"\"