Libraries Detail View integrated.
authorBrandon King <kingb@caltech.edu>
Fri, 26 Jun 2009 22:23:18 +0000 (22:23 +0000)
committerBrandon King <kingb@caltech.edu>
Fri, 26 Jun 2009 22:23:18 +0000 (22:23 +0000)
htsworkflow/frontend/samples/views.py
htsworkflow/frontend/static/js/htsw.js
htsworkflow/frontend/templates/samples/library_detail.html

index 853a0ff8a3aa217c6c2f2e426bc102324491bc76..52907edc0e8a18b868d27ef40d4ca86564ea7ed7 100644 (file)
@@ -105,12 +105,17 @@ def library_to_flowcells(request, lib_id):
         eland_results.extend(_make_eland_results(fc, lane, interesting_flowcells))
         lane_summary_list.extend(lane_summary)
 
+    context = {
+        'page_name': 'Library Details',
+        'lib': lib,
+        'eland_results': eland_results,
+        'lane_summary_list': lane_summary_list,
+    }
+    context.update(SAMPLES_CONTEXT_DEFAULTS)
+
     return render_to_response(
         'samples/library_detail.html',
-        {'lib': lib,
-         'eland_results': eland_results,
-         'lane_summary_list': lane_summary_list,
-        },
+        context,
         context_instance = RequestContext(request))
 
 def summaryhtm_fc_cnm(request, flowcell_id, cnm):
