(no commit message) htsworkflow
authorRami Rauch <rrauch@stanford.edu>
Thu, 6 Aug 2009 18:56:54 +0000 (18:56 +0000)
committerRami Rauch <rrauch@stanford.edu>
Thu, 6 Aug 2009 18:56:54 +0000 (18:56 +0000)
htswfrontend/htswfrontend/htsw_reports/reports.py

index 88db4ab7439c264d5831016d52ba70f57ad4ae34..066c06b3719c87409723e0b5abfbfaebcf77349b 100755 (executable)
@@ -48,8 +48,8 @@ def report1(request):
     except ObjectDoesNotExist:
       return HttpResponse("ERROR: Affiliation Record Not Found for: '"+AFL+"'")
 
-  if request.user.username == 'caltech':
-    if AFL.find('ENCODE') < 0:  return HttpResponse('Record Not Found <div style="margin-right:20px"><a target=_self href="/admin" target=_self>HOME</a></div>')
+  if request.user.username == 'caltech':  ## that's a quick ad-hoc solution to display only the relevant, ENCODE related, things for Caltech.
+    if AFL.find('ENCODE') < 0:  return HttpResponse('Record Not Found')
   
   TFall = Library.objects.values('antibody').order_by('antibody').distinct()
   CLLall = Library.objects.values('cell_line').order_by('cell_line').distinct()
@@ -64,11 +64,11 @@ def report1(request):
   
   ########
   str = ''
-  str += '<span style="margin-right:20px"><a target=_self href="/admin" target=_self style="font-size:140%">HOME</a></span>'
+  ##str += '<span style="margin-right:20px"><a target=_self href="/admin" target=_self style="font-size:140%">HOME</a></span>'
   ##str += '<span style="margin-right:20px">Max Replicates: '+MaxRep.replicate.__str__()+'</span>'
   str += '<span>Select another <b>'+EXP+'</b> Report:</span>  <select onchange="window.location=\'/htsw_reports/report?aflid=\'+this.options[selectedIndex].value; return false;">'
 
-  if request.user.username == 'caltech':
+  if request.user.username == 'caltech':   ## that's a quick ad-hoc solution to display only the relevant, ENCODE related, things for Caltech.
     Affil_List = Affiliation.objects.filter(name__contains='ENCODE').distinct()
   else:
     Affil_List = Affiliation.objects.distinct()
@@ -125,13 +125,13 @@ def report1(request):
             str += '<div style="border:solid red 2px">'+rres[2]
           else:
             cnt = rres[1]
-            if cnt > 0:
-              str += "<div style='background-color:"+getBgColor(cnt,EXP,(R1.libtags().find('Bad library')!=-1))+";font-size:140%'>"
-              str += "%1.2f" % (cnt/1000000.0)+" M"
-            else:  str += "<div style='background-color:#ffcdd0;width:100%;font-size:140%'>0 Reads"
+            #if cnt > 0:
+            str += "<div style='background-color:"+getBgColor(cnt,EXP,(R1.libtags().find('Bad library')!=-1))+";font-size:140%'>"
+            str += "%1.2f" % (cnt/1000000.0)+" M"
+            #else:  str += "<div style='background-color:#ffcdd0;width:100%;font-size:140%'>0 Reads"
           str += "<div style='font-size:70%'><a title='View Library Record' target=_self style='font-weight:bold;color:black' href=/admin/fctracker/library/?q="+R1.library_id+">"+R1.library_id+"</a>, "+R1.condition.nickname
           if R1.libtags().find('Data submitted to DCC') != -1:
-            str += "<div style='border:solid #666666 1px;'>data submitted</div>"
+            str += "<div style='border:solid #666666 1px;'>DCC-submitted</div>"
           str += "</div>"
           str += "</div>"
       str += '</td>'
@@ -165,13 +165,13 @@ def report1(request):
               str += '<div style="border:solid red 2px">'+rres[2]
             else:
               cnt = rres[1]
-              if cnt > 0:
-                str += "<div style='background-color:"+getBgColor(cnt,EXP,(R1.libtags().find('Bad library')!=-1))+";font-size:140%;margin:2px'>"
-                str += "%1.2f" % (cnt/1000000.0)+" M"
-              else:  str += "<div style='background-color:#ffcdd0;width:100%;font-size:140%'>0 Reads"
+              #if cnt > 0:
+              str += "<div style='background-color:"+getBgColor(cnt,EXP,(R1.libtags().find('Bad library')!=-1))+";font-size:140%;margin:2px'>"
+              str += "%1.2f" % (cnt/1000000.0)+" M"
+              #else:  str += "<div style='background-color:#ffcdd0;width:100%;font-size:140%'>0 Reads"
             str += "<div style='font-size:70%'><a title='View Library Record' target=_self style='font-weight:bold;color:black' href=/admin/fctracker/library/?q="+R1.library_id+">"+R1.library_id+"</a>, "+R1.condition.nickname
             if R1.libtags().find('Data submitted to DCC') != -1:
-              str += "<div style='border:solid #666666 1px;'>data submitted</div>"
+              str += "<div style='border:solid #666666 1px;'>DCC-submitted</div>"
             str += "</div>"
             str += "</div>"
         str += '</td>'
@@ -222,7 +222,7 @@ def report_RM(request): #for RNA-Seq and Methyl-Seq
   if len(RepRecs) > 0: Reps = RepRecs[0].replicate
                                                                                                                                                                               
   str = ''
-  str += '<span style="margin-right:20px"><a  target=_self href="/admin" target=_self" style="font-size:140%">HOME</a></span>'
+  ##str += '<span style="margin-right:20px"><a  target=_self href="/admin" target=_self" style="font-size:140%">HOME</a></span>'
   str += '<span>Select another <b>'+EXP+'</b> Report:</span> <select onchange="window.location=\'/htsw_reports/report_RM?exp='+EXP+'&aflid=\'+this.options[selectedIndex].value; return false;">'
 
   if request.user.username == 'caltech':
@@ -289,14 +289,14 @@ def report_RM(request): #for RNA-Seq and Methyl-Seq
             str += '<div style="border:solid red 2px">'+rres[2]
           else:
             cnt = rres[1]
-            if cnt > 0:
-              str += "<div style='background-color:"+getBgColor(cnt,EXP,(R1.libtags().find('Bad library')!=-1))+";border:solid #cccccc 1px;font-size:140%'>"
-              str += "%1.2f" % (cnt/1000000.0)+" M"
-            else:  str += "<div style='background-color:#ffcdd0;border:solid #cccccc 1px;width:100%;font-size:140%'>0 Reads"
+            #if cnt > 0:
+            str += "<div style='background-color:"+getBgColor(cnt,EXP,(R1.libtags().find('Bad library')!=-1))+";border:solid #cccccc 1px;font-size:140%'>"
+            str += "%1.2f" % (cnt/1000000.0)+" M"
+            #else:  str += "<div style='background-color:#ffcdd0;border:solid #cccccc 1px;width:100%;font-size:140%'>0 Reads"
           str += "<div style='font-size:80%'><a title='View Record' style='color:black' target=_self href=/admin/fctracker/library/?q="+R1.library_id+">"+R1.library_id+"</a>, "+R1.condition.nickname+", "+R1.library_species.common_name+"</div>"
           str += "<div style='font-size:70%'>\""+R1.library_name+"\""
           if R1.libtags().find('Data submitted to DCC') != -1:
-            str += "<div style='width:75%;border:solid #666666 1px;'>data submitted</div>"
+            str += "<div style='width:75%;border:solid #666666 1px;'>DCC-submitted</div>"
           str += "</div>"
           str += "</div>"
       str += '</td>'