Changeset 2225
- Timestamp:
- Feb 13, 2014, 8:44:46 AM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/libprep/sequencing_ended.jsp
r2198 r2225 124 124 var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; 125 125 126 setInnerHTML('startDate', formatDate(seqRun.sequencingStart)); 127 128 var html = ''; 129 for (var fcNo = 0; fcNo < seqRun.flowCells.length; fcNo++) 130 { 131 var fc = seqRun.flowCells[fcNo]; 132 if (fcNo > 0) html += '<br>'; 133 html += '<b>['+fc.HiSeqPosition+']</b> ' + fc.FlowCellID; 134 } 126 setInnerHTML('startDate', formatDate(seqRun.SequencingStart)); 127 128 var fc = seqRun.flowCell; 129 var html = '<b>['+seqRun.HiSeqPosition+']</b> ' + fc.FlowCellID; 135 130 136 131 setInnerHTML('flowCellsInRun', html); … … 168 163 setInnerHTML('step.2.title', seqRun.name); 169 164 170 // Flow cell comments171 var html = '';172 for (var fcNo = 0; fcNo < seqRun.flowCells.length; fcNo++)173 {174 var fc = seqRun.flowCells[fcNo];175 176 html += '<tr valign="top">';177 html += '<td class="prompt">Flow cell ['+fc.HiSeqPosition+']</td>';178 html += '<td class="input"><b>' + fc.FlowCellID + '</b></td>';179 html += '<td class="status"></td>';180 html += '<td class="help"></td>';181 html += '</tr>';182 183 html += '<tr valign="top">';184 html += '<td class="subprompt">Comments</td>';185 html += '<td class="input"><textarea rows="4" cols="50" style="width: 90%;" name="comments.'+fc.id+'" value=""></textarea></td>';186 html += '<td class="status"></td>';187 html += '<td class="help">Comments for the flow cell.</td>';188 html += '</tr>';189 }190 191 setInnerHTML('flowCells', html);192 193 for (var fcNo = 0; fcNo < seqRun.flowCells.length; fcNo++)194 {195 var fc = seqRun.flowCells[fcNo];196 frm['comments.'+fc.id].value = fc.comments;197 }198 199 165 frm.turnAroundDate.focus(); 200 166 } … … 322 288 frm.endTime.disabled = true; 323 289 frm.sequencingComments.disabled = true; 324 325 326 var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; 327 for (var fcNo = 0; fcNo < seqRun.flowCells.length; fcNo++) 328 { 329 var fc = seqRun.flowCells[fcNo]; 330 frm['comments.'+fc.id].disabled = true; 331 fc.comments = frm['comments.'+fc.id].value; 332 } 290 frm.firstBaseReport[0].disabled = true; 291 frm.firstBaseReport[1].disabled = true; 333 292 334 293 Main.hide('goregister'); … … 336 295 Main.hide('gonext.message'); 337 296 338 297 var seqRun = frm.seqRuns[frm.seqRuns.selectedIndex].seqRun; 298 seqRun.firstBaseReportFailed = document.getElementById('firstBaseReportFailed').checked; 339 299 seqRun.turnAroundDate = Main.trimString(frm.turnAroundDate.value + ' ' + frm.turnAroundTime.value); 340 300 seqRun.endDate = Main.trimString(frm.endDate.value + ' ' + frm.endTime.value); … … 449 409 450 410 <tr valign="top"> 451 <td class="subprompt">- flow cell s</td>411 <td class="subprompt">- flow cell</td> 452 412 <td class="input" id="flowCellsInRun"></td> 453 413 <td class="status"></td> … … 471 431 <table> 472 432 <tr valign="top"> 433 <td class="prompt">First base report</td> 434 <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 </td> 438 <td class="status" id="firstBaseReport.status"></td> 439 <td class="help"><span id="firstBaseReport.message" class="message" style="display: none;"></span> 440 If first base report failed and a restart was possible a new 'sequencing start' 441 must be registered. 442 </td> 443 </tr> 444 <tr valign="top"> 473 445 <td class="prompt">Turn-around date</td> 474 446 <td class="input"><input type="text" name="turnAroundDate" value="" size="12" maxlength="10" … … 497 469 <td class="help"><span id="sequencingComments.message" class="message" style="display: none;"></span>Comments about the sequencing.</td> 498 470 </tr> 499 500 <tbody id="flowCells"></tbody>501 502 471 </table> 503 472 </td> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/sequencing_started.jsp
r2224 r2225 254 254 html += '<tr valign="top" class="fc-info">'; 255 255 html += '<td class="subprompt">'+seqRun.name+'</td>'; 256 html += '<td class="input">'+formatDate(seqRun.SequencingStart, '(no start date)') + ' -- ' + formatDate(seqRun.SequencingEnd, '(no end date)')+'</td>'; 257 html += '<td class="status"></td>'; 256 html += '<td class="input" colspan="2">'; 257 html += formatDate(seqRun.SequencingStart, '(no start date)') + ' -- ' + formatDate(seqRun.SequencingEnd, '(no end date)'); 258 if (seqRun.SequencingResult) 259 { 260 html += ': ' + seqRun.SequencingResult; 261 } 262 html += '</td>'; 258 263 html += '<td class="help"></td>'; 259 264 html += '</tr>'; -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Annotationtype.java
r2224 r2225 728 728 new Annotationtype("DataFilesFolder", Type.STRING, Item.DERIVEDBIOASSAY); 729 729 730 730 /** 731 The "SequencingResult" annotation, used for derived bioassays (SequencingRun). 732 A value of "Successful" typically means that the process can continue with 733 next step (demux and merge). A value of "Failed" indicates a complete 734 failure that require a new flow cell to be clustered. The pooled 735 libraries on the current flow cell are flagged with "SequencingFailed". 736 A value of "FirstBaseReportFailed" indicates that the first sequencing attempt 737 failed but that it is possible to re-start with the same flow cell. The 738 annotation is also copied to the flow cell. 739 @since 2.15 740 */ 741 public static final Annotationtype SEQUENCING_RESULT = 742 new Annotationtype("SequencingResult", Type.STRING, Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY); 743 731 744 /** 732 745 Get the annotation type by name of the static constant defined in this class. -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/FlowCell.java
r2222 r2225 80 80 81 81 /** 82 Load pools used on the flow cell.82 Load the flow cell on the sequening run. 83 83 */ 84 public static List<FlowCell>getBySequencingRun(DbControl dc, SequencingRun sequencingRun)84 public static FlowCell getBySequencingRun(DbControl dc, SequencingRun sequencingRun) 85 85 { 86 86 ItemQuery<PhysicalBioAssay> fcQuery = PhysicalBioAssay.getQuery(); … … 96 96 List<PhysicalBioAssay> tmp = fcQuery.list(dc); 97 97 98 return toList(tmp); 98 PhysicalBioAssay fc = null; 99 if (tmp.size() > 1) 100 { 101 throw new InvalidDataException( 102 "More than one flow cell was found on " + sequencingRun.getName() + 103 "This wizard can't be used until that is corrected."); 104 } 105 else if (tmp.size() == 1) 106 { 107 fc = tmp.get(0); 108 } 109 110 return fc == null ? null : new FlowCell(fc); 99 111 } 100 112 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/SequencingRun.java
r2224 r2225 27 27 { 28 28 29 /** 30 Value for the {@link Annotationtype#SEQUENCING_RESULT} annotation 31 when the sequencing was successful. 32 @since 2.15 33 */ 34 public static final String SEQUENCING_SUCCESSFUL = "Successful"; 35 36 /** 37 Value for the {@link Annotationtype#SEQUENCING_RESULT} annotation when 38 the sequencing failed and a new flow cell must be used for re-sequencing. 39 @since 2.15 40 */ 41 public static final String SEQUENCING_FAILED = "Failed"; 42 43 /** 44 Value for the {@link Annotationtype#SEQUENCING_RESULT} annotation when 45 the first base report failed and the same flow cell can be used 46 for re-sequencing. 47 @since 2.15 48 */ 49 public static final String SEQUENCING_FIRST_BASE_REPORT_FAILED = "FirstBaseReportFailed"; 50 29 51 /** 30 52 Get a sequencing run when the id is known. -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java
r2224 r2225 45 45 import net.sf.basedb.reggie.dao.ReactionPlate; 46 46 import net.sf.basedb.reggie.dao.ReggieRole; 47 import net.sf.basedb.reggie.dao.SequencingRun; 47 48 import net.sf.basedb.reggie.dao.Subtype; 48 49 import net.sf.basedb.util.Values; … … 250 251 query.join(Annotations.leftJoin(null, Annotationtype.PLATE_PROCESS_RESULT.load(dc), "ppr")); 251 252 query.restrict(Restrictions.eq(Hql.alias("ppr"), Expressions.string(ReactionPlate.PROCESS_SUCCESSFUL))); 252 // but no child SequencingRun items 253 // but no child SequencingRun items (unless SequencingResult=FirstBaseReportFailed is set) 254 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_RESULT.load(dc), "sqr")); 253 255 query.join(Hql.leftJoin("derivedBioAssays", "ssr")); 254 query.restrict(Restrictions.eq(Hql.alias("ssr"), null)); 255 256 query.restrict( 257 Restrictions.or( 258 Restrictions.eq(Hql.alias("ssr"), null), 259 Restrictions.eq(Hql.alias("sqr"), Expressions.string(SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED)) 260 )); 261 256 262 long count = query.count(dc); 257 263 json.put("count", count); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r2224 r2225 64 64 import net.sf.basedb.reggie.dao.ReggieRole; 65 65 import net.sf.basedb.reggie.dao.Rna; 66 import net.sf.basedb.reggie.dao.SequencingRun; 66 67 import net.sf.basedb.reggie.dao.Subtype; 67 68 import net.sf.basedb.reggie.plugins.CaliperLibPrepParametersExporter; … … 340 341 effectivePermissionsUse, createIfMissing)); 341 342 jsonChecks.add(checkAnnotationType(dc, Annotationtype.DATA_FILES_FOLDER, 1, null, effectivePermissionsUse, createIfMissing)); 343 jsonChecks.add(checkAnnotationType(dc, Annotationtype.SEQUENCING_RESULT, 1, 344 new ValueOptions(SequencingRun.SEQUENCING_SUCCESSFUL, SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED, SequencingRun.SEQUENCING_FAILED), 345 effectivePermissionsUse, createIfMissing)); 342 346 343 347 // Annotation type categories … … 423 427 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.FLOW_CELL, createIfMissing, 424 428 Annotationtype.FLOWCELL_ID, Annotationtype.CLUSTER_START, Annotationtype.CLUSTER_OPERATOR, 425 Annotationtype.SEQUENCING_CYCLES, Annotationtype.PLATE_PROCESS_RESULT ));429 Annotationtype.SEQUENCING_CYCLES, Annotationtype.PLATE_PROCESS_RESULT, Annotationtype.SEQUENCING_RESULT)); 426 430 427 431 jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.SEQUENCING_RUN, createIfMissing, 428 432 Annotationtype.SEQUENCING_START, Annotationtype.SEQUENCING_TURN_AROUND, Annotationtype.SEQUENCING_END, 429 433 Annotationtype.SEQUENCING_OPERATOR, Annotationtype.SEQUENCING_RUN_NUMBER, Annotationtype.SEQUENCING_CYCLES, 430 Annotationtype.HISEQ_POSITION, Annotationtype.DATA_FILES_FOLDER 434 Annotationtype.HISEQ_POSITION, Annotationtype.DATA_FILES_FOLDER, Annotationtype.SEQUENCING_RESULT 431 435 )); 432 436 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SequencingRunServlet.java
r2224 r2225 90 90 query.join(Annotations.leftJoin(null, Annotationtype.SEQUENCING_END.load(dc), "sse")); 91 91 query.restrict(Restrictions.eq(Hql.alias("sse"), null)); 92 93 92 94 93 JSONArray jsonRuns = new JSONArray(); 95 94 List<SequencingRun> runs = SequencingRun.toList(query.list(dc)); 96 95 for (SequencingRun run : runs) 97 96 { 98 run.loadAnnotations(dc, "sequencingStart", Annotationtype.SEQUENCING_START, Reggie.CONVERTER_DATE_TO_STRING); 97 run.loadAnnotations(dc, "SequencingStart", Annotationtype.SEQUENCING_START, Reggie.CONVERTER_DATE_TO_STRING); 98 run.loadAnnotations(dc, "HiSeqPosition", Annotationtype.HISEQ_POSITION, null); 99 99 run.setAnnotation("comments", run.getDerivedBioAssay().getDescription()); 100 100 101 JSONArray jsonFlowCells = new JSONArray(); 102 List<FlowCell> flowCells = FlowCell.getBySequencingRun(dc, run); 103 for (FlowCell fc : flowCells) 104 { 105 fc.loadAnnotations(dc, "FlowCellID", Annotationtype.FLOWCELL_ID, null); 106 fc.loadAnnotations(dc, "HiSeqPosition", Annotationtype.HISEQ_POSITION, null); 107 fc.setAnnotation("comments", fc.getItem().getDescription()); 108 jsonFlowCells.add(fc.asJSONObject()); 109 } 110 run.setAnnotation("flowCells", jsonFlowCells); 101 FlowCell fc = FlowCell.getBySequencingRun(dc, run); 102 fc.loadAnnotations(dc, "FlowCellID", Annotationtype.FLOWCELL_ID, null); 103 fc.setAnnotation("comments", fc.getItem().getDescription()); 104 105 run.setAnnotation("flowCell", fc.asJSONObject()); 111 106 jsonRuns.add(run.asJSONObject()); 112 107 } … … 126 121 seqRun.loadAnnotations(dc, "SequencingStart", Annotationtype.SEQUENCING_START, Reggie.CONVERTER_DATE_TO_STRING); 127 122 seqRun.loadAnnotations(dc, "SequencingEnd", Annotationtype.SEQUENCING_END, Reggie.CONVERTER_DATE_TO_STRING); 123 seqRun.loadAnnotations(dc, "SequencingResult", Annotationtype.SEQUENCING_RESULT, null); 128 124 seqRun.loadAnnotations(dc, "DataFilesFolder", Annotationtype.DATA_FILES_FOLDER, null); 129 125 jsonSeqRuns.add(seqRun.asJSONObject()); … … 197 193 Number flowCellId = (Number)jsonFlowCell.get("id"); 198 194 PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, flowCellId.intValue()); 195 // Clear result of any previous sequencing runs (eg. FirstBaseReportFailed) 196 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, flowCell, null); 199 197 sequenceRun.addPhysicalBioAssay(flowCell); 200 198 … … 218 216 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 219 217 JSONObject jsonSeq = (JSONObject)jsonReq.get("sequencingRun"); 220 JSON Array jsonFlowCells = (JSONArray)jsonSeq.get("flowCells");218 JSONObject jsonFlowCell = (JSONObject)jsonSeq.get("flowCell"); 221 219 222 220 Number seqId = (Number)jsonSeq.get("id"); 223 221 DerivedBioAssay seqRun = DerivedBioAssay.getById(dc, seqId.intValue()); 222 Number flowCellId = (Number)jsonFlowCell.get("id"); 223 PhysicalBioAssay fc = PhysicalBioAssay.getById(dc, flowCellId.intValue()); 224 224 225 225 Date turnAroundDate = Reggie.CONVERTER_STRING_TO_DATETIME.convert((String)jsonSeq.get("turnAroundDate")); … … 227 227 Annotationtype.SEQUENCING_TURN_AROUND.setAnnotationValue(dc, seqRun, turnAroundDate); 228 228 Annotationtype.SEQUENCING_END.setAnnotationValue(dc, seqRun, endDate); 229 230 229 seqRun.setDescription((String)jsonSeq.get("comments")); 231 230 232 for (int fcNo = 0; fcNo < jsonFlowCells.size(); ++fcNo) 233 { 234 JSONObject jsonFlowCell = (JSONObject)jsonFlowCells.get(fcNo); 235 Number fcId = (Number)jsonFlowCell.get("id"); 236 237 PhysicalBioAssay flowCell = PhysicalBioAssay.getById(dc, fcId.intValue()); 238 flowCell.setDescription((String)jsonFlowCell.get("comments")); 239 } 240 241 jsonMessages.add(seqRun.getName() + " registered as ended."); 231 if (Boolean.TRUE.equals(jsonSeq.get("firstBaseReportFailed"))) 232 { 233 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED); 234 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, fc, SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED); 235 jsonMessages.add(seqRun.getName() + " registered as ended with status: " + SequencingRun.SEQUENCING_FIRST_BASE_REPORT_FAILED); 236 } 237 else 238 { 239 Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, fc, null); 240 jsonMessages.add(seqRun.getName() + " registered as ended."); 241 } 242 242 243 dc.commit(); 243 244 }
Note: See TracChangeset
for help on using the changeset viewer.