Supprose IVC plot table rows if we don't have data for a lane
authorDiane Trout <diane@caltech.edu>
Mon, 13 Jun 2011 23:51:27 +0000 (16:51 -0700)
committerDiane Trout <diane@caltech.edu>
Mon, 13 Jun 2011 23:51:27 +0000 (16:51 -0700)
Django 1.1 doesn't have conditionals so I needed a different
way to suppress the other lanes for the specific lane detail page.
And finally the links produced by Lane.get_absolute_url needed
to strip the parenthetical comment from the flowcell IDs

htsworkflow/frontend/experiments/models.py
htsworkflow/frontend/experiments/views.py
htsworkflow/frontend/templates/experiments/flowcell_detail.html
htsworkflow/frontend/templates/experiments/flowcell_lane_detail.html

index 5a977986b023c00b19ea6febdd358d01bc13f10f..15209fc59b57761fecbb3ad5b2c3072b912fcddd 100755 (executable)
@@ -183,8 +183,9 @@ class Lane(models.Model):
 
   @models.permalink
   def get_absolute_url(self):
+       flowcell_id, status = parse_flowcell_id(self.flowcell.flowcell_id)
        return ('htsworkflow.frontend.experiments.views.flowcell_lane_detail',
-               [str(self.flowcell.flowcell_id), str(self.lane_number)])
+               [str(flowcell_id), str(self.lane_number)])
 
                         
 ### -----------------------
index e1204135424dca941ca1d7a0044337b719b0ca67..a1775d4cb489dd18926e0e1e56e655a3edb88c2a 100755 (executable)
@@ -145,10 +145,15 @@ def flowcell_lane_detail(request, flowcell_id, 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)
index b238f8b95f1177575476aae28a76bdb964366807..6e112f850ed9dfa7e5073149ffce00e2c3ba6fae 100644 (file)
@@ -69,6 +69,7 @@
          </thead>
          <tbody>
             {% for lane_id, lane_file_set in run.lane_files.items %}
+           {% if lane_file_set.ivc_all %}
             <tr>
               <td>{{ lane_id }}</td>
               <td>
@@ -96,6 +97,7 @@
                 </a>
               </td>
             </tr>
+            {% endif %}
             {% endfor %} 
          </tbody>
        </table>
index f65c9e930cf95b96ddd0e34166e821664e4234b6..bf9ee003711f12d386a227bc15cf070ed860a72f 100644 (file)
            <td>IVC Percent Base Called</td>
        </thead>
        <tbody>
-          {% for lane_id, lane_file_set in run.lane_files.items %}
-          {% if lane_id == lane.lane_number %}
+          {% for run, lane_number, lane_file_set in filtered_dataruns %}
+          {% if lane_file_set.ivc_all %}
           <tr>
-            <td>{{lane_id}}</td>
+            <td>{{lane_number}}</td>
             <td>
               <a href="{{ lane_file_set.ivc_all.get_absolute_url }}">
               <img height="84" width="126" src="{{ lane_file_set.ivc_all.get_absolute_url }}"/></a>