Changeset 1934
- Timestamp:
- Apr 17, 2013, 10:35:45 AM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r1931 r1934 263 263 <dd> 264 264 <ul> 265 <li><a href="libprep/create_pools.jsp?ID=<%=ID%>">Create pooled libraries</a> 265 266 <li><a href="libprep/pool_protocol.jsp?ID=<%=ID%>">Lab protocols for pooling and flow cell preparation</a> 266 267 <li><a href="libprep/pool_registration.jsp?ID=<%=ID%>">Register pooled libraries</a> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/lib_registration.jsp
r1931 r1934 653 653 <td class="input"><textarea rows="4" cols="50" style="width: 90%;" name="libComments" value="" onblur="libCommentsOnChange()"></textarea></td> 654 654 <td class="status" id="libComments.status"></td> 655 <td class="help"><span id="libComments.message" class="message" style="display: none;"></span>Comments about the quality control results.</td>655 <td class="help"><span id="libComments.message" class="message" style="display: none;"></span>Comments about the library preparation.</td> 656 656 </tr> 657 657 </table> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/plate.js
r1865 r1934 66 66 plate.getPools = function() 67 67 { 68 return plate.poolSchema ? plate.poolSchema. getPools(): 0;68 return plate.poolSchema ? plate.poolSchema.numPools : 0; 69 69 } 70 70 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PoolServlet.java
r1925 r1934 15 15 import org.json.simple.JSONArray; 16 16 import org.json.simple.JSONObject; 17 import org.json.simple.parser.JSONParser; 17 18 18 19 19 20 20 21 import net.sf.basedb.core.Application; 22 import net.sf.basedb.core.BioMaterialEvent; 23 import net.sf.basedb.core.BioMaterialEventSource; 21 24 import net.sf.basedb.core.BioPlate; 22 25 import net.sf.basedb.core.DbControl; … … 25 28 import net.sf.basedb.core.InvalidDataException; 26 29 import net.sf.basedb.core.ItemQuery; 30 import net.sf.basedb.core.ItemSubtype; 27 31 import net.sf.basedb.core.SessionControl; 28 32 import net.sf.basedb.core.query.Annotations; … … 35 39 import net.sf.basedb.reggie.dao.BioplateType; 36 40 import net.sf.basedb.reggie.dao.Library; 41 import net.sf.basedb.reggie.dao.PooledLibrary; 37 42 import net.sf.basedb.reggie.dao.ReactionPlate; 43 import net.sf.basedb.reggie.dao.Subtype; 38 44 import net.sf.basedb.util.Values; 39 45 import net.sf.basedb.util.error.ThrowableUtil; … … 130 136 json.put("libraries", jsonLibs); 131 137 } 138 else if ("GetNextAutoGeneratedPoolNames".equals(cmd)) 139 { 140 dc = sc.newDbControl(); 141 int numNames = Values.getInt(req.getParameter("numNames")); 142 json.put("names", PooledLibrary.generateNamesForBatch(dc, 1, numNames)); 143 144 } 132 145 } 133 146 catch (Throwable t) … … 166 179 try 167 180 { 168 if ("CreateBarcodedLibraries".equals(cmd)) 169 { 181 if ("CreatePools".equals(cmd)) 182 { 183 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 184 JSONArray jsonPools = (JSONArray)jsonReq.get("pools"); 185 186 dc = sc.newDbControl(); 187 ItemSubtype pooledLibraryType = Subtype.POOLED_LIBRARY.load(dc); 188 189 for (int i = 0; i < jsonPools.size(); i++) 190 { 191 JSONObject jsonPool = (JSONObject)jsonPools.get(i); 192 JSONArray jsonLibs = (JSONArray)jsonPool.get("libs"); 193 194 Extract pool = Extract.getNew(dc); 195 pool.setItemSubtype(pooledLibraryType); 196 pool.setName((String)jsonPool.get("name")); 197 198 BioMaterialEvent poolEvent = pool.getCreationEvent(); 199 200 for (int j = 0; j < jsonLibs.size(); j++) 201 { 202 JSONObject jsonLib = (JSONObject)jsonLibs.get(j); 203 Number libId = (Number)jsonLib.get("id"); 204 205 Extract lib = Extract.getById(dc, libId.intValue()); 206 BioMaterialEventSource src = poolEvent.addSource(lib); 207 208 Float originalConc = (Float)Annotationtype.QUBIT_CONC.getAnnotationValue(dc, lib); 209 Float speedVacConc = (Float)Annotationtype.QUBIT_CONC_AFTER_SPEEDVAC.getAnnotationValue(dc, lib); 210 Float usedConc = speedVacConc == null ? originalConc : speedVacConc; 211 Float molarity = (Float)Annotationtype.CA_MOLARITY.getAnnotationValue(dc, lib); 212 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()); 217 src.setUsedQuantity(usedQuantity); 218 } 219 220 // TODO - how to calculate the original quantity of the pool 221 // pool.setOriginalQuantity(????); 222 223 dc.saveItem(pool); 224 225 jsonMessages.add("Created '" + pool.getName() + "' from " + jsonLibs.size() + " libraries"); 226 } 227 228 //dc.commit(); 170 229 } 171 230 json.put("messages", jsonMessages);
Note: See TracChangeset
for help on using the changeset viewer.