3154 |
27 Feb 15 |
nicklas |
1 |
<%@ page |
3154 |
27 Feb 15 |
nicklas |
2 |
pageEncoding="UTF-8" |
3154 |
27 Feb 15 |
nicklas |
3 |
session="false" |
3154 |
27 Feb 15 |
nicklas |
4 |
import="net.sf.basedb.core.User" |
3154 |
27 Feb 15 |
nicklas |
5 |
import="net.sf.basedb.core.DbControl" |
3154 |
27 Feb 15 |
nicklas |
6 |
import="net.sf.basedb.core.SessionControl" |
3154 |
27 Feb 15 |
nicklas |
7 |
import="net.sf.basedb.core.Application" |
3154 |
27 Feb 15 |
nicklas |
8 |
import="net.sf.basedb.core.Extract" |
3742 |
12 Feb 16 |
nicklas |
9 |
import="net.sf.basedb.core.Sample" |
3742 |
12 Feb 16 |
nicklas |
10 |
import="net.sf.basedb.core.AnnotationType" |
3742 |
12 Feb 16 |
nicklas |
11 |
import="net.sf.basedb.core.Annotation" |
3154 |
27 Feb 15 |
nicklas |
12 |
import="net.sf.basedb.core.BioPlate" |
3154 |
27 Feb 15 |
nicklas |
13 |
import="net.sf.basedb.core.BioWell" |
3154 |
27 Feb 15 |
nicklas |
14 |
import="net.sf.basedb.core.Hardware" |
3154 |
27 Feb 15 |
nicklas |
15 |
import="net.sf.basedb.core.ItemQuery" |
3154 |
27 Feb 15 |
nicklas |
16 |
import="net.sf.basedb.core.Include" |
3154 |
27 Feb 15 |
nicklas |
17 |
import="net.sf.basedb.core.query.Restrictions" |
3154 |
27 Feb 15 |
nicklas |
18 |
import="net.sf.basedb.core.query.Hql" |
3154 |
27 Feb 15 |
nicklas |
19 |
import="net.sf.basedb.core.query.Orders" |
3154 |
27 Feb 15 |
nicklas |
20 |
import="net.sf.basedb.core.PermissionDeniedException" |
3154 |
27 Feb 15 |
nicklas |
21 |
import="net.sf.basedb.util.Values" |
3154 |
27 Feb 15 |
nicklas |
22 |
import="net.sf.basedb.util.extensions.Extension" |
3154 |
27 Feb 15 |
nicklas |
23 |
import="net.sf.basedb.clients.web.Base" |
3154 |
27 Feb 15 |
nicklas |
24 |
import="net.sf.basedb.clients.web.util.HTML" |
3154 |
27 Feb 15 |
nicklas |
25 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
3154 |
27 Feb 15 |
nicklas |
26 |
import="java.util.List" |
3154 |
27 Feb 15 |
nicklas |
27 |
import="java.util.ArrayList" |
3154 |
27 Feb 15 |
nicklas |
28 |
%> |
3154 |
27 Feb 15 |
nicklas |
29 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
3154 |
27 Feb 15 |
nicklas |
30 |
<% |
3976 |
26 May 16 |
nicklas |
31 |
final SessionControl sc = Base.getExistingSessionControl(request, "net.sf.basedb.reggie", true); |
3154 |
27 Feb 15 |
nicklas |
32 |
final String ID = sc.getId(); |
3154 |
27 Feb 15 |
nicklas |
33 |
final float scale = Base.getScale(sc); |
3154 |
27 Feb 15 |
nicklas |
34 |
final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie"); |
3154 |
27 Feb 15 |
nicklas |
35 |
DbControl dc = null; |
3154 |
27 Feb 15 |
nicklas |
36 |
try |
3154 |
27 Feb 15 |
nicklas |
37 |
{ |
3154 |
27 Feb 15 |
nicklas |
38 |
dc = sc.newDbControl(); |
3154 |
27 Feb 15 |
nicklas |
39 |
final Extension reggie = ExtensionsControl.get(dc).getExtension("net.sf.basedb.reggie"); |
3154 |
27 Feb 15 |
nicklas |
40 |
final User user = User.getById(dc, sc.getLoggedInUserId()); |
3154 |
27 Feb 15 |
nicklas |
41 |
int plateId = Values.getInt(request.getParameter("bioPlates")); |
3742 |
12 Feb 16 |
nicklas |
42 |
int yellowLabelId = Values.getInt(request.getParameter("YellowLabel")); |
3742 |
12 Feb 16 |
nicklas |
43 |
AnnotationType yellowLabelType = yellowLabelId > 0 ? AnnotationType.getById(dc, yellowLabelId) : null; |
3154 |
27 Feb 15 |
nicklas |
44 |
BioPlate baPlate = BioPlate.getById(dc, plateId); |
3154 |
27 Feb 15 |
nicklas |
45 |
ItemQuery<Extract> query = Extract.getQuery(); |
3154 |
27 Feb 15 |
nicklas |
46 |
query.include(Include.ALL); |
3154 |
27 Feb 15 |
nicklas |
47 |
query.restrict(Restrictions.eq(Hql.property("bioWell.bioPlate"), Hql.entity(baPlate))); |
3154 |
27 Feb 15 |
nicklas |
48 |
query.order(Orders.asc(Hql.property("bioWell.column"))); |
3154 |
27 Feb 15 |
nicklas |
49 |
List<Extract> rnaqc = query.list(dc); |
3154 |
27 Feb 15 |
nicklas |
50 |
%> |
3154 |
27 Feb 15 |
nicklas |
51 |
<base:page id="protocol" type="iframe" noskin="true" |
3154 |
27 Feb 15 |
nicklas |
52 |
favicon="<%=home+"/images/rnaqc.png"%>" |
3154 |
27 Feb 15 |
nicklas |
53 |
title="<%="Lab protocol for BioAnalyzer RNAQC " + HTML.encodeTags(baPlate.getName())%>" |
3154 |
27 Feb 15 |
nicklas |
54 |
> |
3154 |
27 Feb 15 |
nicklas |
55 |
<base:head |
3154 |
27 Feb 15 |
nicklas |
56 |
scripts="~../reggie-2.js,~rnaqc_baprotocol.js" |
3154 |
27 Feb 15 |
nicklas |
57 |
styles="~../css/reggie-2.css,~../css/printable.css" |
3154 |
27 Feb 15 |
nicklas |
58 |
> |
3154 |
27 Feb 15 |
nicklas |
59 |
<style> |
3154 |
27 Feb 15 |
nicklas |
60 |
|
3154 |
27 Feb 15 |
nicklas |
61 |
table.protocolheader |
3154 |
27 Feb 15 |
nicklas |
62 |
{ |
3154 |
27 Feb 15 |
nicklas |
63 |
width: 100%; |
3154 |
27 Feb 15 |
nicklas |
64 |
border: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
65 |
border-collapse: collapse; |
3154 |
27 Feb 15 |
nicklas |
66 |
margin-bottom: 1em; |
3154 |
27 Feb 15 |
nicklas |
67 |
} |
3154 |
27 Feb 15 |
nicklas |
68 |
|
3154 |
27 Feb 15 |
nicklas |
69 |
table.protocolheader tr |
3154 |
27 Feb 15 |
nicklas |
70 |
{ |
3154 |
27 Feb 15 |
nicklas |
71 |
border-bottom: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
72 |
} |
3154 |
27 Feb 15 |
nicklas |
73 |
|
3154 |
27 Feb 15 |
nicklas |
74 |
table.protocolheader > tbody > tr > th |
3154 |
27 Feb 15 |
nicklas |
75 |
{ |
3154 |
27 Feb 15 |
nicklas |
76 |
text-align: left; |
3154 |
27 Feb 15 |
nicklas |
77 |
font-size: 100%; |
3154 |
27 Feb 15 |
nicklas |
78 |
background-color: #F0F0F0; |
3154 |
27 Feb 15 |
nicklas |
79 |
padding: 4px; |
3154 |
27 Feb 15 |
nicklas |
80 |
border-right: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
81 |
width: 25%; |
3154 |
27 Feb 15 |
nicklas |
82 |
} |
3154 |
27 Feb 15 |
nicklas |
83 |
|
3154 |
27 Feb 15 |
nicklas |
84 |
table.protocolheader > tbody > tr > td |
3154 |
27 Feb 15 |
nicklas |
85 |
{ |
3154 |
27 Feb 15 |
nicklas |
86 |
border-right: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
87 |
width: 75%; |
3154 |
27 Feb 15 |
nicklas |
88 |
padding: 4px; |
3154 |
27 Feb 15 |
nicklas |
89 |
} |
3154 |
27 Feb 15 |
nicklas |
90 |
|
3154 |
27 Feb 15 |
nicklas |
91 |
table.samplelist |
3154 |
27 Feb 15 |
nicklas |
92 |
{ |
3154 |
27 Feb 15 |
nicklas |
93 |
width: 100%; |
3154 |
27 Feb 15 |
nicklas |
94 |
border-collapse: collapse; |
3154 |
27 Feb 15 |
nicklas |
95 |
border: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
96 |
} |
3154 |
27 Feb 15 |
nicklas |
97 |
|
3154 |
27 Feb 15 |
nicklas |
98 |
table.samplelist |
3154 |
27 Feb 15 |
nicklas |
99 |
{ |
3154 |
27 Feb 15 |
nicklas |
100 |
width: 100%; |
3154 |
27 Feb 15 |
nicklas |
101 |
border-collapse: collapse; |
3154 |
27 Feb 15 |
nicklas |
102 |
border: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
103 |
} |
3154 |
27 Feb 15 |
nicklas |
104 |
|
3154 |
27 Feb 15 |
nicklas |
105 |
table.samplelist > tbody > tr |
3154 |
27 Feb 15 |
nicklas |
106 |
{ |
3154 |
27 Feb 15 |
nicklas |
107 |
height: 1.25cm; |
3154 |
27 Feb 15 |
nicklas |
108 |
} |
3154 |
27 Feb 15 |
nicklas |
109 |
|
3154 |
27 Feb 15 |
nicklas |
110 |
table.samplelist > tbody > tr > th |
3154 |
27 Feb 15 |
nicklas |
111 |
{ |
3154 |
27 Feb 15 |
nicklas |
112 |
border: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
113 |
font-size: 1em; |
3154 |
27 Feb 15 |
nicklas |
114 |
background-color: #F0F0F0; |
3154 |
27 Feb 15 |
nicklas |
115 |
} |
3154 |
27 Feb 15 |
nicklas |
116 |
|
3154 |
27 Feb 15 |
nicklas |
117 |
table.samplelist > tbody > tr > td |
3154 |
27 Feb 15 |
nicklas |
118 |
{ |
3154 |
27 Feb 15 |
nicklas |
119 |
border: 1px solid #000000; |
3154 |
27 Feb 15 |
nicklas |
120 |
vertical-align: middle; |
3154 |
27 Feb 15 |
nicklas |
121 |
font-size: 1em; |
3154 |
27 Feb 15 |
nicklas |
122 |
padding: 0.5em; |
3154 |
27 Feb 15 |
nicklas |
123 |
} |
3154 |
27 Feb 15 |
nicklas |
124 |
|
3154 |
27 Feb 15 |
nicklas |
125 |
.name |
3154 |
27 Feb 15 |
nicklas |
126 |
{ |
3154 |
27 Feb 15 |
nicklas |
127 |
font-weight: bold; |
3154 |
27 Feb 15 |
nicklas |
128 |
width: 15%; |
3742 |
12 Feb 16 |
nicklas |
129 |
white-space: nowrap; |
3154 |
27 Feb 15 |
nicklas |
130 |
} |
3154 |
27 Feb 15 |
nicklas |
131 |
.freezer |
3154 |
27 Feb 15 |
nicklas |
132 |
{ |
3154 |
27 Feb 15 |
nicklas |
133 |
width: 30%; |
3154 |
27 Feb 15 |
nicklas |
134 |
} |
3154 |
27 Feb 15 |
nicklas |
135 |
.box |
3154 |
27 Feb 15 |
nicklas |
136 |
{ |
3154 |
27 Feb 15 |
nicklas |
137 |
width: 15%; |
3154 |
27 Feb 15 |
nicklas |
138 |
text-align: center; |
3154 |
27 Feb 15 |
nicklas |
139 |
} |
3154 |
27 Feb 15 |
nicklas |
140 |
.bapos |
3154 |
27 Feb 15 |
nicklas |
141 |
{ |
3154 |
27 Feb 15 |
nicklas |
142 |
width: 8%; |
3154 |
27 Feb 15 |
nicklas |
143 |
text-align: center; |
3154 |
27 Feb 15 |
nicklas |
144 |
} |
3154 |
27 Feb 15 |
nicklas |
145 |
.rin |
3154 |
27 Feb 15 |
nicklas |
146 |
{ |
3154 |
27 Feb 15 |
nicklas |
147 |
width: 12%; |
3154 |
27 Feb 15 |
nicklas |
148 |
text-align: center; |
3154 |
27 Feb 15 |
nicklas |
149 |
} |
3154 |
27 Feb 15 |
nicklas |
150 |
.remark |
3154 |
27 Feb 15 |
nicklas |
151 |
{ |
3154 |
27 Feb 15 |
nicklas |
152 |
width: 20%; |
3154 |
27 Feb 15 |
nicklas |
153 |
} |
3154 |
27 Feb 15 |
nicklas |
154 |
|
3154 |
27 Feb 15 |
nicklas |
155 |
</style> |
3154 |
27 Feb 15 |
nicklas |
156 |
</base:head> |
3154 |
27 Feb 15 |
nicklas |
157 |
<base:body> |
3154 |
27 Feb 15 |
nicklas |
158 |
|
3154 |
27 Feb 15 |
nicklas |
159 |
<div class="paper"> |
3154 |
27 Feb 15 |
nicklas |
160 |
|
3154 |
27 Feb 15 |
nicklas |
161 |
<form name="reggie" id="wizard"> |
3154 |
27 Feb 15 |
nicklas |
162 |
|
3154 |
27 Feb 15 |
nicklas |
163 |
<div id="wizard-status"></div> |
3154 |
27 Feb 15 |
nicklas |
164 |
|
3154 |
27 Feb 15 |
nicklas |
165 |
<div id="all-protocol" style="display: none;"> |
3154 |
27 Feb 15 |
nicklas |
166 |
|
3154 |
27 Feb 15 |
nicklas |
167 |
<div id="print-instructions" class="noprint fullwidth"> |
3154 |
27 Feb 15 |
nicklas |
168 |
<base:button id="print-button" image="<%=home+"/images/print.png"%>" title="Print…" /> |
3154 |
27 Feb 15 |
nicklas |
169 |
<br clear="all"> |
3154 |
27 Feb 15 |
nicklas |
170 |
</div> |
3154 |
27 Feb 15 |
nicklas |
171 |
|
3154 |
27 Feb 15 |
nicklas |
172 |
<h1>Lab protocol for BioAnalyzer RNAQC plate <span class="reggie">Reggie <%=reggie.getAbout().getVersion() %></span></h1> |
3154 |
27 Feb 15 |
nicklas |
173 |
|
3154 |
27 Feb 15 |
nicklas |
174 |
<table class="protocolheader"> |
3154 |
27 Feb 15 |
nicklas |
175 |
<tr> |
3154 |
27 Feb 15 |
nicklas |
176 |
<th>BioAnalyzer plate</th> |
3154 |
27 Feb 15 |
nicklas |
177 |
<td><%=HTML.encodeTags(baPlate.getName())%></td> |
3154 |
27 Feb 15 |
nicklas |
178 |
</tr> |
3154 |
27 Feb 15 |
nicklas |
179 |
<tr> |
3154 |
27 Feb 15 |
nicklas |
180 |
<th>QC date</th> |
3154 |
27 Feb 15 |
nicklas |
181 |
<td></td> |
3154 |
27 Feb 15 |
nicklas |
182 |
</tr> |
3154 |
27 Feb 15 |
nicklas |
183 |
<tr> |
3154 |
27 Feb 15 |
nicklas |
184 |
<th>Operator</th> |
3154 |
27 Feb 15 |
nicklas |
185 |
<td></td> |
3154 |
27 Feb 15 |
nicklas |
186 |
</tr> |
3154 |
27 Feb 15 |
nicklas |
187 |
<tr style="height: 4em; vertical-align: top;"> |
3154 |
27 Feb 15 |
nicklas |
188 |
<th>Comments</th> |
3154 |
27 Feb 15 |
nicklas |
189 |
<td></td> |
3154 |
27 Feb 15 |
nicklas |
190 |
</tr> |
3154 |
27 Feb 15 |
nicklas |
191 |
</tbody> |
3154 |
27 Feb 15 |
nicklas |
192 |
</table> |
3154 |
27 Feb 15 |
nicklas |
193 |
|
3154 |
27 Feb 15 |
nicklas |
194 |
<table style="width: 100%;" class="samplelist"> |
3154 |
27 Feb 15 |
nicklas |
195 |
<tr> |
3154 |
27 Feb 15 |
nicklas |
196 |
<th class="name">RNA</th> |
3154 |
27 Feb 15 |
nicklas |
197 |
<th class="freezer">Freezer</th> |
3154 |
27 Feb 15 |
nicklas |
198 |
<th class="box">Box</th> |
3154 |
27 Feb 15 |
nicklas |
199 |
<th class="bapos">BA pos.</th> |
3154 |
27 Feb 15 |
nicklas |
200 |
<th class="rin">RIN</th> |
3154 |
27 Feb 15 |
nicklas |
201 |
<th class="remark">Remark</th> |
3154 |
27 Feb 15 |
nicklas |
202 |
</tr> |
3154 |
27 Feb 15 |
nicklas |
203 |
<% |
3154 |
27 Feb 15 |
nicklas |
204 |
for (Extract qc : rnaqc) |
3154 |
27 Feb 15 |
nicklas |
205 |
{ |
3154 |
27 Feb 15 |
nicklas |
206 |
BioWell baWell = qc.getBioWell(); |
3154 |
27 Feb 15 |
nicklas |
207 |
Extract rna = (Extract)qc.getParent(); |
3742 |
12 Feb 16 |
nicklas |
208 |
boolean isYellow = false; |
3742 |
12 Feb 16 |
nicklas |
209 |
if (yellowLabelType != null) |
3742 |
12 Feb 16 |
nicklas |
210 |
{ |
3742 |
12 Feb 16 |
nicklas |
211 |
Extract lysate = (Extract)rna.getParent(); |
3742 |
12 Feb 16 |
nicklas |
212 |
Sample specimen = lysate != null ? (Sample)lysate.getParent() : null; |
3742 |
12 Feb 16 |
nicklas |
213 |
if (specimen != null) |
3742 |
12 Feb 16 |
nicklas |
214 |
{ |
3742 |
12 Feb 16 |
nicklas |
215 |
isYellow = specimen.getAnnotationSet().hasAnnotation(yellowLabelType, Annotation.Source.PRIMARY); |
3742 |
12 Feb 16 |
nicklas |
216 |
} |
3742 |
12 Feb 16 |
nicklas |
217 |
} |
3154 |
27 Feb 15 |
nicklas |
218 |
BioWell well = rna.getBioWell(); |
3154 |
27 Feb 15 |
nicklas |
219 |
BioPlate plate = well.getPlate(); |
3154 |
27 Feb 15 |
nicklas |
220 |
Hardware freezer = plate.getFreezer(); |
3742 |
12 Feb 16 |
nicklas |
221 |
String img = isYellow ? "<img src=\"../images/yellow-label.png\">" : ""; |
3154 |
27 Feb 15 |
nicklas |
222 |
%> |
3742 |
12 Feb 16 |
nicklas |
223 |
<tr class="<%=isYellow ? "yellow-specimen" : "" %>"> |
3742 |
12 Feb 16 |
nicklas |
224 |
<td class="name if-yellow"><%=img%><%=HTML.encodeTags(rna.getName()) %></td> |
3154 |
27 Feb 15 |
nicklas |
225 |
<td class="freezer"> |
3154 |
27 Feb 15 |
nicklas |
226 |
<%=HTML.encodeTags(freezer.getName()) %><br> |
3154 |
27 Feb 15 |
nicklas |
227 |
Section <%=plate.getSection() %>, Tray <%=plate.getTray() %>, Position <%=plate.getPosition() %> |
3154 |
27 Feb 15 |
nicklas |
228 |
</td> |
3154 |
27 Feb 15 |
nicklas |
229 |
<td class="box"><%=HTML.encodeTags(plate.getName()) %> <%=well.getCoordinate() %></td> |
3154 |
27 Feb 15 |
nicklas |
230 |
<td class="bapos"><%=baWell.getColumn()+1%></td> |
3154 |
27 Feb 15 |
nicklas |
231 |
<td class="rin"></td> |
3154 |
27 Feb 15 |
nicklas |
232 |
<td class="remark"></td> |
3154 |
27 Feb 15 |
nicklas |
233 |
</tr> |
3154 |
27 Feb 15 |
nicklas |
234 |
<% |
3154 |
27 Feb 15 |
nicklas |
235 |
} |
3154 |
27 Feb 15 |
nicklas |
236 |
%> |
3154 |
27 Feb 15 |
nicklas |
237 |
</table> |
3154 |
27 Feb 15 |
nicklas |
238 |
</div> |
3154 |
27 Feb 15 |
nicklas |
239 |
</form> |
3154 |
27 Feb 15 |
nicklas |
240 |
</div> |
3154 |
27 Feb 15 |
nicklas |
241 |
</base:body> |
3154 |
27 Feb 15 |
nicklas |
242 |
</base:page> |
3154 |
27 Feb 15 |
nicklas |
243 |
<% |
3154 |
27 Feb 15 |
nicklas |
244 |
} |
3154 |
27 Feb 15 |
nicklas |
245 |
finally |
3154 |
27 Feb 15 |
nicklas |
246 |
{ |
3154 |
27 Feb 15 |
nicklas |
247 |
if (dc != null) dc.close(); |
3154 |
27 Feb 15 |
nicklas |
248 |
} |
3154 |
27 Feb 15 |
nicklas |
249 |
%> |