Changeset 1952
- Timestamp:
- Apr 24, 2013, 11:33:32 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/index.jsp
r1935 r1952 263 263 <dd> 264 264 <ul> 265 <li><a href="libprep/create_pools.jsp?ID=<%=ID%>" class="not-implemented">Create pooled libraries</a>265 <li><a href="libprep/create_pools.jsp?ID=<%=ID%>">Create pooled libraries</a> 266 266 <li><a href="libprep/pool_protocol.jsp?ID=<%=ID%>">Lab protocols for pooling</a> (preliminary) 267 267 <li><a href="libprep/pool_registration.jsp?ID=<%=ID%>" class="not-implemented">Register pooled libraries</a> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/create_pools.jsp
r1934 r1952 34 34 var debug = true; 35 35 var currentStep = 1; 36 var LIMIT_FOR_5_ML = 1.0; 36 37 37 38 function init() … … 134 135 for (var j = 0; j < wells.length; j++) 135 136 { 136 var lib = {}; 137 lib.id = wells[j].extract.id; 138 poolInfo.libs[poolInfo.libs.length] = lib; 137 var lib = wells[j].extract; 138 if (lib) 139 { 140 var tmp = {}; 141 tmp.id = lib.id; 142 tmp.name = lib.name; 143 tmp.volume = lib.volume; 144 poolInfo.libs[poolInfo.libs.length] = tmp; 145 } 139 146 } 140 147 … … 149 156 150 157 var request = Ajax.getXmlHttpRequest(); 151 var url = '../Pool.servlet?ID=<%=ID%>'; 152 url += '&cmd=CreatePools'; 153 request.open("POST", url, false); 154 request.setRequestHeader("Content-Type", "application/json"); 155 request.send(JSON.stringify(submitInfo)); 158 try 159 { 160 showLoadingAnimation('Creating pools...'); 161 var url = '../Pool.servlet?ID=<%=ID%>'; 162 url += '&cmd=CreatePools'; 163 request.open("POST", url, false); 164 request.setRequestHeader("Content-Type", "application/json"); 165 request.send(JSON.stringify(submitInfo)); 166 } 167 finally 168 { 169 hideLoadingAnimation(); 170 } 156 171 157 172 if (debug) Main.debug(request.responseText); … … 277 292 } 278 293 294 if (lib.molarity) 295 { 296 lib.volume = 10 / lib.molarity; 297 lib.eb = 5-lib.volume; 298 if (lib.speedVacConc != null) 299 { 300 remarks[remarks.length] = 'SpeedVac'; 301 } 302 if (lib.volume > 5) 303 { 304 remarks[remarks.length] = 'Use 5 µl'; 305 //lib.volume = 5; 306 //lib.eb = 0; 307 } 308 309 if (lib.volume < LIMIT_FOR_5_ML) 310 { 311 lib.volume *= 2; 312 lib.eb *= 2; 313 remarks[remarks.length] = 'Mix 10µl'; 314 } 315 316 } 317 279 318 lib.remarks = remarks; 280 319 } … … 316 355 var text = ''; 317 356 var lib = well.extract; 318 if (lib && lib.remainingQuantity )357 if (lib && lib.remainingQuantity && lib.molarity) 319 358 { 320 359 var name = lib.name; … … 322 361 text += '<div class="lib">'+name.substring(0, i)+'.<br> '+name.substring(i)+'</div>'; 323 362 text += '<div class="barcode">'+lib.barcode.name+'</div>'; 363 text += '<span class="volume">'+Numbers.formatNumber(lib.volume, 2) + 'µl</span>'; 364 text += '<span class="eb">'+Numbers.formatNumber(lib.eb, 2)+'µl</span>'; 324 365 text += '<div class="remarks">'+ lib.remarks.join('; ') + '</div>'; 325 366 } … … 332 373 </script> 333 374 <style> 334 #export div 335 { 336 margin-left: 1em; 375 .lib 376 { 377 font-weight: bold; 378 margin-bottom: 0.25em; 379 } 380 381 .volume 382 { 383 color: #C80000; 384 } 385 .eb 386 { 387 color: #0000C8; 388 float: right; 389 } 390 .remarks 391 { 392 color: #C80000; 393 font-style: italic; 337 394 } 338 395 </style> … … 374 431 </td> 375 432 <td class="status" id="bioplate.status"></td> 376 <td class="help" rowspan="2"><span id="bioplate.message" class="message" style="display: none;"></span>433 <td class="help"><span id="bioplate.message" class="message" style="display: none;"></span> 377 434 Select an existing Library bioplate. The list contain all Library bioplates that 378 has not yet been pooled (determined by ????).435 contain libraries with no child items. 379 436 </td> 437 </tr> 438 <tr valign="top"> 439 <td class="prompt"></td> 440 <td class="input"> - or -</td> 441 <td class="status" id="bioplate.status"></td> 442 <td class="help"></td> 443 </tr> 444 <tr valign="top"> 445 <td class="prompt">Manual select</td> 446 <td class="input"> // TODO</td> 447 <td class="status" id="bioplate.status"></td> 448 <td class="help"></td> 380 449 </tr> 381 450 </table> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PoolServlet.java
r1934 r1952 83 83 */ 84 84 dc = sc.newDbControl(); 85 86 // Find Library items with remaining quantity==original quantity 87 ItemQuery<Extract> libQuery = Extract.getQuery(); 88 libQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 89 Subtype.LIBRARY.addFilter(dc, libQuery); 90 libQuery.restrict(Restrictions.eq(Hql.property("remainingQuantity"), Hql.property("originalQuantity"))); 91 85 92 ItemQuery<BioPlate> query = BioPlate.getQuery(); 86 93 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 87 94 // Only Library bioplates that are not destroyed 88 95 BioplateType.LIBRARY.addFilter(dc, query, true); 89 // Must NOT have a creation date90 //query.restrict(Restrictions.eq(Hql.property("eventDate"), null));91 96 // Must have a PLATE_PROCESS_RESULT=Success annotation 92 97 query.join(Annotations.leftJoin(null, Annotationtype.PLATE_PROCESS_RESULT.load(dc), "ppr")); 93 98 query.restrict(Restrictions.eq(Hql.alias("ppr"), Expressions.string(ReactionPlate.PROCESS_SUCCESSFUL))); 99 100 query.join(Hql.innerJoin("bioWells", "bw")); 101 query.join(Hql.innerJoin("bw", "bioMaterial", "bm")); 102 103 query.restrict(Restrictions.eq(Hql.alias("bm"), Expressions.any(libQuery))); 104 query.setDistinct(true); 94 105 95 106 List<BioPlate> plates = query.list(dc); … … 118 129 query.join(Hql.innerJoin("bw", "bioPlate", "bp")); 119 130 query.restrict(Restrictions.eq(Hql.alias("bp"), Hql.entity(libPlate))); 131 query.restrict(Restrictions.gt(Hql.property("remainingQuantity"), Expressions.aFloat(0f))); 120 132 query.order(Orders.asc(Hql.property("bw", "column"))); 121 133 query.order(Orders.asc(Hql.property("bw", "row"))); … … 211 223 Float molarity = (Float)Annotationtype.CA_MOLARITY.getAnnotationValue(dc, lib); 212 224 213 // TODO - Most of the times 5 µl is used, but sometimes 10µl is used!! 214 // Remember that concentration values are stored in ng/µl 215 Float usedVolume = 10 / molarity; 216 Float usedQuantity = Math.min(usedVolume * usedConc / 1000, lib.getRemainingQuantity()); 225 // Get the volume to use from the wizard. This calculated base on the CA_MOLARITY value for each 226 // sample to give a final concentration of 2nM mixed to 5 or 10µl (for high concentration) 227 Number usedVolume = (Number)jsonLib.get("volume"); 228 // We never use more than 5µl 229 Float orginalVolume = usedVolume.floatValue(); 230 if (usedVolume.floatValue() > 5f) usedVolume = 5f; 231 232 // Calculate usedQuantity, Remember that concentration values are stored in ng/µl 233 Float usedQuantity = Math.min(usedVolume.floatValue() * usedConc / 1000, lib.getRemainingQuantity()); 217 234 src.setUsedQuantity(usedQuantity); 235 236 jsonMessages.add("Using " + Values.formatNumber(usedQuantity*1000, 2) + "/" + Values.formatNumber(orginalVolume*usedConc, 2) +" of " + Values.formatNumber(lib.getOriginalQuantity()*1000,2) + " from " + lib.getName()); 218 237 } 219 238
Note: See TracChangeset
for help on using the changeset viewer.