2c2d90bf793acfb87e34d4be28997444e86705f6
[htsworkflow.git] / htsworkflow / frontend / templates / samples / library_detail.html
1 {% extends "base_site.html" %}
2 {% load adminmedia 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
11 <style type="text/css">
12   /* <![CDATA[ */
13   div#librarydetail {
14     margin: 0;
15     padding: 0;
16   }
17   div#librarydetail table, div#librarydetail td {
18     border-style: solid;
19   }
20   div#librarydetail table {
21     border-width: 0 0 1px 1px;
22     border-spacing: 0;
23     border-collapse: collapse;
24   }
25   div#librarydetail td {
26     margin: 0;
27     padding: 3px;
28     border-width: 1px 1px 0 0;
29   }
30   div#librarydetail thead {
31     text-align: center;
32     }
33   div#librarydetail tbody {
34     text-align: right;
35   }
36   div#librarydetail h1,
37   div#librarydetail h2
38   {
39     font-size: 150%;
40   }
41
42   div#librarydetail h3 {
43      font-size: 125%;
44      margin: 0;
45   }
46
47   div#librarydetail h4,
48   div#librarydetail h5,
49   div#librarydetail ul,
50   div#librarydetail ol,
51   div#librarydetail li
52   {
53     list-style: none;
54     margin: 0;   
55   }
56
57   div#librarydetail ul,
58   div#librarydetail ol
59   {
60     margin-bottom: .5em;
61   }
62
63   div.library_identity { 
64     float: left; margin: 5px; }
65   div.library_sample_detail { float: left; margin: 5px; }
66   div.library_library_detail { float: left; margin: 5px; }
67   div.library_statistics { clear: both; border: 1px; }
68  /* ]]> */
69 </style>
70 {% endblock %}
71
72 {% block content %}
73 <div id="librarydetail">
74   <div class="library_identity">
75     <h2>Library Name</h2>  
76     <b>Library ID</b>: {{ lib.id }}<br/>
77     <b>Name</b>: 
78       <span property="libns:name">{{ lib.library_name }}</span>
79     <br/>
80     <b>Affiliations</b>:
81     <ul>
82       {% for individual in lib.affiliations.all %}
83         <li property="libns:affliation" content="{{individual.name}}">
84           {{ individual.name }} ( {{ individual.contact }} )
85         </li>
86       {% endfor %}
87     </ul>
88   </div>
89   <div class="library_sample_detail">
90     <h2>Sample Details</h2>
91     <b>Species</b>: 
92       <span property="libns:species">{{ lib.library_species.scientific_name }}</span>
93     <br/>
94     <b>Experiment Type</b>:
95        <span property="libns:experiment_type">{{ lib.experiment_type }}</span>
96     <br/>
97     {% if lib.antibody %}
98     <b>Antibody</b>:
99        <span property="libns:antibody">{{ lib.antibody.antibodies }}</span>
100        {% if lib.antibody.antibodies.nuckname %}
101        (<span property="libns:antibody_term">{{ lib.antibody.nickname }}</span>)
102        {% endif %}
103     <br/>
104     {% endif %}
105     {% if lib.cell_line %}
106     <b>Background or Cell Line</b>:
107        <span property="libns:cell_line">{{ lib.cell_line }}</span>
108     <br/>
109     {% endif %}
110     {% if lib.condition %}
111     <b>Condition</b>:
112        <span property="libns:condition">{{ lib.condition.condition_name }}</span>
113        {% if lib.condition.nickname %}
114        (<span property="libns:condition_term">{{ lib.condition.nickname }}</span>)
115        {% endif %}
116     <br/>
117     {% endif %}
118     {% if lib.replicate %}
119     <b>Replicate</b>: 
120        <span property="libns:replicate">{{ lib.replicate }}</span>
121     <br/>
122     {% endif %}
123   </div>
124   <div class="library_library_detail">
125     <h2>Library Details</h2>
126     <b>Library Type</b>:
127        <span property="libns:library_type">{{ lib.library_type }}</span>
128     <br/>
129     <b>Creation Date</b>
130       <span property="libns:date" content="{{lib.creation_date|date:'Y-m-d'}}T00:00:00" datatype="xsd:dateTime">{{ lib.creation_date }}</span>
131     <br/> 
132     <b>Made By</b>: 
133       <span property="libns:made_by">{{ lib.made_by }}</span>
134     <br/>
135     {% if lib.gel_cut_size %}
136     <b>Gel Cut Size</b>: 
137       <span property="libns:gel_cut">{{ lib.gel_cut_size }}</span>
138     <br/>
139     {% endif %}
140     {% if lib.insert_size %}
141     <b>Insert Size</b>: 
142       <span property="libns:insert_size">{{ lib.insert_size }}</span>
143     <br/>
144     {% endif %}
145     {% if lib.undiluted_concentration %}
146     <b>Concentration</b>: 
147       <span property="libns:concentration">{{ lib.undiluted_concentration }} ng/µl</span>
148     <br/>
149     {% endif %}
150     {% if lib.stopping_point_name %}
151     <b>Protocol Stopping Point</b>
152       <span property="libns:stopping_point">{{ lib.stopping_point_name }}</span>
153     <br/>
154     {% endif %}
155   </div>
156   <div class="library_statistics">
157   <h2>Raw Result Files</h2>
158   <table>
159   <thead>
160     <tr>
161       <td>Run Start Date</td>
162       <td>Cycle</td>
163       <td>Flowcell</td>
164       <td>Lane</td>
165       <td>Summary</td>
166       <td>Eland</td>
167       <td>Bed</td>
168       <td>Archived</td>
169     </tr>
170   </thead>
171   <tbody>
172     {% for result in eland_results %}
173     <tr about="{{result.flowcell.get_absolute_url}}">
174       <td property="libns:date" content="{{result.run_date|date:'Y-m-d\TH:i:s'}}" datatype="xsd:dateTime">{{ result.run_date|date}}</td>
175       <td>{{ result.cycle }}</td>
176       <td><a href="{{result.flowcell.get_absolute_url}}"><span property="libns:flowcell_id">{{ result.flowcell_id }}</span></a></td>
177       <td><a href="{{result.lane.get_absolute_url}}" rel="libns:has_lane"><span property="libns:lane_number" datatype="xsd:decimal">{{ result.lane.lane_number }}</span></a></td>
178       <td><a href="{{ result.summary_url }}">Summary</a></td>
179       <td><a href="{{ result.result_url }}">{{ result.result_label }}</a></td>
180       <td>
181       {% if result.bed_url %}
182         <a href="{{ result.bed_url }}">Bed</a>
183       {% endif %}
184       </td>
185       <td>
186         {% if result.storage_ids %}
187           {{ result.storage_ids|safe }}
188         {% endif %}
189       </td>
190     </tr>
191     {% endfor %}
192   </tbody>
193   </table>
194   
195   <h2>Lane Summary Statistics</h2>
196   {% block summary_stats %}
197   <table>
198     <thead>
199       <tr>
200         <td colspan="7"></td>
201         <td colspan="2">No Match</td>
202         <td colspan="2">QC Failed</td>
203         <td colspan="4">Unique</td>
204         <td colspan="4">Repeat</td>
205       </tr>
206       <tr>
207       <td>Cycles</td>
208       <td>Flowcell</td>
209       <td>Lane</td>
210       <td>End</td>
211       <td>Cluster / Tile</td>
212       <td>pM</td>
213       <td>Raw Reads</td>
214       <td>total</td>
215       <td>%</td>
216       <td>total</td>
217       <td>%</td>
218       <td>0 mismatch</td>
219       <td>1 mismatch</td>
220       <td>2 mismatch</td>
221       <td>Total</td>
222       <td>0 mismatch</td>
223       <td>1 mismatch</td>
224       <td>2 mismatch</td>
225       <td>Total</td>
226       </tr>
227     </thead>
228     <tbody>
229   
230       {% for lane in lane_summary_list %}
231       <tr about="/flowcell/{{lane.flowcell_id}}/{{lane.lane_id}}/{% if lane.end %}#end{{ lane.end }}{% endif %}">
232         <td>{{ lane.cycle_width }}</td>
233         <td>{{ lane.flowcell_id }}</td>
234         <td>{{ lane.lane_id }}</td>
235         <td>{% if lane.end %}{{ lane.end }}{% endif %}</td>
236         <td>{{ lane.clusters.0|intcomma }}</td>
237         <td>{{ lane.successful_pm }}</td>
238         <td>{{ lane.reads|intcomma }}</td>
239         <td>{{ lane.no_match|intcomma }}</td>
240         <td>{{ lane.no_match_percent|stringformat:".2f" }}</td>
241         <td>{{ lane.qc_failed|intcomma }}</td>
242         <td>{{ lane.qc_failed_percent|stringformat:".2f" }}</td>
243         <td>{{ lane.match_codes.U0|intcomma }}</td>
244         <td>{{ lane.match_codes.U1|intcomma }}</td>
245         <td>{{ lane.match_codes.U2|intcomma }}</td>
246         <td {% if lane.unique_reads %}property="libns:total_unique_locations" content="{{lane.unique_reads}}" datatype="xsd:decimal"{% endif %}>{{ lane.unique_reads|intcomma }}</td>
247         <td>{{ lane.match_codes.R0|intcomma }}</td>
248         <td>{{ lane.match_codes.R1|intcomma }}</td>
249         <td>{{ lane.match_codes.R2|intcomma }}</td>
250         <td>{{ lane.repeat_reads|intcomma }}</td>
251       </tr>
252       {% endfor %}
253     </tbody>
254   </table>
255
256   <h2>Flowcell Notes</h2>
257   <table>
258     <thead>
259       <tr>
260         <td>Flowcell ID</td>
261         <td>Lane</td>
262         <td>Comment</td>
263       </tr>
264     </thead>
265     <tbody>
266       {% for lane in lib.lane_set.all %}
267       <tr rel="libns:has_lane" resource="{{lane.get_absolute_url}}">
268         <td><a href="{{lane.flowcell.get_absolute_url}}" rel="libns:flowcell">
269             <span property="libns:flowcell_id">{{ lane.flowcell.flowcell_id }}</span></a></td>
270         <td><a href="{{lane.get_absolute_url}}"> 
271             <span property="libns:lane_number"  datatype="xsd:decimal"
272                >{{ lane.lane_number }}</span></a></td>
273         <td>{{ lane.comment }}</td>
274       </tr>
275           {% endfor %}
276     </tbody>
277   </table>
278   {% endblock %}
279   </div>
280 </div>
281 {% endblock %}