3214df65e259010d2977c2d2680e3b5c855e873f
[htsworkflow.git] / htsworkflow / frontend / templates / samples / library_detail.html
1 {% extends "base_site.html" %}
2 {% load humanize i18n %}
3 {% block extrahead %}
4     <!-- App Stuff -->
5     <link type="text/css" rel="stylesheet" href="/static/css/app.css" />
6     <script type="text/javascript" src="/static/js/jquery.min.js"></script>
7
8     {% block additional_javascript %}
9     {% endblock %}
10 {% endblock %}
11
12 {% block content %}
13   {% include "sample_header.html" %}
14   <hr/>
15   <div class="library_statistics">
16   <h2>Raw Result Files</h2>
17   <table>
18   <thead>
19     <tr>
20       <td>Run Start Date</td>
21       <td>Cycle</td>
22       <td>Flowcell</td>
23       <td>Lane</td>
24       <td>Summary</td>
25       <td>Eland</td>
26       <td>Bed</td>
27       <td>Archived</td>
28     </tr>
29   </thead>
30   <tbody>
31   {% if eland_results %}
32     {% for result in eland_results %}
33     <tr about="{{result.flowcell.get_absolute_url}}">
34       <td property="libns:date" content="{{result.run_date|date:'Y-m-d\TH:i:s'}}" datatype="xsd:dateTime">{{ result.run_date|date}}</td>
35       <td>{{ result.cycle }}</td>
36       <td><a href="{{result.flowcell.get_absolute_url}}"><span property="libns:flowcell_id">{{ result.flowcell_id }}</span></a>{% if user.is_staff %}<a href="{{result.flowcell.get_admin_url}}"><img class="icon_button" src="/media/img/admin/icon_changelink.gif" alt="Edit"/></a>{% endif%}</td>
37       <td>{{ result.lane.lane_number }}</td>
38       <td><a href="{{ result.summary_url }}">Summary</a></td>
39       <td><a href="{{ result.result_url }}">{{ result.result_label }}</a></td>
40       <td>
41       {% if result.bed_url %}
42         <a href="{{ result.bed_url }}">Bed</a>
43       {% endif %}
44       </td>
45       <td>
46         {% if result.storage_ids %}
47           {{ result.storage_ids|safe }}
48         {% endif %}
49       </td>
50     </tr>
51     {% endfor %}
52   {% else %}
53     <tr><td colspan="8">No data</td></tr>
54   {% endif %}
55   </tbody>
56   </table>
57
58   <h2>Lane Summary Statistics</h2>
59   {% block summary_stats %}
60   <table>
61     <thead>
62       <tr>
63         <td colspan="7"></td>
64         <td colspan="2">No Match</td>
65         <td colspan="2">QC Failed</td>
66         <td colspan="4">Unique</td>
67         <td colspan="4">Repeat</td>
68       </tr>
69       <tr>
70       <td>Cycles</td>
71       <td>Flowcell</td>
72       <td>Lane</td>
73       <td>End</td>
74       <td>Cluster / Tile</td>
75       <td>pM</td>
76       <td>Raw Reads</td>
77       <td>total</td>
78       <td>%</td>
79       <td>total</td>
80       <td>%</td>
81       <td>0 mismatch</td>
82       <td>1 mismatch</td>
83       <td>2 mismatch</td>
84       <td>Total</td>
85       <td>0 mismatch</td>
86       <td>1 mismatch</td>
87       <td>2 mismatch</td>
88       <td>Total</td>
89       </tr>
90     </thead>
91     <tbody>
92     {% if lane_summary_list %}
93       {# ls short for lane summary #}
94       {% for ls in lane_summary_list %}
95       <tr about="{{ls.lane.get_absolute_url}}">
96         <td>{{ ls.cycle_width }}</td>
97         <td><a href="{{ls.flowcell.get_absolute_url}}">{{ ls.flowcell_id }}</a>
98         </td>
99         <td><a href="{{ls.lane.get_absolute_url}}">{{ ls.lane_id }}</a></td>
100         <td>{% if ls.end %}{{ ls.end }}{% endif %}</td>
101         <td>{{ ls.clusters.0|intcomma }}</td>
102         <td>{{ ls.successful_pm }}</td>
103         <td>{{ ls.reads|intcomma }}</td>
104         <td>{{ ls.no_match|intcomma }}</td>
105         <td>{{ ls.no_match_percent|stringformat:".2f" }}</td>
106         <td>{{ ls.qc_failed|intcomma }}</td>
107         <td>{{ ls.qc_failed_percent|stringformat:".2f" }}</td>
108         <td>{{ ls.match_codes.U0|intcomma }}</td>
109         <td>{{ ls.match_codes.U1|intcomma }}</td>
110         <td>{{ ls.match_codes.U2|intcomma }}</td>
111         <td {% if ls.unique_reads %}property="libns:total_unique_locations" content="{{ls.unique_reads}}" datatype="xsd:decimal"{% endif %}>{{ ls.unique_reads|intcomma }}</td>
112         <td>{{ ls.match_codes.R0|intcomma }}</td>
113         <td>{{ ls.match_codes.R1|intcomma }}</td>
114         <td>{{ ls.match_codes.R2|intcomma }}</td>
115         <td>{{ ls.repeat_reads|intcomma }}</td>
116       </tr>
117       {% endfor %}
118       {% else %}
119        <tr><td colspan="20">No data</td></tr>
120     {% endif %}
121   </tbody>
122     </table>
123
124   <h2>Flowcell Notes</h2>
125   <table>
126     <thead>
127       <tr>
128         <td>Flowcell ID</td>
129         <td>Lane</td>
130         <td>Comment</td>
131       </tr>
132     </thead>
133     {% if lib.lane_set.all %}
134     <tbody>
135       {% for lane in lib.lane_set.all %}
136       <tr rel="libns:has_lane" 
137           about="{{lib.get_absolute_url}}"
138           resource="{{lane.get_absolute_url}}">
139         <td>
140           <a typeof="libns:IlluminaFlowcell" href="{{lane.flowcell.get_absolute_url}}">
141             <span property="libns:flowcell_id"
142                   >{{lane.flowcell.flowcell_id}}</span></a>
143           {% if user.is_staff %}
144             <a href="{{lane.flowcell.get_admin_url}}">
145                <img class="icon_button"
146                     src="/media/img/admin/icon_changelink.gif" alt="Edit"/>
147             </a>
148           {% endif%}
149         </td>
150         <td typeof="libns:IlluminaLane" about="{{lane.get_absolute_url}}">
151           <span rel="libns:flowcell" resource="{{lane.flowcell.get_absolute_url}}"></span>
152           <a href="{{lane.get_absolute_url}}">
153             <span property="libns:lane_number"
154                >{{ lane.lane_number }}</span>
155             </a></td>
156         <td>{{ lane.comment }}</td>
157       </tr>
158           {% endfor %}
159     </tbody>
160     {% endif %}
161   </table>
162   <br/>
163   <hr/>
164   <h2>Count of multi-reads</h2>
165   {% for eland_lane in lane_summary_list %}
166     {% if eland_lane.summarized_reads %}
167     <h3>{{eland_lane.cycle_width}} {{ eland_lane.flowcell_id }} lane {{ eland_lane.lane_id }}
168       {% if eland_lane.end %} end {{ eland_lane.end }}{% endif %}
169     </h3>
170     <ul about="{{eland_lane.lane.get_absolute_url}}">
171       {% for name, counts in eland_lane.summarized_reads.items %}
172       <li rel="libns:has_mappings">
173          <b property="libns:mapped_to">{{ name }}</b>:
174          <span property="libns:reads" content="{{counts}}" datatype="xsd:integer">{{ counts|intcomma }}</span></li>
175       {% endfor %}
176     </ul>
177     {% endif %}
178   {% endfor %}
179   {% endblock %}
180   </div>
181 {% endblock %}