Changeset 1942
- Timestamp:
- Apr 19, 2013, 11:11:26 AM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk/resources/libprep
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/libprep/auto_select_rna.jsp
r1940 r1942 31 31 32 32 <script> 33 var QUANTITY_REGULAR = 1.1; 33 34 function autoSelect() 34 35 { 35 36 var options = {}; 36 37 var frm = document.forms['options']; 37 if (frm.remainingQuantity.checked) options.remainingQuantity = 1.1;38 if (frm.remainingQuantity.checked) options.remainingQuantity = QUANTITY_REGULAR; 38 39 if (frm.qualityScore.checked) options.qualityScore = 6.0; 39 40 if (frm.flag.checked) options.flag = 1; … … 50 51 } 51 52 } 53 54 function init() 55 { 56 var frm = window.opener.document.forms['reggie']; 57 var qRegular = parseFloat(frm.quantity_regular.value); 58 if (qRegular > 0) QUANTITY_REGULAR = qRegular; 59 60 setInnerHTML('quantity_regular', QUANTITY_REGULAR); 61 } 52 62 </script> 53 63 <style> … … 59 69 </style> 60 70 </base:head> 61 <base:body >71 <base:body onload="init()"> 62 72 <h1><%=title %></h1> 63 73 … … 70 80 <th>Active filters</th> 71 81 <td> 72 <input type="checkbox" name="remainingQuantity" id="remainingQuantity" value="1" checked><label for="remainingQuantity">Remaining quantity ≥ 1.1µg</label><br> 73 <input type="checkbox" name="qualityScore" id="qualityScore" value="1" checked><label for="qualityScore">RQS/RIN ≥ 6</label><br> 82 <input type="checkbox" name="remainingQuantity" id="remainingQuantity" value="1" checked> 83 <label for="remainingQuantity">Remaining quantity ≥ <span id="quantity_regular"></span> µg</label><br> 84 <input type="checkbox" name="qualityScore" id="qualityScore" value="1" checked> 85 <label for="qualityScore">RQS/RIN ≥ 6</label><br> 74 86 </td> 75 87 </tr> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/select_rna.jsp
r1940 r1942 38 38 var debug = true; 39 39 40 var QUANTITY_REGULAR = 1.1; 41 var QUANTITY_QC = 1.22; 42 var LOW_QUANTITY_WARNING_FACTOR = 1.5; 40 var quantitiesAreValid = false; 41 var QUANTITY_REGULAR; 42 var QUANTITY_QC; 43 var LOW_QUANTITY_WARNING_FACTOR = 2; 43 44 var QUALITY_SCORE_WARNING_LIMIT = 8; 44 45 … … 198 199 if (info && info.id && !rna.stratagene && !rna.external) 199 200 { 200 var quantity = 1000 * (rna.qc ? QUANTITY_QC : QUANTITY_REGULAR);201 var use = Math.ceil(quantity/info.NDConc) ;201 var quantity = 10000 * (rna.qc ? QUANTITY_QC : QUANTITY_REGULAR); 202 var use = Math.ceil(quantity/info.NDConc) / 10; 202 203 var water = Math.round(50-use); 203 204 if (info.remainingQuantity) 204 205 { 205 206 text += '<div class="quantity">'+Numbers.formatNumber(info.remainingQuantity, 2) + 'µg</div>'; 206 // Must have at least 1.1µg or 1.22µg 207 // Must have at least 1.1µg or 1.22µg (if default values are used) 207 208 var remainLimit = rna.qc ? QUANTITY_QC : QUANTITY_REGULAR; 208 209 if (info.remainingQuantity < remainLimit) … … 277 278 keepSessionAlive('<%=ID%>', false, '../'); 278 279 280 quantityOnBlur(); 281 279 282 var frm = document.forms['reggie']; 280 283 var schema = PoolSchema.initList(frm.pool_schema); … … 1191 1194 function goCreate() 1192 1195 { 1196 if (!quantitiesAreValid) 1197 { 1198 setInnerHTML('gonext.message', 'Invalid RNA quantities'); 1199 return; 1200 } 1201 1193 1202 var submitInfo = {}; 1194 1203 var plateInfo = {}; … … 1198 1207 submitInfo.flagged = flaggedRnaInfo; 1199 1208 var frm = document.forms['reggie']; 1200 1201 1209 var schema = POOL_SCHEMA[frm.pool_schema.selectedIndex]; 1202 1210 … … 1289 1297 1290 1298 if (debug) Main.debug(JSON.stringify(submitInfo)); 1291 1299 1292 1300 var request = Ajax.getXmlHttpRequest(); 1293 1301 var url = '../MRna.servlet?ID=<%=ID%>'; … … 1340 1348 Plate.paint(Plate.getWells()); 1341 1349 PoolSchema.buildPoolTableRow(schema, Plate.columns, true); 1350 } 1351 1352 function quantityOnBlur() 1353 { 1354 var frm = document.forms['reggie']; 1355 quantitiesAreValid = false; 1356 setInnerHTML('gonext.message', ''); 1357 1358 var qRegular = parseFloat(frm.quantity_regular.value); 1359 if (!(qRegular > 0)) 1360 { 1361 setInputStatus('quantities', 'Amount must be ≥ 0.', 'invalid'); 1362 return; 1363 } 1364 var qQc = parseFloat(frm.quantity_qc.value); 1365 if (!(qQc > qRegular)) 1366 { 1367 setInputStatus('quantities', 'Amount QC must be > ' + qRegular + '.', 'invalid'); 1368 return; 1369 } 1370 1371 quantitiesAreValid = true; 1372 QUANTITY_REGULAR = qRegular; 1373 QUANTITY_QC = qQc; 1374 setInputStatus('quantities', '', 'valid'); 1375 Plate.paint(Plate.getWells()); 1342 1376 } 1343 1377 … … 1552 1586 <td class="prompt">Name</td> 1553 1587 <td class="input" id="plateName"></td> 1588 <td class="status"></td> 1554 1589 <td class="help">Select RNA items to use for the new mRNA plate.</td> 1590 </tr> 1591 <tr valign="top"> 1592 <td class="prompt">Preliminary pool layout</td> 1593 <td class="input"> 1594 <select name="pool_schema" onchange="poolSchemaOnChange()" style="width: 25em;" class="required"></select> 1595 </td> 1596 <td class="status"></td> 1597 <td class="help">Preliminary pool layout (can be changed later).</td> 1555 1598 </tr> 1556 1599 <tr valign="top"> 1557 1600 <td class="prompt">Stratagene to use</td> 1558 1601 <td class="input"> 1559 <select name="stratagene" style="width: 25em;" ></select>1602 <select name="stratagene" style="width: 25em;" class="required"></select> 1560 1603 </td> 1604 <td class="status"></td> 1561 1605 <td class="help"> 1562 1606 Select the Stratagene tube to use. If not known, the … … 1565 1609 </tr> 1566 1610 <tr valign="top"> 1567 <td class="prompt"> Preliminary pool layout</td>1611 <td class="prompt">Amount of RNA</td> 1568 1612 <td class="input"> 1569 <select name="pool_schema" onchange="poolSchemaOnChange()" style="width: 25em;"></select> 1613 Normal <input type="text" class="text required" name="quantity_regular" 1614 value="1.1" style="width: 4em;" 1615 onblur="quantityOnBlur()" 1616 onkeypress="return Numbers.numberOnly(event)">µg, 1617 QC <input type="text" class="text required" name="quantity_qc" 1618 value="1.22" style="width: 4em;" 1619 onblur="quantityOnBlur()" 1620 onkeypress="return Numbers.numberOnly(event)">µg 1570 1621 </td> 1571 <td class="help">Preliminary pool layout (can be changed later).</td> 1622 <td class="status" id="quantities.status"></td> 1623 <td class="help"> 1624 <span id="quantities.message" class="message" style="display: none;"></span> 1625 Specify the amount of RNA to use. Aliquots for QC usually need 0.12µg extra. 1626 </td> 1572 1627 </tr> 1573 1628 <tr valign="top"> … … 1576 1631 <textarea rows="2" style="width: 90%;" name="comments" value=""></textarea> 1577 1632 </td> 1633 <td class="status"></td> 1578 1634 <td class="help">Comments about the new mRNA plate.</td> 1579 1635 </tr> … … 1595 1651 </table> 1596 1652 </td> 1653 <td class="status"></td> 1597 1654 <td class="help">Toggles visiblity of the selected information inside each well on the plate.</td> 1598 1655 </tr> … … 1604 1661 <br> 1605 1662 </td> 1663 <td class="status"></td> 1606 1664 <td class="help">Use the selected mouse button to display a context-menu when clicking on the plate.</td> 1607 1665 </tr> … … 1772 1830 <td><base:button id="gocreate" title="Create" image="<%=home+"/images/gonext.png"%>" onclick="goCreate()" /></td> 1773 1831 <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" onclick="goRestart(true)" style="display: none;"/></td> 1832 <td id="gonext.message" class="message"></td> 1774 1833 </tr> 1775 1834 </table>
Note: See TracChangeset
for help on using the changeset viewer.