index 8bbe43275aad8fc7b1d3011bc1b9061816d43459..83f4ac05bd0ed3011ead4db4fbae3f9bce9e00bd 100644 (file)
@@ -99,6 +99,8 @@ $(document).ready(function(){
       // East panel contentEl id is supplied in html div id of east_region_config.
       var east_id = Ext.fly('east_region_config').dom.textContent;
       
+      // Length of zero is a valid response... also happens to return null in next
+      //   if statement if not handled before hand.
       if (east_id.length == 0){
        return east_id;
       }
@@ -107,6 +109,7 @@ $(document).ready(function(){
       if (Ext.fly(east_id) == null){
        return 'east_region_config_error';
       }
+      
       return east_id;
     }
     
@@ -179,7 +182,7 @@ $(document).ready(function(){
             xtype: 'panel',
            //autoScroll: true,
             layout: 'fit',
-            margins: '2 2 2 0',
+            margins: '2 0 2 0',
             items: [{
                 //title: 'Inner Panel',
                 contentEl: 'body_content',
index 9843e94d5f5183b1f6b853d011d0fe096500cf17..8838944de26b1dac5d1a3c9aeedc324f452805ef 100644 (file)
+{% extends "flowcell_libraries_app.html" %}
 {% load humanize %}
+
+{% block additional_css %}
 <style type="text/css">
   /* <![CDATA[ */
-  table, td {
+  div#librarydetail table, div#librarydetail td {
     border-style: solid;
   }
-  table {
+  div#librarydetail table {
     border-width: 0 0 1px 1px;
     border-spacing: 0;
     border-collapse: collapse;
   }
-  td {
+  div#librarydetail td {
     margin: 0;
     padding: 4px;
     border-width: 1px 1px 0 0;
   }
-  thead {
+  div#librarydetail thead {
     text-align: center;
     }
-  tbody {
+  div#librarydetail tbody {
     text-align: right;
   }
   /* ]]> */
 </style>
+{% endblock %}
 
-<h2>About this library</h2>
-<b>Library ID</b>: {{ lib.library_id }}<br/>
-<b>Name</b>: {{ lib.library_name }}<br/>
-<b>Species</b>: {{ lib.library_species.scientific_name }}<br/>
-<b>Affiliations</b>:
-<ul>
-  {% for individual in lib.affiliations.all %}
-    <li>{{ individual.name }} ( {{ individual.contact }} )</li>
-  {% endfor %}
-</ul>
-
-<h2>Raw Result Files</h2>
-<table>
-<thead>
-  <tr>
-    <td>Cycle</td>
-    <td>Flowcell</td>
-    <td>Lane</td>
-    <td>Summary</td>
-    <td>Eland</td>
-    <td>Bed</td>
-    <td>Archived</td>
-  </tr>
-{% for result in eland_results %}
-<tr>
-  <td>{{ result.cycle }}</td>
-  <td>{{ result.flowcell_id }}</td>
-  <td>{{ result.lane }}</td>
-  <td><a href="{{ result.summary_url }}">Summary</a></td>
-  <td><a href="{{ result.result_url }}">{{ result.result_label }}</a></td>
-  <td>
-  {% if result.bed_url %}
-    <a href="{{ result.bed_url }}">Bed</a>
-  {% endif %}
-  </td>
-  <td>
-    {% if result.storage_ids %}
-      {{ result.storage_ids }}
-    {% endif %}
-  </td>
-</tr>
-{% endfor %}
-</table>
-
-<h2>Lane Summary Statistics</h2>
-{% block summary_stats %}
-<table>
-  <thead>
-    <tr>
-      <td colspan="7"></td>
-      <td colspan="2">No Match</td>
-      <td colspan="2">QC Failed</td>
-      <td colspan="4">Unique</td>
-      <td colspan="4">Repeat</td>
-    </tr>
-    <tr>
-    <td>Cycles</td>
-    <td>Flowcell</td>
-    <td>Lane</td>
-    <td>End</td>
-    <td>Cluster / Tile</td>
-    <td>pM</td>
-    <td>Raw Reads</td>
-    <td>total</td>
-    <td>%</td>
-    <td>total</td>
-    <td>%</td>
-    <td>0 mismatch</td>
-    <td>1 mismatch</td>
-    <td>2 mismatch</td>
-    <td>Total</td>
-    <td>0 mismatch</td>
-    <td>1 mismatch</td>
-    <td>2 mismatch</td>
-    <td>Total</td>
-    </tr>
-  </thead>
-  <tbody>
-
-    {% for lane in lane_summary_list %}
-    <tr>
-      <td>{{ lane.cycle_width }}</td>
-      <td>{{ lane.flowcell_id }}</td>
-      <td>{{ lane.lane_id }}</td>
-      <td>{% if lane.end %}{{ lane.end }}{% endif %}</td>
-      <td>{{ lane.clusters.0|intcomma }}</td>
-      <td>{{ lane.successful_pm }}</td>
-      <td>{{ lane.reads|intcomma }}</td>
-      <td>{{ lane.no_match|intcomma }}</td>
-      <td>{{ lane.no_match_percent|stringformat:".2f" }}</td>
-      <td>{{ lane.qc_failed|intcomma }}</td>
-      <td>{{ lane.qc_failed_percent|stringformat:".2f" }}</td>
-      <td>{{ lane.match_codes.U0|intcomma }}</td>
-      <td>{{ lane.match_codes.U1|intcomma }}</td>
-      <td>{{ lane.match_codes.U2|intcomma }}</td>
-      <td>{{ lane.unique_reads|intcomma }}</td>
-      <td>{{ lane.match_codes.R0|intcomma }}</td>
-      <td>{{ lane.match_codes.R1|intcomma }}</td>
-      <td>{{ lane.match_codes.R2|intcomma }}</td>
-      <td>{{ lane.repeat_reads|intcomma }}</td>
-    </tr>
-    {% endfor %}
-  </tbody>
-</table>
-<br/>
-<hr/>
-<h2>Count of multi-reads</h2>
-{% for lane in lane_summary_list %}
-  {% if lane.summarized_reads %}
-  <h3>
-    {{lane.cycle_width}} {{ lane.flowcell_id }} lane {{ lane.lane_id }} 
-    {% if lane.end %} end {{ lane.end }}{% endif %}
-  </h3>
+{% block content %}
+<div id="librarydetail">
+  <h2>About this library</h2>
+  <b>Library ID</b>: {{ lib.library_id }}<br/>
+  <b>Name</b>: {{ lib.library_name }}<br/>
+  <b>Species</b>: {{ lib.library_species.scientific_name }}<br/>
+  <b>Affiliations</b>:
   <ul>
-    {% for name, counts in lane.summarized_reads.items %}
-    <li><b>{{ name }}</b>: {{ counts|intcomma }}</li>
+    {% for individual in lib.affiliations.all %}
+      <li>{{ individual.name }} ( {{ individual.contact }} )</li>
     {% endfor %}
   </ul>
-  {% endif %}
-{% endfor %}
+  
+  <h2>Raw Result Files</h2>
+  <table>
+  <thead>
+    <tr>
+      <td>Cycle</td>
+      <td>Flowcell</td>
+      <td>Lane</td>
+      <td>Summary</td>
+      <td>Eland</td>
+      <td>Bed</td>
+      <td>Archived</td>
+    </tr>
+  {% for result in eland_results %}
+  <tr>
+    <td>{{ result.cycle }}</td>
+    <td>{{ result.flowcell_id }}</td>
+    <td>{{ result.lane }}</td>
+    <td><a href="{{ result.summary_url }}">Summary</a></td>
+    <td><a href="{{ result.result_url }}">{{ result.result_label }}</a></td>
+    <td>
+    {% if result.bed_url %}
+      <a href="{{ result.bed_url }}">Bed</a>
+    {% endif %}
+    </td>
+    <td>
+      {% if result.storage_ids %}
+        {{ result.storage_ids }}
+      {% endif %}
+    </td>
+  </tr>
+  {% endfor %}
+  </table>
+  
+  <h2>Lane Summary Statistics</h2>
+  {% block summary_stats %}
+  <table>
+    <thead>
+      <tr>
+        <td colspan="7"></td>
+        <td colspan="2">No Match</td>
+        <td colspan="2">QC Failed</td>
+        <td colspan="4">Unique</td>
+        <td colspan="4">Repeat</td>
+      </tr>
+      <tr>
+      <td>Cycles</td>
+      <td>Flowcell</td>
+      <td>Lane</td>
+      <td>End</td>
+      <td>Cluster / Tile</td>
+      <td>pM</td>
+      <td>Raw Reads</td>
+      <td>total</td>
+      <td>%</td>
+      <td>total</td>
+      <td>%</td>
+      <td>0 mismatch</td>
+      <td>1 mismatch</td>
+      <td>2 mismatch</td>
+      <td>Total</td>
+      <td>0 mismatch</td>
+      <td>1 mismatch</td>
+      <td>2 mismatch</td>
+      <td>Total</td>
+      </tr>
+    </thead>
+    <tbody>
+  
+      {% for lane in lane_summary_list %}
+      <tr>
+        <td>{{ lane.cycle_width }}</td>
+        <td>{{ lane.flowcell_id }}</td>
+        <td>{{ lane.lane_id }}</td>
+        <td>{% if lane.end %}{{ lane.end }}{% endif %}</td>
+        <td>{{ lane.clusters.0|intcomma }}</td>
+        <td>{{ lane.successful_pm }}</td>
+        <td>{{ lane.reads|intcomma }}</td>
+        <td>{{ lane.no_match|intcomma }}</td>
+        <td>{{ lane.no_match_percent|stringformat:".2f" }}</td>
+        <td>{{ lane.qc_failed|intcomma }}</td>
+        <td>{{ lane.qc_failed_percent|stringformat:".2f" }}</td>
+        <td>{{ lane.match_codes.U0|intcomma }}</td>
+        <td>{{ lane.match_codes.U1|intcomma }}</td>
+        <td>{{ lane.match_codes.U2|intcomma }}</td>
+        <td>{{ lane.unique_reads|intcomma }}</td>
+        <td>{{ lane.match_codes.R0|intcomma }}</td>
+        <td>{{ lane.match_codes.R1|intcomma }}</td>
+        <td>{{ lane.match_codes.R2|intcomma }}</td>
+        <td>{{ lane.repeat_reads|intcomma }}</td>
+      </tr>
+      {% endfor %}
+    </tbody>
+  </table>
+  <br/>
+  <hr/>
+  <h2>Count of multi-reads</h2>
+  {% for lane in lane_summary_list %}
+    {% if lane.summarized_reads %}
+    <h3>
+      {{lane.cycle_width}} {{ lane.flowcell_id }} lane {{ lane.lane_id }} 
+      {% if lane.end %} end {{ lane.end }}{% endif %}
+    </h3>
+    <ul>
+      {% for name, counts in lane.summarized_reads.items %}
+      <li><b>{{ name }}</b>: {{ counts|intcomma }}</li>
+      {% endfor %}
+    </ul>
+    {% endif %}
+  {% endfor %}
+  {% endblock %}
+</div>
 {% endblock %}