Changeset 2077
- Timestamp:
- Oct 17, 2013, 8:18:36 AM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp
r2073 r2077 214 214 Main.hide('gonext'); 215 215 Main.show('goregister'); 216 Main.hide('step.3.box');217 216 218 217 setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure'); … … 393 392 Main.addOrRemoveClass(frm['fc-0.comments'], 'required', failed); 394 393 Main.addOrRemoveClass(frm['fc-1.comments'], 'required', failed); 394 if (failed) 395 { 396 Main.hide('step.3.box'); 397 } 398 else 399 { 400 Main.showInline('step.3.box'); 401 } 395 402 } 396 403 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/BiomaterialList.java
r1867 r2077 34 34 "auto-select wizard for further processing to mRNA. The most typical reason is " + 35 35 "that not enough RNA is available."); 36 37 /** 38 The definition of the biomaterial list used for storing Pooled libraries that have been 39 flagged due to failure to sequence the entire pool. 40 @since 2.13 41 */ 42 public static final BiomaterialList FLAGGED_POOL = 43 new BiomaterialList("Flagged PooledLibrary", "net.sf.basedb.reggie.pool.flagged", Item.EXTRACT, 44 "This list contains PooledLibrary items that have failed to be sequenced. Typically most pools " 45 + "should have enough biomaterial left for trying again, otherwise a new pool may need to be " 46 + "created from libraries or RNA."); 36 47 37 48 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/PooledLibrary.java
r2052 r2077 13 13 import net.sf.basedb.core.ItemQuery; 14 14 import net.sf.basedb.core.Type; 15 import net.sf.basedb.core.query.Annotations; 16 import net.sf.basedb.core.query.Expression; 15 17 import net.sf.basedb.core.query.Expressions; 16 18 import net.sf.basedb.core.query.Hql; … … 49 51 public static final String MIXING_STRATEGY_DYNAMIC = "dynamic"; 50 52 53 /** 54 Flag value for the {@link Annotationtype#FLAG} annotation when clustering 55 a pooled library failed. This flag is normally attached to 'PooledLibrary' 56 items, but may be found on RNA items if the pool runs out of biomaterial. 57 @since 2.13 58 */ 59 public static final String FLAG_CLUSTERING_FAILED = "ClusteringFailed"; 60 51 61 52 62 /** … … 172 182 ItemQuery<Extract> query = Extract.getQuery(); 173 183 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 174 // Filter on Lysatesubtype184 // Filter on Pooled library subtype 175 185 Subtype.POOLED_LIBRARY.addFilter(dc, query); 176 // Filter on created date != null and original=remaining quantity 177 query.restrict(Restrictions.neq(Hql.property("ce", "eventDate"), null)); 178 query.restrict(Restrictions.eq(Hql.property("originalQuantity"), Hql.property("remainingQuantity"))); 179 186 180 187 // Join the creation event 181 188 query.join(Hql.innerJoin(null, "creationEvent", "ce", true)); 182 189 // Filter on created date != null 190 query.restrict(Restrictions.neq(Hql.property("ce", "eventDate"), null)); 191 192 // Join AUTO_PROCESSING annotation 193 query.join(Annotations.leftJoin(null, Annotationtype.AUTO_PROCESSING.load(dc), "ap")); 194 195 /* Create filter: AUTO_PROCESS==ReProcess OR (AUTO_PROCESS=null AND original=remaining quantity) */ 196 Expression autoProcessing = Hql.alias("ap"); 197 query.restrict( 198 Restrictions.nullSafeOr( 199 Restrictions.eq(autoProcessing, Expressions.string("ReProcess")), 200 Restrictions.and( 201 Restrictions.eq(autoProcessing, null), 202 Restrictions.eq(Hql.property("originalQuantity"), Hql.property("remainingQuantity")) 203 ) 204 ) 205 ); 206 183 207 // Sort by name 184 208 query.order(Orders.asc(Hql.property("name"))); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java
r2062 r2077 5 5 import java.util.Date; 6 6 import java.util.HashMap; 7 import java.util.HashSet; 7 8 import java.util.List; 8 9 import java.util.Map; 10 import java.util.Set; 9 11 10 12 import javax.servlet.ServletException; … … 20 22 import net.sf.basedb.core.BioMaterialEvent; 21 23 import net.sf.basedb.core.BioMaterialEventSource; 24 import net.sf.basedb.core.BioMaterialList; 22 25 import net.sf.basedb.core.DbControl; 23 26 import net.sf.basedb.core.DerivedBioAssay; … … 30 33 import net.sf.basedb.core.SessionControl; 31 34 import net.sf.basedb.core.query.Annotations; 35 import net.sf.basedb.core.query.Expression; 36 import net.sf.basedb.core.query.Expressions; 32 37 import net.sf.basedb.core.query.Hql; 33 38 import net.sf.basedb.core.query.Orders; … … 36 41 import net.sf.basedb.reggie.Reggie; 37 42 import net.sf.basedb.reggie.dao.Annotationtype; 43 import net.sf.basedb.reggie.dao.BiomaterialList; 38 44 import net.sf.basedb.reggie.dao.FlowCell; 39 45 import net.sf.basedb.reggie.dao.PooledLibrary; … … 78 84 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 79 85 Subtype.POOLED_LIBRARY.addFilter(dc, query); 80 query.join(Hql.innerJoin("creationEvent", "ce")); 86 87 // Join the creation event 88 query.join(Hql.innerJoin(null, "creationEvent", "ce", true)); 89 // Filter on created date != null 81 90 query.restrict(Restrictions.neq(Hql.property("ce", "eventDate"), null)); 82 query.restrict(Restrictions.eq(Hql.property("originalQuantity"), Hql.property("remainingQuantity"))); 91 92 // Join AUTO_PROCESSING annotation 93 query.join(Annotations.leftJoin(null, Annotationtype.AUTO_PROCESSING.load(dc), "ap")); 94 95 /* Create filter: AUTO_PROCESS==ReProcess OR (AUTO_PROCESS=null AND original=remaining quantity) */ 96 Expression autoProcessing = Hql.alias("ap"); 97 query.restrict( 98 Restrictions.nullSafeOr( 99 Restrictions.eq(autoProcessing, Expressions.string("ReProcess")), 100 Restrictions.and( 101 Restrictions.eq(autoProcessing, null), 102 Restrictions.eq(Hql.property("originalQuantity"), Hql.property("remainingQuantity")) 103 ) 104 ) 105 ); 106 83 107 query.setCacheResult(true); 84 108 long count = query.count(dc); … … 318 342 // Sequencing start -- only if not failed 319 343 DerivedBioAssay sequenceRun = null; 320 if (!failed) 344 BioMaterialList flaggedPools = null; 345 Set<Extract> pools = null; 346 347 int numFlagged = 0; 348 if (failed) 349 { 350 flaggedPools = BiomaterialList.FLAGGED_POOL.load(dc); 351 pools = new HashSet<Extract>(); 352 } 353 else 321 354 { 322 355 Number sequencerId = (Number)jsonReq.get("sequencer"); … … 366 399 if (failed) 367 400 { 368 // TODO - How to mark the flow cells as failed??? 369 // Normally, it is not needed to flag RNA items for re-processing 370 // since there is plenty of material left in the pool 401 // If clustering failed, we flag the pools and add them to the 'Flagged pools' list. 402 // Typically, most pools have enough material to try clustering again but that 403 // the responsibility of another wizard 404 ItemQuery<Extract> query = flowCell.getExtracts(0); 405 for (Extract poolA : query.list(dc)) 406 { 407 Extract pool = (Extract)poolA.getParent(); 408 if (!pools.contains(pool)) 409 { 410 pools.add(pool); 411 flaggedPools.add(pool); 412 numFlagged++; 413 Annotationtype.FLAG.setAnnotationValue(dc, pool, PooledLibrary.FLAG_CLUSTERING_FAILED); 414 Annotationtype.AUTO_PROCESSING.setAnnotationValue(dc, pool, "Disable"); 415 } 416 } 417 371 418 Annotationtype.PLATE_PROCESS_RESULT.setAnnotationValue(dc, flowCell, ReactionPlate.PROCESS_FAILED); 372 419 jsonMessages.add("Flow cell '" + flowCell.getName() + "' registered with status: " + (ReactionPlate.PROCESS_FAILED)); … … 383 430 } 384 431 432 if (numFlagged > 0) 433 { 434 jsonMessages.add("Added " + numFlagged + " pools to '" + flaggedPools.getName() + "' list."); 435 } 436 385 437 dc.commit(); 386 438 } -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r2074 r2077 244 244 245 245 jsonChecks.add(checkAnnotationType(dc, Annotationtype.FLAG, 1, 246 new ValueOptions( Rna.FLAG_NOT_ENOUGH_REMAINING_QUANTITY, Rna.FLAG_LOW_QUALITY_SCORE,247 Rna.FLAG_ MANUAL,246 new ValueOptions( 247 Rna.FLAG_NOT_ENOUGH_REMAINING_QUANTITY, Rna.FLAG_LOW_QUALITY_SCORE, Rna.FLAG_MANUAL, 248 248 Rna.FLAG_MRNA_PLATE_FAILED, Rna.FLAG_CDNA_PLATE_FAILED, Rna.FLAG_LIB_PLATE_FAILED, 249 Rna.FLAG_EXCLUDED_FROM_POOL), 249 Rna.FLAG_EXCLUDED_FROM_POOL, 250 PooledLibrary.FLAG_CLUSTERING_FAILED), 250 251 effectiveOptions, createIfMissing)); 251 252 jsonChecks.add(checkAnnotationType(dc, Annotationtype.AUTO_PROCESSING, 1, … … 366 367 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.POOLED_LIBRARY, createIfMissing, 367 368 Annotationtype.POOL_MOLARITY, Annotationtype.POOL_CONC, Annotationtype.POOL_TARGET_VOLUME_PER_LIB, 368 Annotationtype.POOL_MIXING_STRATEGY, Annotationtype.POOL_DATE, Annotationtype.OPERATOR)); 369 Annotationtype.POOL_MIXING_STRATEGY, Annotationtype.POOL_DATE, Annotationtype.OPERATOR, 370 Annotationtype.FLAG, Annotationtype.AUTO_PROCESSING)); 369 371 370 372 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.FLOW_CELL, createIfMissing, … … 394 396 // Biomaterial lists 395 397 jsonChecks.add(checkBioMaterialList(dc, BiomaterialList.FLAGGED_RNA, effectiveOptions, createIfMissing)); 398 jsonChecks.add(checkBioMaterialList(dc, BiomaterialList.FLAGGED_POOL, effectiveOptions, createIfMissing)); 396 399 397 400 // MIME types
Note: See TracChangeset
for help on using the changeset viewer.