Changeset 2228
- Timestamp:
- Feb 14, 2014, 1:47:52 PM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/analysis/sequencing_confirm.jsp
r2226 r2228 88 88 { 89 89 var frm = document.forms['reggie']; 90 if ( document.getElementById('outcomeFailed').checked && !frm.verifyFailure.checked) return false;90 if (!document.getElementById('outcomeSuccess').checked && !frm.verifyFailure.checked) return false; 91 91 92 92 return true; … … 128 128 setInnerHTML('startDate', formatDate(seqRun.SequencingStart)); 129 129 setInnerHTML('endDate', formatDate(seqRun.SequencingEnd)); 130 131 Forms.checkRadio(frm.outcome, seqRun.SequencingResult || 'Successful'); 130 132 131 133 var html = ''; … … 169 171 170 172 var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; 171 var failed = document.getElementById('outcomeFailed').checked;173 var outcome = Forms.getCheckedRadio(frm, 'outcome').value; 172 174 173 175 frm.sequencingComments.value = seqRun.comments; … … 175 177 176 178 var fc = seqRun.flowCell; 177 if ( failed)179 if (outcome != 'Successful') 178 180 { 179 181 setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure'); … … 190 192 } 191 193 setInnerHTML('failedLanes', html); 194 Main.show('failedLanesRow'); 192 195 } 193 196 } … … 214 217 215 218 var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; 216 var failed = document.getElementById('outcomeFailed').checked;219 var outcome = Forms.getCheckedRadio(frm, 'outcome').value; 217 220 var submitInfo = {}; 218 221 219 222 seqRun.comments = frm.sequencingComments.value; 220 s ubmitInfo.failed = failed;223 seqRun.SequencingResult = outcome; 221 224 submitInfo.sequencingRun = seqRun; 222 225 223 if ( !failed)226 if (outcome == 'Successful') 224 227 { 225 228 var fc = seqRun.flowCell; … … 352 355 <td class="prompt">Outcome</td> 353 356 <td class="input"> 354 <input type="radio" name="outcome" id="outcomeSuccess" 355 checked><label for="outcomeSuccess">Success</label> - continue with demux<br> 356 <input type="radio" name="outcome" id="outcomeFailed" 357 ><label for="outcomeFailed">Failure</label> - no further analysis 357 <label><input type="radio" name="outcome" id="outcomeSuccess" value="Successful" 358 checked>Success</label> - continue with demux<br> 359 <label><input type="radio" name="outcome" id="outcomeFirstBaseReportFailed" value="FirstBaseReportFailed" 360 >FirstBaseReportFailed</label> - re-start sequencing<br> 361 <label><input type="radio" name="outcome" id="outcomeFailed" value="Failed" 362 >Failure</label> - flag pools for re-clustering 358 363 </td> 359 364 <td class="status"></td> 360 365 <td class="help"> 366 Select <b>FirstBaseReportFailed</b> if sequencing can be re-started with the 367 same flow cell. This is registered as a new sequencing run and no further analysis 368 is made from this run.<br> 361 369 Select the <b>Failure</b> option if further analysis of the data is not possible. 362 370 No child bioassay set will be created and existing pooled libraries will 363 be flagged for re- sequencing.371 be flagged for re-clustering on a new flow cell. 364 372 </td> 365 373 </tr> … … 390 398 <tr valign="top"> 391 399 <td class="prompt">Comments</td> 392 <td class="input"><textarea rows=" 4" cols="50" style="width: 90%;" name="sequencingComments" value=""></textarea></td>400 <td class="input"><textarea rows="6" cols="50" style="width: 95%;" name="sequencingComments" value=""></textarea></td> 393 401 <td class="status" id="sequencingComments.status"></td> 394 402 <td class="help"><span id="sequencingComments.message" class="message" style="display: none;"></span>Comments about the sequencing.</td> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/sequencing_ended.jsp
r2225 r2228 178 178 if (turnAroundDate == '') 179 179 { 180 setInputStatus('turnAroundDate', 'Missing date', 'warning'); 180 if (document.getElementById('firstBaseReportOk').checked) 181 { 182 setInputStatus('turnAroundDate', 'Missing date', 'warning'); 183 } 181 184 turnAroundDateIsValid = true; 182 185 return; … … 260 263 } 261 264 262 263 265 if (turnAroundDateIsValid) 264 266 { … … 266 268 var endTimestamp = Dates.parseString(frm.endDate.value + ' ' + frm.endTime.value, 'yyyyMMdd Hmm'); 267 269 268 if (turnAroundTimestamp .getTime() >= endTimestamp.getTime())270 if (turnAroundTimestamp != null && turnAroundTimestamp.getTime() >= endTimestamp.getTime()) 269 271 { 270 272 setInputStatus('endDate', 'End date must be after turnaround date', 'invalid'); … … 433 435 <td class="prompt">First base report</td> 434 436 <td class="input"> 435 <label><input type="radio" name="firstBaseReport" id="firstBaseReportOk" value="1" checked>Ok</label> 436 <label><input type="radio" name="firstBaseReport" id="firstBaseReportFailed" value="0">Failed</label> 437 <label><input type="radio" name="firstBaseReport" id="firstBaseReportOk" value="1" checked 438 onclick="turnAroundDateTimeOnChange()">Ok</label> 439 <label><input type="radio" name="firstBaseReport" id="firstBaseReportFailed" value="0" 440 onclick="turnAroundDateTimeOnChange()">Failed</label> 437 441 </td> 438 442 <td class="status" id="firstBaseReport.status"></td> … … 465 469 <tr valign="top"> 466 470 <td class="prompt">Comments</td> 467 <td class="input"><textarea rows=" 4" cols="50" style="width: 90%;" name="sequencingComments" value=""></textarea></td>471 <td class="input"><textarea rows="6" cols="50" style="width: 95%;" name="sequencingComments" value=""></textarea></td> 468 472 <td class="status" id="sequencingComments.status"></td> 469 473 <td class="help"><span id="sequencingComments.message" class="message" style="display: none;"></span>Comments about the sequencing.</td> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Annotationtype.java
r2226 r2228 752 752 753 753 /** 754 The "SequencingConfirmed" annotation, used for derived bioassays (SequencingRun). 755 Store a flag indicating that the sequencing result has been confirmed by a 756 user with {@link RegggieRole#SECONDARY_ANALYSIS} role. 757 @since 2.15 758 */ 759 public static final Annotationtype SEQUENCING_CONFIRMED = 760 new Annotationtype("SequencingConfirmed", Type.BOOLEAN, Item.DERIVEDBIOASSAY); 761 762 /** 754 763 Get the annotation type by name of the static constant defined in this class. 755 764 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r2226 r2228 345 345 new ValueOptions(SequencingRun.SEQUENCING_SUCCESSFUL, SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED, SequencingRun.SEQUENCING_FAILED), 346 346 effectivePermissionsUse, createIfMissing)); 347 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SEQUENCING_CONFIRMED, 1, null, effectivePermissionsUse, createIfMissing)); 347 348 348 349 // Annotation type categories … … 435 436 Annotationtype.SEQUENCING_START, Annotationtype.SEQUENCING_TURN_AROUND, Annotationtype.SEQUENCING_END, 436 437 Annotationtype.SEQUENCING_OPERATOR, Annotationtype.SEQUENCING_RUN_NUMBER, Annotationtype.SEQUENCING_CYCLES, 437 Annotationtype.HISEQ_POSITION, Annotationtype.DATA_FILES_FOLDER, Annotationtype.SEQUENCING_RESULT 438 Annotationtype.HISEQ_POSITION, Annotationtype.DATA_FILES_FOLDER, Annotationtype.SEQUENCING_RESULT, 439 Annotationtype.SEQUENCING_CONFIRMED 438 440 )); 439 441 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SequencingRunServlet.java
r2226 r2228 27 27 import net.sf.basedb.core.SessionControl; 28 28 import net.sf.basedb.core.query.Annotations; 29 import net.sf.basedb.core.query.Expressions; 29 30 import net.sf.basedb.core.query.Hql; 30 31 import net.sf.basedb.core.query.Restrictions; … … 124 125 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_END.load(dc), "sse")); 125 126 query.restrict(Restrictions.neq(Hql.alias("sse"), null)); 126 // Must NOT have a SEQUENCING_RESULT annotation 127 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_RESULT.load(dc), "ssr")); 128 query.restrict(Restrictions.eq(Hql.alias("ssr"), null)); 127 // Must have SEQUENCING_CONFIRMED=FALSE|NULL annotation 128 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_CONFIRMED.load(dc), "scf")); 129 query.restrict( 130 Restrictions.or( 131 Restrictions.eq(Hql.alias("scf"), Expressions.bool(false)), 132 Restrictions.eq(Hql.alias("scf"), null) 133 )); 129 134 long count = query.count(dc); 130 135 json.put("count", count); … … 139 144 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_END.load(dc), "sse")); 140 145 query.restrict(Restrictions.neq(Hql.alias("sse"), null)); 141 // Must NOT have a SEQUENCING_RESULT annotation 142 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_RESULT.load(dc), "ssr")); 143 query.restrict(Restrictions.eq(Hql.alias("ssr"), null)); 146 // Must have SEQUENCING_CONFIRMED=FALSE|NULL annotation 147 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_CONFIRMED.load(dc), "scf")); 148 query.restrict( 149 Restrictions.or( 150 Restrictions.eq(Hql.alias("scf"), Expressions.bool(false)), 151 Restrictions.eq(Hql.alias("scf"), null) 152 )); 144 153 145 154 JSONArray jsonRuns = new JSONArray(); … … 151 160 run.loadAnnotations(dc, "SequencingEnd", Annotationtype.SEQUENCING_END, Reggie.CONVERTER_DATETIME_TO_STRING); 152 161 run.loadAnnotations(dc, "HiSeqPosition", Annotationtype.HISEQ_POSITION, null); 162 run.loadAnnotations(dc, "SequencingResult", Annotationtype.SEQUENCING_RESULT, null); 153 163 run.setAnnotation("comments", run.getDerivedBioAssay().getDescription()); 154 164 … … 283 293 Annotationtype.SEQUENCING_TURN_AROUND.setAnnotationValue(dc, seqRun, turnAroundDate); 284 294 Annotationtype.SEQUENCING_END.setAnnotationValue(dc, seqRun, endDate); 295 Annotationtype.SEQUENCING_CONFIRMED.setAnnotationValue(dc, seqRun, false); 285 296 seqRun.setDescription((String)jsonSeq.get("comments")); 286 297 … … 308 319 JSONObject jsonSeq = (JSONObject)jsonReq.get("sequencingRun"); 309 320 JSONObject jsonFlowCell = (JSONObject)jsonSeq.get("flowCell"); 310 boolean failed = Boolean.TRUE.equals(jsonReq.get("failed")); 311 321 312 322 Number seqId = (Number)jsonSeq.get("id"); 313 323 DerivedBioAssay seqRun = DerivedBioAssay.getById(dc, seqId.intValue()); 314 324 seqRun.setDescription((String)jsonSeq.get("comments")); 315 316 BioMaterialList flaggedPools = null; 317 Set<Extract> pools = null; 318 int numFlagged = 0; 319 if (failed) 320 { 325 Annotationtype.SEQUENCING_CONFIRMED.setAnnotationValue(dc, seqRun, true); 326 String outcome = (String)jsonSeq.get("SequencingResult"); 327 328 Number fcId = (Number)jsonFlowCell.get("id"); 329 PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, fcId.intValue()); 330 331 if (SequencingRun.SEQUENCING_FAILED.equals(outcome)) 332 { 333 BioMaterialList flaggedPools = null; 334 Set<Extract> pools = null; 335 int numFlagged = 0; 336 337 // Flag pools for re-clustering 321 338 flaggedPools = BiomaterialList.FLAGGED_POOL.load(dc); 322 339 pools = new HashSet<Extract>(); 323 } 324 325 Number fcId = (Number)jsonFlowCell.get("id"); 326 PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, fcId.intValue()); 327 328 if (failed) 329 { 340 330 341 // Load pool aliquots and pools for all lanes 331 342 ItemQuery<Extract> aliquotQuery = flowCell.getExtracts(0); … … 348 359 } 349 360 } 350 } 351 else 361 362 if (numFlagged > 0) 363 { 364 jsonMessages.add("Added " + numFlagged + " pools to '" + flaggedPools.getName() + "' list."); 365 } 366 367 } 368 else if (SequencingRun.SEQUENCING_SUCCESSFUL.equals(outcome)) 352 369 { 353 370 JSONArray jsonFailedLanes = (JSONArray)jsonFlowCell.get("failedLanes"); … … 365 382 lanes = "Lanes " + Values.getString(jsonFailedLanes.subList(0, jsonFailedLanes.size()-1), ", ", true) + " and " + lastLane; 366 383 } 367 368 384 jsonMessages.add(lanes + " registered as failed."); 369 385 } 370 386 } 371 387 372 if (failed) 373 { 374 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, SequencingRun.SEQUENCING_FAILED); 375 jsonMessages.add(seqRun.getName() + " confirmed as failed."); 376 } 377 else 378 { 379 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, SequencingRun.SEQUENCING_SUCCESSFUL); 380 jsonMessages.add(seqRun.getName() + " confirmed as successful."); 381 } 382 383 if (numFlagged > 0) 384 { 385 jsonMessages.add("Added " + numFlagged + " pools to '" + flaggedPools.getName() + "' list."); 386 } 388 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, outcome); 389 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, flowCell, outcome); 390 jsonMessages.add(seqRun.getName() + " confirmed with status: " + outcome); 387 391 388 392 dc.commit();
Note: See TracChangeset
for help on using the changeset viewer.