Changeset 1939
- Timestamp:
- Apr 18, 2013, 10:25:10 AM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/libprep/select_rna.jsp
r1938 r1939 36 36 37 37 <script language="JavaScript"> 38 var debug = false;38 var debug = true; 39 39 40 40 var QUANTITY_REGULAR = 1.1; 41 41 var QUANTITY_QC = 1.22; 42 42 var LOW_QUANTITY_WARNING_FACTOR = 1.5; 43 var QUALITY_SCORE_WARNING_LIMIT = 8; 43 44 44 45 var Rna = function() … … 219 220 if (!warningMsg) warningMsg = 'No quantity'; 220 221 } 222 if (info.rqs) 223 { 224 text += '<div class="quality-score">RQS='+Numbers.formatNumber(info.rqs, 1) + '</div>'; 225 if (info.rqs < QUALITY_SCORE_WARNING_LIMIT && !warningMsg) warningMsg = 'Low RQS value'; 226 } 227 else if (info.rin) 228 { 229 text += '<div class="quality-score">RIN='+Numbers.formatNumber(info.rin, 1) + '</div>'; 230 if (info.rin < QUALITY_SCORE_WARNING_LIMIT && !warningMsg) warningMsg = 'Low RIN value'; 231 } 232 else 233 { 234 if (!warningMsg) warningMsg = 'No RQS/RIN value'; 235 } 221 236 if (info.NDConc) 222 237 { … … 1382 1397 } 1383 1398 .plate.hide-ndconc .ndconc 1399 { 1400 display: none; 1401 } 1402 .plate.hide-quality-score .quality-score 1384 1403 { 1385 1404 display: none; … … 1573 1592 <td class="input"> 1574 1593 <table> 1575 <tr >1594 <tr valign="top"> 1576 1595 <td> 1577 1596 <input type="checkbox" name="location" id="location" onclick="toggleInfo('location')" checked><label for="location">Bioplate location</label><br> … … 1579 1598 </td> 1580 1599 <td> 1600 <input type="checkbox" name="quality-score" id="quality-score" onclick="toggleInfo('quality-score')"><label for="quality-score">RQS/RIN</label><br> 1581 1601 <input type="checkbox" name="ndconc" id="ndconc" onclick="toggleInfo('ndconc')"><label for="ndconc">NDConc</label><br> 1582 1602 <input type="checkbox" name="volumes" id="volumes" onclick="toggleInfo('volumes')"><label for="volumes">Used volume+water</label><br> … … 1675 1695 </div> 1676 1696 1677 <table class="plate hide-volumes hide-ndconc " style="margin: 1em 1em 0 1em;" id="plate"1697 <table class="plate hide-volumes hide-ndconc hide-quality-score" style="margin: 1em 1em 0 1em;" id="plate" 1678 1698 onmouseup="contextEvent(event)" 1679 1699 oncontextmenu="contextEvent(event)" -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Rna.java
r1938 r1939 3 3 import java.util.ArrayList; 4 4 import java.util.Collection; 5 import java.util.Date; 5 6 import java.util.List; 6 7 7 8 import org.json.simple.JSONObject; 8 9 10 import net.sf.basedb.core.BioPlate; 11 import net.sf.basedb.core.BioWell; 9 12 import net.sf.basedb.core.DbControl; 10 13 import net.sf.basedb.core.Extract; … … 260 263 } 261 264 265 266 /** 267 Find the last RNAQC child item that contains either a BA_RIN or CA_RQS value. 268 @return The RNAQC item 269 */ 270 public Extract findLastRnaQc(DbControl dc) 271 { 272 Extract rna = getExtract(); 273 Extract lastQc = null; 274 275 // Fetch all child RNAQC items 276 ItemQuery<Extract> rnaqcQuery = rna.getChildExtracts(); 277 Subtype.RNAQC.addFilter(dc, rnaqcQuery); 278 rnaqcQuery.include(Reggie.INCLUDE_IN_CURRENT_PROJECT); 279 List<Extract> rnaqc = rnaqcQuery.list(dc); 280 281 if (rnaqc.size() > 0) 282 { 283 lastQc = rnaqc.get(0); 284 Date lastQcDate = null; 285 // Try to find the last QC run on either Caliper or BioAnalyzer 286 // This should be stored in QC_RUN_DATE annotation on the BioPlate 287 // If no bioplate is associated with the RNA QC item, use the 288 // creation date 289 290 for (Extract qc : rnaqc) 291 { 292 Float rqs = (Float)Annotationtype.CA_RQS.getAnnotationValue(dc, qc); 293 Float rin = (Float)Annotationtype.BA_RIN.getAnnotationValue(dc, qc); 294 // Skip RNAQC items without any quality score since it may 295 // be a new NanoDrop measurement 296 if (rqs == null && rin == null) continue; 297 298 BioPlate plate = null; 299 BioWell well = qc.getBioWell(); 300 Date qcDate = null; 301 if (well != null) 302 { 303 plate = well.getPlate(); 304 qcDate = (Date)Annotationtype.QC_RUN_DATE.getAnnotationValue(dc, plate); 305 } 306 if (qcDate == null) 307 { 308 qcDate = qc.getCreationEvent().getEventDate(); 309 } 310 if ((lastQcDate == null && qcDate != null) || (qcDate != null && qcDate.after(lastQcDate))) 311 { 312 lastQcDate = qcDate; 313 lastQc = qc; 314 } 315 } 316 } 317 return lastQc; 318 } 319 320 321 public Extract loadRnaQc(DbControl dc) 322 { 323 Extract qc = findLastRnaQc(dc); 324 325 Float rqs = (Float)Annotationtype.CA_RQS.getAnnotationValue(dc, qc); 326 Float rin = (Float)Annotationtype.BA_RIN.getAnnotationValue(dc, qc); 327 328 if (rqs != null) setAnnotation("rqs", rqs); 329 if (rin != null) setAnnotation("rin", rin); 330 331 return qc; 332 } 333 262 334 /** 263 335 Load information about the plate and location the current RNA -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MRnaServlet.java
r1938 r1939 212 212 Rna r = Rna.get(rna); 213 213 r.loadBioPlateLocation(); 214 r.loadRnaQc(dc); 214 215 r.setAnnotation("remainingQuantity", remainingQuantity); 215 216 r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null); … … 358 359 { 359 360 r.loadBioPlateLocation(); 361 r.loadRnaQc(dc); 360 362 r.setAnnotation("remainingQuantity", r.getExtract().getRemainingQuantity()); 361 363 r.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null);
Note: See TracChangeset
for help on using the changeset viewer.