1 | <%@ page |
---|
2 | pageEncoding="UTF-8" |
---|
3 | session="false" |
---|
4 | import="net.sf.basedb.core.User" |
---|
5 | import="net.sf.basedb.core.DbControl" |
---|
6 | import="net.sf.basedb.core.SessionControl" |
---|
7 | import="net.sf.basedb.core.Application" |
---|
8 | import="net.sf.basedb.core.Extract" |
---|
9 | import="net.sf.basedb.core.BioMaterial" |
---|
10 | import="net.sf.basedb.core.MeasuredBioMaterial" |
---|
11 | import="net.sf.basedb.core.BioMaterialEventSource" |
---|
12 | import="net.sf.basedb.core.BioPlate" |
---|
13 | import="net.sf.basedb.core.BioWell" |
---|
14 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
15 | import="net.sf.basedb.core.ItemQuery" |
---|
16 | import="net.sf.basedb.core.query.Restrictions" |
---|
17 | import="net.sf.basedb.core.query.Hql" |
---|
18 | import="net.sf.basedb.util.Values" |
---|
19 | import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
---|
20 | import="net.sf.basedb.util.extensions.Extension" |
---|
21 | import="net.sf.basedb.clients.web.Base" |
---|
22 | import="net.sf.basedb.clients.web.util.HTML" |
---|
23 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
24 | import="java.util.List" |
---|
25 | import="java.util.ArrayList" |
---|
26 | %> |
---|
27 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
28 | <% |
---|
29 | final SessionControl sc = Base.getExistingSessionControl(request, "net.sf.basedb.reggie", true); |
---|
30 | final String ID = sc.getId(); |
---|
31 | final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie"); |
---|
32 | final String root = request.getContextPath(); |
---|
33 | DbControl dc = null; |
---|
34 | try |
---|
35 | { |
---|
36 | dc = sc.newDbControl(); |
---|
37 | final Extension reggie = ExtensionsControl.get(dc).getExtension("net.sf.basedb.reggie"); |
---|
38 | final User user = User.getById(dc, sc.getLoggedInUserId()); |
---|
39 | int plateId = Values.getInt(request.getParameter("bioplate")); |
---|
40 | String poolSchema = request.getParameter("poolSchema"); |
---|
41 | |
---|
42 | BioPlate plate = BioPlate.getById(dc, plateId); |
---|
43 | int columns = plate.getColumns(); |
---|
44 | int rows = plate.getRows(); |
---|
45 | String view = Values.getString(request.getParameter("view"), "list"); |
---|
46 | String title = "Lab protocol for " + HTML.encodeTags(plate.getName()) + " - " + (view.equals("list") ? "list" : "table"); |
---|
47 | %> |
---|
48 | <base:page id="protocol" type="iframe" favicon="<%=home+"/images/pipette.png"%>" title="<%=title%>" noskin="true"> |
---|
49 | <base:head |
---|
50 | scripts="~../reggie-2.js,~pools.js,~plate.js,~external_protocol.js" |
---|
51 | styles="~../css/reggie-2.css,~../css/printable.css,~../css/plate.css" |
---|
52 | > |
---|
53 | <style> |
---|
54 | table.protocolheader |
---|
55 | { |
---|
56 | width: 100%; |
---|
57 | border: 1px solid #000000; |
---|
58 | margin-bottom: 1em; |
---|
59 | border-collapse: collapse; |
---|
60 | } |
---|
61 | |
---|
62 | table.protocolheader > tbody > tr |
---|
63 | { |
---|
64 | vertical-align: top; |
---|
65 | height: 1.25em; |
---|
66 | } |
---|
67 | |
---|
68 | table.protocolheader > tbody > tr > th |
---|
69 | { |
---|
70 | text-align: left; |
---|
71 | font-size: 1em; |
---|
72 | background-color: #F0F0F0; |
---|
73 | padding: 2px; |
---|
74 | } |
---|
75 | |
---|
76 | table.protocolheader > tbody > tr > td |
---|
77 | { |
---|
78 | text-align: left; |
---|
79 | font-size: 1em; |
---|
80 | padding: 2px; |
---|
81 | } |
---|
82 | |
---|
83 | #listview |
---|
84 | { |
---|
85 | width: 100%; |
---|
86 | font-size: 85%; |
---|
87 | border-collapse: collapse; |
---|
88 | border: 1px solid #000000; |
---|
89 | } |
---|
90 | |
---|
91 | #listview tr.evencol |
---|
92 | { |
---|
93 | background-color: #F0F0F0; |
---|
94 | } |
---|
95 | |
---|
96 | #listview thead |
---|
97 | { |
---|
98 | border: 1px solid #000000; |
---|
99 | background-color: #F0F0F0; |
---|
100 | } |
---|
101 | |
---|
102 | #listview tbody |
---|
103 | { |
---|
104 | page-break-inside: avoid; |
---|
105 | border-top: 1px solid #000000; |
---|
106 | border-bottom: 1px solid #000000; |
---|
107 | } |
---|
108 | |
---|
109 | #listview th |
---|
110 | { |
---|
111 | border-left: 1px solid #000000; |
---|
112 | } |
---|
113 | |
---|
114 | #listview td |
---|
115 | { |
---|
116 | border-left: 1px solid #000000; |
---|
117 | border-top: 1px dotted #666666; |
---|
118 | vertical-align: middle; |
---|
119 | padding: 1px; |
---|
120 | } |
---|
121 | |
---|
122 | #listview .col-num |
---|
123 | { |
---|
124 | width: 1.75em; |
---|
125 | text-align: center; |
---|
126 | font-size: 125%; |
---|
127 | font-weight: bold; |
---|
128 | vertical-align: top; |
---|
129 | } |
---|
130 | |
---|
131 | #listview .rna |
---|
132 | { |
---|
133 | width: 10em; |
---|
134 | text-align: center; |
---|
135 | white-space: nowrap; |
---|
136 | } |
---|
137 | |
---|
138 | #listview .empty .rna |
---|
139 | { |
---|
140 | font-style: italic; |
---|
141 | color: #666666; |
---|
142 | text-align: center; |
---|
143 | } |
---|
144 | |
---|
145 | .external .rna:before |
---|
146 | { |
---|
147 | content: '['; |
---|
148 | } |
---|
149 | .external .rna:after |
---|
150 | { |
---|
151 | content: ']'; |
---|
152 | } |
---|
153 | |
---|
154 | #listview .box |
---|
155 | { |
---|
156 | width: 8em; |
---|
157 | text-align: center; |
---|
158 | } |
---|
159 | #listview .workplate |
---|
160 | { |
---|
161 | width: 5em; |
---|
162 | text-align: center; |
---|
163 | } |
---|
164 | #listview .conc |
---|
165 | { |
---|
166 | width: 4.5em; |
---|
167 | padding-right: 0.5em; |
---|
168 | text-align: right; |
---|
169 | } |
---|
170 | #listview .remain |
---|
171 | { |
---|
172 | width: 4.5em; |
---|
173 | padding-right: 0.5em; |
---|
174 | text-align: right; |
---|
175 | } |
---|
176 | #listview .volume |
---|
177 | { |
---|
178 | width: 3.5em; |
---|
179 | padding-right: 0.5em; |
---|
180 | text-align: right; |
---|
181 | color: #C80000; |
---|
182 | } |
---|
183 | #listview .water |
---|
184 | { |
---|
185 | width: 3.5em; |
---|
186 | padding-right: 0.5em; |
---|
187 | text-align: right; |
---|
188 | color: #0000C8; |
---|
189 | } |
---|
190 | #listview .remarks |
---|
191 | { |
---|
192 | vertical-align: top; |
---|
193 | padding-left: 0.25em; |
---|
194 | } |
---|
195 | |
---|
196 | /* Divide the 12 wells across the full page */ |
---|
197 | #plateview .well |
---|
198 | { |
---|
199 | width: 8.2%; |
---|
200 | max-width: 8.2%; |
---|
201 | min-width: 8.2%; |
---|
202 | background-color: #FFFFFF; |
---|
203 | padding: 4px; |
---|
204 | } |
---|
205 | |
---|
206 | #plateview .well:hover |
---|
207 | { |
---|
208 | padding: 3px; |
---|
209 | } |
---|
210 | |
---|
211 | #plateview .rowheader |
---|
212 | { |
---|
213 | width: 2em; |
---|
214 | } |
---|
215 | |
---|
216 | #plateview .rna |
---|
217 | { |
---|
218 | font-weight: bold; |
---|
219 | margin-bottom: 0.25em; |
---|
220 | } |
---|
221 | #plateview .box |
---|
222 | { |
---|
223 | margin-bottom: 0.25em; |
---|
224 | } |
---|
225 | #plateview .conc |
---|
226 | { |
---|
227 | display: none; |
---|
228 | } |
---|
229 | #plateview .remain |
---|
230 | { |
---|
231 | display: none; |
---|
232 | } |
---|
233 | #plateview .volume |
---|
234 | { |
---|
235 | color: #C80000; |
---|
236 | } |
---|
237 | #plateview .water |
---|
238 | { |
---|
239 | color: #0000C8; |
---|
240 | float: right; |
---|
241 | } |
---|
242 | #plateview .remarks |
---|
243 | { |
---|
244 | color: #C80000; |
---|
245 | font-style: italic; |
---|
246 | } |
---|
247 | #plateview .qc |
---|
248 | { |
---|
249 | background-image: url('../images/mrnaqc.png'); |
---|
250 | background-position: 95% 25%; |
---|
251 | background-repeat: no-repeat; |
---|
252 | } |
---|
253 | |
---|
254 | #plateview .yellow-specimen .if-yellow |
---|
255 | { |
---|
256 | background-image: url('../images/yellow-label-small.png'); |
---|
257 | background-position: 1px 50%; |
---|
258 | background-repeat: no-repeat; |
---|
259 | /* Grow background without shifting text position veritcally, move to right to make room for icon*/ |
---|
260 | padding: 4px 4px 3px 14px; |
---|
261 | margin: -4px -4px -1px -4px; |
---|
262 | } |
---|
263 | |
---|
264 | |
---|
265 | </style> |
---|
266 | </base:head> |
---|
267 | <base:body> |
---|
268 | |
---|
269 | <div class="paper <%=view.equals("list") ? "" : "landscape"%>"> |
---|
270 | |
---|
271 | <form name="reggie" id="wizard"> |
---|
272 | |
---|
273 | <div id="page-data" class="datacontainer" |
---|
274 | data-view="<%=view%>" |
---|
275 | data-plate-id="<%=plateId %>" |
---|
276 | data-home-url="<%=home%>" |
---|
277 | ></div> |
---|
278 | |
---|
279 | <div id="wizard-status"></div> |
---|
280 | |
---|
281 | <div id="all-protocol" style="display: none;"> |
---|
282 | <div id="print-instructions" class="noprint fullwidth"> |
---|
283 | <base:button id="print-button" image="<%=home+"/images/print.png"%>" title="Print…" /> |
---|
284 | <span id="printNote"> |
---|
285 | <b>Note!</b> |
---|
286 | <% |
---|
287 | if (view.equals("list")) |
---|
288 | { |
---|
289 | %> |
---|
290 | For better printing reduce margins to about <i>5mm</i> and set page orientation |
---|
291 | to <i>portrait</i>. To fit everything on a single page, scale down to <i>60-70%</i>. |
---|
292 | <% |
---|
293 | } |
---|
294 | else |
---|
295 | { |
---|
296 | %> |
---|
297 | For better printing reduce margins to about <i>5mm</i> and set page orientation |
---|
298 | to <i>landscape</i>. The recommended scale is <i>100%</i>. |
---|
299 | <% |
---|
300 | } |
---|
301 | %> |
---|
302 | </span> |
---|
303 | <br clear="all"> |
---|
304 | </div> |
---|
305 | |
---|
306 | |
---|
307 | <h1>Lab protocol for external sequencing <span class="reggie">Reggie <%=reggie.getAbout().getVersion() %></span></h1> |
---|
308 | |
---|
309 | <table style="width: 100%;" class="protocolheader"> |
---|
310 | <tr style="border-bottom: 1px solid #cccccc;"> |
---|
311 | <th style="width: 15%;">Work plate</th> |
---|
312 | <td style="width: 30%;"><%=HTML.encodeTags(plate.getName())%></td> |
---|
313 | <td style="width: 50%;border-left: 1px solid #000000;" rowspan="3"><%=HTML.niceFormat(plate.getDescription()) %></td> |
---|
314 | </tr> |
---|
315 | <tr style="border-bottom: 1px solid #cccccc;"> |
---|
316 | <th>Pre-normalization</th> |
---|
317 | <td id="normalization-protocol"></td> |
---|
318 | </tr> |
---|
319 | <tr style="height: 4em;"> |
---|
320 | <th></th> |
---|
321 | <td></td> |
---|
322 | </tr> |
---|
323 | </table> |
---|
324 | |
---|
325 | <% |
---|
326 | if (view.equals("list")) |
---|
327 | { |
---|
328 | %> |
---|
329 | <table style="width: 100%;" id="listview"> |
---|
330 | <thead> |
---|
331 | <tr class="toprow"> |
---|
332 | <th></th> |
---|
333 | <th class="rna"></th> |
---|
334 | <th class="box">Storage</th> |
---|
335 | <th>Conc.</th> |
---|
336 | <th>Remain</th> |
---|
337 | <th class="workplate">Work</th> |
---|
338 | <th colspan="2">Volume</th> |
---|
339 | <th></th> |
---|
340 | </tr> |
---|
341 | <tr> |
---|
342 | <th></th> |
---|
343 | <th class="rna">RNA</th> |
---|
344 | <th class="box">box</th> |
---|
345 | <th>(ng/µl)</th> |
---|
346 | <th>(µg)</th> |
---|
347 | <th class="workplate">plate</th> |
---|
348 | <th>(µl)</th> |
---|
349 | <th>H<sub>2</sub>O</th> |
---|
350 | <th>Remarks</th> |
---|
351 | </tr> |
---|
352 | </thead> |
---|
353 | <% |
---|
354 | WellCoordinateFormatter rowF = new WellCoordinateFormatter(true); |
---|
355 | WellCoordinateFormatter colF = new WellCoordinateFormatter(false); |
---|
356 | for (int c = 0; c < columns; ++c) |
---|
357 | { |
---|
358 | String rowClass = c % 2 == 0 ? "evencol" : "oddcol"; |
---|
359 | %> |
---|
360 | <tbody> |
---|
361 | <% |
---|
362 | for (int r = 0; r < rows; ++r) |
---|
363 | { |
---|
364 | String idSuffix = c + "." + r; |
---|
365 | %> |
---|
366 | <tr class="<%=rowClass%> empty" id="row.<%=idSuffix%>"> |
---|
367 | <% |
---|
368 | if (r == 0) |
---|
369 | { |
---|
370 | %> |
---|
371 | <td class="col-num" rowspan="<%=rows%>"><%=c+1%></td> |
---|
372 | <% |
---|
373 | } |
---|
374 | %> |
---|
375 | <td class="rna if-yellow" id="rna.<%=idSuffix%>">empty</td> |
---|
376 | <td class="box" id="box.<%=idSuffix%>"></td> |
---|
377 | <td class="conc" id="conc.<%=idSuffix%>"></td> |
---|
378 | <td class="remain" id="remain.<%=idSuffix%>"></td> |
---|
379 | <td class="workplate"><%=rowF.format(r)+colF.format(c)%></td> |
---|
380 | <td class="volume" id="volume.<%=idSuffix%>"></td> |
---|
381 | <td class="water" id="water.<%=idSuffix%>"></td> |
---|
382 | <td class="remarks" id="remarks.<%=idSuffix%>"></td> |
---|
383 | </tr> |
---|
384 | <% |
---|
385 | } |
---|
386 | %> |
---|
387 | </tbody> |
---|
388 | <% |
---|
389 | } |
---|
390 | %> |
---|
391 | </table> |
---|
392 | <% |
---|
393 | } |
---|
394 | else |
---|
395 | { |
---|
396 | %> |
---|
397 | <table class="plate" style="margin: 0em 0 0 0; width: 100%;" id="plateview"> |
---|
398 | <% |
---|
399 | WellCoordinateFormatter rowF = new WellCoordinateFormatter(true); |
---|
400 | WellCoordinateFormatter colF = new WellCoordinateFormatter(false); |
---|
401 | %> |
---|
402 | <tr class="header"> |
---|
403 | <th></th> |
---|
404 | <% |
---|
405 | for (int c = 0; c < columns; ++c) |
---|
406 | { |
---|
407 | %> |
---|
408 | <th id="col.<%=c%>"><%=colF.format(c)%></th> |
---|
409 | <% |
---|
410 | } |
---|
411 | %> |
---|
412 | </tr> |
---|
413 | <tbody> |
---|
414 | <% |
---|
415 | for (int r = 0; r < rows; ++r) |
---|
416 | { |
---|
417 | String row = rowF.format(r); |
---|
418 | %> |
---|
419 | <tr class="row-<%=r%>"> |
---|
420 | <th id="row.<%=r%>" class="rowheader"><%=row%></th> |
---|
421 | <% |
---|
422 | for (int c = 0; c < columns; ++c) |
---|
423 | { |
---|
424 | %> |
---|
425 | <td class="well col-<%=c%>" id="well.<%=r%>.<%=c%>"></td> |
---|
426 | <% |
---|
427 | } |
---|
428 | %> |
---|
429 | </tr> |
---|
430 | <% |
---|
431 | } |
---|
432 | %> |
---|
433 | </tbody> |
---|
434 | <tr id="pool-row"> |
---|
435 | <th colspan=<%=columns+1 %>> </th> |
---|
436 | </tr> |
---|
437 | </table> |
---|
438 | <% |
---|
439 | } |
---|
440 | %> |
---|
441 | <i>Low quantity = The remaining quantity is too low for the RNA to be re-processed one more time</i> |
---|
442 | </div> |
---|
443 | </form> |
---|
444 | </div> |
---|
445 | |
---|
446 | </base:body> |
---|
447 | </base:page> |
---|
448 | <% |
---|
449 | } |
---|
450 | finally |
---|
451 | { |
---|
452 | if (dc != null) dc.close(); |
---|
453 | } |
---|
454 | %> |
---|