Supprose IVC plot table rows if we don't have data for a lane
[htsworkflow.git] / htsworkflow / frontend / experiments / views.py
index 827f5219ef05870f65735a82077e9b373def1028..a1775d4cb489dd18926e0e1e56e655a3edb88c2a 100755 (executable)
@@ -130,7 +130,7 @@ def finishedEmail(request, pk):
 
 
 def flowcell_detail(request, flowcell_id):
-    fc = get_object_or_404(FlowCell, flowcell_id=flowcell_id)
+    fc = get_object_or_404(FlowCell, flowcell_id__startswith=flowcell_id)
     fc.update_data_runs()
 
     context = RequestContext(request,
@@ -140,15 +140,20 @@ def flowcell_detail(request, flowcell_id):
                               context)
 
 def flowcell_lane_detail(request, flowcell_id, lane_number):
-    fc = get_object_or_404(FlowCell, flowcell_id=flowcell_id)
+    fc = get_object_or_404(FlowCell, flowcell_id__startswith=flowcell_id)
     lane = get_object_or_404(fc.lane_set, lane_number=lane_number)
     
     fc.update_data_runs()
 
+    dataruns = []
+    for run in fc.datarun_set.all():
+        dataruns.append((run, lane.lane_number, run.lane_files()[lane.lane_number]))
+        
     context = RequestContext(request,
                              {'lib': lane.library,
                               'lane': lane,
-                              'flowcell': fc})
+                              'flowcell': fc,
+                              'filtered_dataruns': dataruns})
     
     return render_to_response('experiments/flowcell_lane_detail.html',
                               context)