Changeset 4985
- Timestamp:
- Sep 28, 2018, 9:50:12 AM (5 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/analysis/demux_start.js
r4583 r4985 128 128 if (flowCell.FlowCellType) 129 129 { 130 name += ' [' + Strings.encodeTags(flowCell.FlowCellType) + ']'; 131 } 132 130 name += ' [' + flowCell.libraries.length + ' libraries; ' + Strings.encodeTags(flowCell.FlowCellType) + ']'; 131 } 132 133 // Count the number of libraries marked with DoNotUse 134 var numDoNotUse = 0; 135 for (var libNo = 0; libNo < flowCell.libraries.length; libNo++) 136 { 137 if (flowCell.libraries[libNo].DO_NOT_USE) numDoNotUse++; 138 } 139 flowCell.numDoNotUse = numDoNotUse; 140 133 141 // Tooltip is always all pools 134 142 var title = ''; … … 222 230 var numSelected = 0; 223 231 var pools; 232 var numDoNotUse = 0; 224 233 Wizard.setInputStatus('seqRuns'); 225 234 for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++) … … 231 240 { 232 241 pools = frm.seqRuns[seqNo].seqRun.flowCell.pools; 242 numDoNotUse = frm.seqRuns[seqNo].seqRun.flowCell.numDoNotUse; 233 243 } 234 244 else … … 246 256 { 247 257 Wizard.setInputStatus('seqRuns', 'invalid', 'Select at least one sequencing run'); 258 return; 259 } 260 261 if (numDoNotUse > 0) 262 { 263 var msg = numDoNotUse == 1 ? '1 library is marked with DoNotUse.' : 264 numDoNotUse + ' libraries are marked with DoNotUse.' 265 Wizard.setInputStatus('seqRuns', 'warning', msg); 248 266 } 249 267 else … … 276 294 var seqRun = frm.seqRuns[seqNo].seqRun; 277 295 var fc = seqRun.flowCell; 296 var libs = fc.libraries; 278 297 var readStringId = 'readString.'+seqNo; 279 298 html += '<tr>'; … … 310 329 html += '</tr>'; 311 330 331 // Check for DoNotUse 332 if (fc.numDoNotUse > 0) 333 { 334 var text = fc.numDoNotUse == 1 ? '1 library' : fc.numDoNotUse + ' libraries'; 335 html += '<tr>'; 336 html += '<td class="subprompt">DoNotUse</td>'; 337 html += '<td><label><input type="checkbox" name="excludeDoNotUse.'+seqNo+'" checked>Exclude ' + text + ' marked with DoNotUse</label>'; 338 html += ' <img src="../images/info.png" class="link" id="donotuseinfo.'+seqNo+'" data-seq-no="'+seqNo+'" title="More information about the libraries..."></td>'; 339 html += '<td class="status warning"></td>'; 340 html += '<td class="help">By default, libraries marked with DoNotUse are omitted</td>'; 341 html += '</tr>'; 342 } 343 312 344 html += '<tr>'; 313 345 html += '<td class="subprompt"></td>'; … … 327 359 Events.addEventHandler('readString.'+seqNo, 'blur', demux.readStringOnBlur); 328 360 Buttons.addClickHandler('check.'+seqNo, demux.checkDataFilesOnClick); 361 Buttons.addClickHandler('donotuseinfo.'+seqNo, demux.showDoNotUseInfo); 329 362 } 330 363 } … … 349 382 } 350 383 384 demux.showDoNotUseInfo = function(event) 385 { 386 var frm = document.forms['reggie']; 387 var seqNo = Data.get(event.currentTarget, 'seq-no'); 388 var seqRun = frm.seqRuns[seqNo].seqRun; 389 var fc = seqRun.flowCell; 390 var libs = fc.libraries; 391 392 var msg = '<table>'; 393 for (var libNo = 0; libNo < libs.length; libNo++) 394 { 395 var lib = libs[libNo]; 396 if (lib.DO_NOT_USE) 397 { 398 msg += '<tr><td><b>'+Strings.encodeTags(lib.name) + '</b></td><td><span class="itemsubtype">[' + lib.DO_NOT_USE + ']</span></td>'; 399 msg += '<td>'+ Strings.encodeTags(lib.DO_NOT_USE_COMMENT) + '</td></tr>'; 400 } 401 } 402 msg += '</table>'; 403 Forms.showNotification(event.currentTarget, msg, 'donotuseinfo', 'pointer-left'); 404 } 405 351 406 demux.clustersLoaded = function(response) 352 407 { … … 555 610 } 556 611 seqRun.OmitLanes = omitLanes; 612 seqRun.excludeDoNotUse = frm['excludeDoNotUse.'+seqNo].checked; 557 613 sequencingRuns[sequencingRuns.length] = seqRun; 558 614 } -
extensions/net.sf.basedb.reggie/trunk/resources/analysis/demux_start.jsp
r3976 r4985 27 27 scripts="~../reggie-2.js,~demux_start.js" 28 28 styles="path.css,~../css/reggie-2.css" 29 /> 29 > 30 <style> 31 .notify.donotuseinfo 32 { 33 width: auto; 34 max-width: 60em; 35 font-weight: normal; 36 background-color: #F8F8E8; 37 border-color: inherit; 38 } 39 40 .notify.donotuseinfo > div:first-child > div 41 { 42 border-color: #F8F8E8; 43 } 44 45 .notify .notify-message:before 46 { 47 content: url('../images/info.png'); 48 } 49 50 .donotuseinfo td 51 { 52 vertical-align: top; 53 padding: 2px; 54 } 55 </style> 56 57 </base:head> 30 58 <base:body> 31 59 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/autoconfirm/SequencingRunAutoConfirmer.java
r4306 r4985 195 195 jobCreator.setPriority(priority); 196 196 197 DemuxDefinition demuxDef = new DemuxDefinition(sr, readString, null );197 DemuxDefinition demuxDef = new DemuxDefinition(sr, readString, null, true); 198 198 Job demuxJob = jobCreator.createDemuxJob(dc, cluster, Arrays.asList(demuxDef), null); 199 199 dc.commit(); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/ReggieItem.java
r4983 r4985 616 616 } 617 617 } 618 619 /** 620 Sorts a list of items by name. 621 @since 4.20 622 */ 623 public static class NameComparator 624 implements Comparator<ReggieItem<?>> 625 { 626 public NameComparator() 627 {} 628 629 @Override 630 public int compare(ReggieItem<?> item1, ReggieItem<?> item2) 631 { 632 return item1.getName().compareTo(item2.getName()); 633 } 634 635 } 636 618 637 } -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/DemuxJobCreator.java
r4882 r4985 423 423 List<Extract> libsInPool = libQuery.list(dc); 424 424 List<DerivedBioAssay> mergedInPool = new ArrayList<DerivedBioAssay>(libsInPool.size()); 425 List<Extract> doNotUseInPool = new ArrayList<Extract>(); 425 426 426 427 for (Extract lib : libsInPool) 427 428 { 428 // Create MergedSequences item if needed 429 DerivedBioAssay merged = mergedSequences.get(lib); 430 if (merged == null) 429 String doNotUse = (String)Annotationtype.DO_NOT_USE.getAnnotationValue(dc, lib); 430 if (def.excludeDoNotUse && doNotUse != null) 431 431 { 432 Library l = Library.getById(dc, lib.getId()); 433 String mergeName = ScriptUtil.checkValidFilename(l.getNextMergedSequencesName(dc)); 434 merged = DerivedBioAssay.getNew(dc, false, demuxJob); 435 merged.setItemSubtype(mergedType); 436 merged.setName(mergeName); 437 merged.setSoftware(mergeSoftware); 438 merged.setProtocol(mergeProtocol); 439 merged.setExtract(lib); 440 441 String dataFilesFolder = ScriptUtil.checkValidPath(MergedSequences.generateDataFilesFolderForProjectArchive(mergeName, debug), true, true); 442 443 Annotationtype.DATA_FILES_FOLDER.setAnnotationValue(dc, merged, dataFilesFolder); 444 dc.saveItem(merged); 445 mergedSequences.put(lib, merged); 446 447 //jsonMessages.add("Created " + merged.getName()); 432 doNotUseInPool.add(lib); 448 433 } 449 mergedInPool.add(merged); 450 if (libsOnFlowCell.add(lib)) 434 else 451 435 { 452 // First time for this lib on the flow cell 453 merged.addParent(demux); 436 // Create MergedSequences item if needed 437 DerivedBioAssay merged = mergedSequences.get(lib); 438 if (merged == null) 439 { 440 Library l = Library.getById(dc, lib.getId()); 441 String mergeName = ScriptUtil.checkValidFilename(l.getNextMergedSequencesName(dc)); 442 merged = DerivedBioAssay.getNew(dc, false, demuxJob); 443 merged.setItemSubtype(mergedType); 444 merged.setName(mergeName); 445 merged.setSoftware(mergeSoftware); 446 merged.setProtocol(mergeProtocol); 447 merged.setExtract(lib); 448 449 String dataFilesFolder = ScriptUtil.checkValidPath(MergedSequences.generateDataFilesFolderForProjectArchive(mergeName, debug), true, true); 450 451 Annotationtype.DATA_FILES_FOLDER.setAnnotationValue(dc, merged, dataFilesFolder); 452 dc.saveItem(merged); 453 mergedSequences.put(lib, merged); 454 455 //jsonMessages.add("Created " + merged.getName()); 456 } 457 mergedInPool.add(merged); 458 if (libsOnFlowCell.add(lib)) 459 { 460 // First time for this lib on the flow cell 461 merged.addParent(demux); 462 } 454 463 } 455 464 } … … 463 472 // Export all required barcode files, 2 files per lane per flow cell 464 473 StringWriter out = new StringWriter(); 465 exporter.exportBarcodesFile(dc, demux, laneNo, mergedInPool, out);474 exporter.exportBarcodesFile(dc, demux, laneNo, mergedInPool, doNotUseInPool, out); 466 475 jobDef.addFile(new StringUploadSource(barcodesFile, out.toString())); 467 476 468 477 out = new StringWriter(); 469 exporter.exportMultiplexFile(dc, demux, laneNo, mergedInPool, out, "fastq");478 exporter.exportMultiplexFile(dc, demux, laneNo, mergedInPool, doNotUseInPool, out, "fastq"); 470 479 jobDef.addFile(new StringUploadSource(multiplexFile, out.toString())); 471 480 … … 734 743 final String readString; 735 744 final List<Integer> omitLanes; 736 737 public DemuxDefinition(SequencingRun seqRun, String readString, List<? extends Number> omitLanes) 745 final boolean excludeDoNotUse; 746 747 public DemuxDefinition(SequencingRun seqRun, String readString, List<? extends Number> omitLanes, boolean excludeDoNotUse) 738 748 { 739 749 this.seqRun = seqRun; … … 747 757 } 748 758 } 759 this.excludeDoNotUse = excludeDoNotUse; 749 760 } 750 761 … … 859 870 sumDemux.addWarning("PF_NNNN_PCT is " + Values.formatNumber(passedFilterPct, 2) + "% on lane " + laneNo + " (" + poolName + ")"); 860 871 } 872 } 873 else if ("IGNORED".equals(libName)) 874 { 875 libName = demuxName+".I"; 861 876 } 862 877 else if ("UNUSED".equals(libName)) … … 1068 1083 Reads demuxN = sumReads.remove(demuxName+".N"); 1069 1084 Reads demuxUnused = sumReads.remove(demuxName+".U"); 1085 Reads demuxIgnore = sumReads.remove(demuxName+".I"); 1070 1086 1071 1087 DemuxedSequences demux = DemuxedSequences.getByName(dc, demuxName); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/BarcodeFilesForDemuxExporter.java
r4306 r4985 53 53 when running "picard ExtractIlluminaBarcodes" for the given lane. 54 54 */ 55 public void exportBarcodesFile(DbControl dc, DerivedBioAssay demux, int laneNo, List<DerivedBioAssay> mergedInLane, Writer out)55 public void exportBarcodesFile(DbControl dc, DerivedBioAssay demux, int laneNo, List<DerivedBioAssay> mergedInLane, List<Extract> libIgnore, Writer out) 56 56 { 57 57 TableWriter tw = createTableWriter(out); … … 72 72 tw.tablePrintData(info); 73 73 barcodes.remove(barcode); 74 } 75 76 // Libraries that should be ignored 77 // We can't put them under the "UNUSED" tag since the demux will warn if it finds 78 // a large number of unused barcodes! 79 for (Extract lib : libIgnore) 80 { 81 Tag barcode = lib.getTag(); 82 if (barcodes.remove(barcode)) 83 { 84 info[0] = checkValidBarcodeSequence(dc, barcode); 85 info[1] = checkValidBarcodeName(barcode); 86 info[2] = "IGNORED"; 87 tw.tablePrintData(info); 88 } 74 89 } 75 90 … … 93 108 when running "picard IlluminaBasecallsToFastq" for the given lane. 94 109 */ 95 public void exportMultiplexFile(DbControl dc, DerivedBioAssay demux, int laneNo, List<DerivedBioAssay> mergedInLane, Writer out, String outFolder)110 public void exportMultiplexFile(DbControl dc, DerivedBioAssay demux, int laneNo, List<DerivedBioAssay> mergedInLane, List<Extract> libIgnore, Writer out, String outFolder) 96 111 { 97 112 TableWriter tw = createTableWriter(out); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/DemuxMergeServlet.java
r4597 r4985 6 6 import java.util.List; 7 7 import java.util.Set; 8 import java.util.TreeSet; 8 9 9 10 import javax.servlet.ServletException; … … 52 53 import net.sf.basedb.reggie.dao.PooledLibrary; 53 54 import net.sf.basedb.reggie.dao.ReactionPlate; 55 import net.sf.basedb.reggie.dao.ReggieItem; 54 56 import net.sf.basedb.reggie.dao.ReggieRole; 55 57 import net.sf.basedb.reggie.dao.Rna; … … 344 346 String readString = (String)jsonSeqRun.get("ReadString"); 345 347 JSONArray jsonOmitLanes = (JSONArray)jsonSeqRun.get("OmitLanes"); 348 boolean excludeDoNotUse = Boolean.TRUE.equals(jsonSeqRun.get("excludeDoNotUse")); 346 349 347 350 SequencingRun seqRun = SequencingRun.getById(dc, seqRunId.intValue()); 348 351 Annotationtype.AUTO_PROCESSING.setAnnotationValue(dc, seqRun.getItem(), null); 349 352 350 demuxDefs.add(new DemuxDefinition(seqRun, readString, jsonOmitLanes ));353 demuxDefs.add(new DemuxDefinition(seqRun, readString, jsonOmitLanes, excludeDoNotUse)); 351 354 } 352 355 … … 596 599 // Load pools on flow cell 597 600 List<PooledLibrary> pools = PooledLibrary.getByFlowCell(dc, fc); 601 Set<Library> libs = new TreeSet<>(new ReggieItem.NameComparator()); 602 598 603 JSONArray jsonPools = new JSONArray(); 599 604 for (PooledLibrary pool : pools) 600 605 { 606 libs.addAll(Library.getByPool(dc, pool)); 601 607 try 602 608 { … … 610 616 } 611 617 fc.setAnnotation("pools", jsonPools); 618 619 JSONArray jsonLibs = new JSONArray(); 620 for (Library lib : libs) 621 { 622 lib.loadDoNotUseAnnotations(dc, null); 623 jsonLibs.add(lib.asJSONObject()); 624 } 625 fc.setAnnotation("libraries", jsonLibs); 626 612 627 run.setAnnotation("flowCell", fc.asJSONObject()); 613 628 }
Note: See TracChangeset
for help on using the changeset viewer.