From 2078a8ad53370bbe1ef08a573f7ee800a71b4937 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 18 Aug 2009 22:34:31 +0000 Subject: [PATCH] Fix code where the python str() function had been overridden with a string named str. --- htsworkflow/frontend/reports/reports.py | 100 ++++++++++++------------ 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/htsworkflow/frontend/reports/reports.py b/htsworkflow/frontend/reports/reports.py index 30d9ad4..18cd328 100755 --- a/htsworkflow/frontend/reports/reports.py +++ b/htsworkflow/frontend/reports/reports.py @@ -38,7 +38,7 @@ def report1(request): AFL = 'ENCODE_Tier1' AFL_CNT = '' try: - AFL_Id = Affiliation.objects.get(name=AFL,contact=AFL_CNT).id.__str__() + AFL_Id = str(Affiliation.objects.get(name=AFL).id) except ObjectDoesNotExist: return HttpResponse("ERROR: Affiliation Record Not Found for: '"+AFL+"'") @@ -54,113 +54,117 @@ def report1(request): if len(RepRecs) > 0: Reps = RepRecs[0].replicate ######## - str = '' - str += 'Main Page' - ##str += 'Max Replicates: '+MaxRep.replicate.__str__()+'' - str += 'Select another '+EXP+' Report: '] for af in Affiliation.objects.distinct(): - str += '' - str += '' + option = [] + option += [''] + s += option + s += [''] - str += 'color scheme: > 12 M > 5 M > 3 M < 3 M' + s += ['color scheme: > 12 M > 5 M > 3 M < 3 M'] - str += '' - str += 'Switch to: '+AFL+' '+AFL_CNT+' RNA-Seq Report' - str += ' | ' - str += 'Methyl-Seq Report' + s += [''] + s += ['Switch to: '+AFL+' '+AFL_CNT+' RNA-Seq Report'] + s += [' | '] + s += ['Methyl-Seq Report'] bgc = '#ffffff' pbgc = '#f7f7f7' - str += '

' - str += '' - str += '' + s += ['

PROJECT'+AFL+' '+AFL_CNT+' '+EXP+'
CELL LINE
'] + s += [''] + s += [''] for H in CLLs: - str += '' + s += [''] tbgc = bgc bgc = pbgc pbgc = tbgc - str += '' + s += [''] bgc = '#ffffff' pbgc = '#f7f7f7' for H in CLLs: for r in range(1,Reps+1): - str += '' + s += [''] tbgc = bgc bgc = pbgc pbgc = tbgc - str += '' - str += '' + s += [''] + s += [''] bgc = '#ffffff' pbgc = '#f7f7f7' for H in CLLs: for r in range(1,Reps+1): repReads = Library.objects.filter(experiment_type='INPUT_RXLCh',affiliations__name=AFL,affiliations__contact=AFL_CNT,cell_line=H['cell_line'].__str__(),replicate=r) - str += "' + s += ["
"] + s += ["%1.2f" % (cnt/1000000.0)+" M"] + else: + s += ["
0 Reads"] + s += ["
"+R1.library_id+", "+R1.condition.nickname+"
"] + s += ["
"] + s += [''] tbgc = bgc bgc = pbgc pbgc = tbgc - str += '
' + s += ['' ] for T in TFs: - str += '' + s += [''] try: if T['antibody']: - str += '' + s += [''] except Antibody.DoesNotExist: - str += '' + s += [''] bgc = '#ffffff' pbgc = '#f7f7f7' for H in CLLs: for r in range(1,Reps+1): repReads = Library.objects.filter(experiment_type=EXP,affiliations__name=AFL,affiliations__contact=AFL_CNT,cell_line=H['cell_line'].__str__(),antibody=T['antibody'].__str__(),replicate=r) - str += "' + s += ["
"] + s += "%1.2f" % (cnt/1000000.0)+" M" + else: + s += ["
0 Reads"] + s += ["
"+R1.library_id+", "+R1.condition.nickname+"
"] + s += ["
"] + s += [''] tbgc = bgc bgc = pbgc pbgc = tbgc - str += '
' - str += '
PROJECT'+AFL+' '+AFL_CNT+' '+EXP+'
CELL LINE'+Cellline.objects.get(id=H['cell_line']).cellline_name+''+Cellline.objects.get(id=H['cell_line']).cellline_name+'
TF
TFRep. '+r.__str__()+'Rep. '+r.__str__()+'
Total Chromatin
Total Chromatin" + s += [""] if len(repReads) == 0: - str += 'No Libraries' + s += ['No Libraries'] else: cnt = 0 for R1 in repReads: rres = R1.aligned_m_reads() # Check data sanlty if rres[2] != 'OK': - str += '
'+rres[2] + s += ['
'+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 += '
'+Antibody.objects.get(id=T['antibody']).nickname+''+Antibody.objects.get(id=T['antibody']).nickname+'n/an/a" + s += [""] if len(repReads) == 0: - str += 'No Libraries' + s += ['No Libraries'] else: cnt = 0 for R1 in repReads: rres = R1.aligned_m_reads() # Check data sanlty if rres[2] != 'OK': - str += '
'+rres[2] + s += ['
'+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 += '
' + s += [''] + s += [''] - return render_to_response('reports/report.html',{'main': str}) + return render_to_response('reports/report.html',{'main': "\n".join(s)}) def report_RM(request): #for RNA-Seq and Methyl-Seq -- 2.30.2