Changeset 2236
- Timestamp:
- Feb 20, 2014, 8:57:39 AM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/analysis/sequencing_confirm.jsp
r2235 r2236 46 46 { 47 47 var seqRun = seqRuns[runNo]; 48 49 var option = new Option(seqRun.name+' (' + formatDate(seqRun.SequencingStart)+')', seqRun.id); 50 //option.title = title; 48 var flowCell = seqRun.flowCell; 49 var name = seqRun.name+': '; 50 51 var numPools = flowCell.pools.length; 52 var firstPoolNum = getPoolNum(flowCell.pools[0].name); 53 var lastPoolNum = getPoolNum(flowCell.pools[flowCell.pools.length-1].name); 54 55 if (lastPoolNum - firstPoolNum == numPools - 1) 56 { 57 // Display: PoolN -- PoolY 58 name += flowCell.pools[0].name + ' — ' + flowCell.pools[flowCell.pools.length-1].name; 59 } 60 else 61 { 62 // Display: PoolN + x more... 63 name += flowCell.pools[0].name + ' + ' + (numPools-1) + ' more...'; 64 } 65 66 // Tooltip is always all pools 67 var title = ''; 68 for (var poolNo=0; poolNo < numPools; poolNo++) 69 { 70 var pool = flowCell.pools[poolNo]; 71 if (poolNo > 0) title += ', '; 72 title += pool.name; 73 } 74 75 var option = new Option(name, seqRun.id); 76 option.title = title; 51 77 option.seqRun = seqRun; 52 78 frm.seqRuns.options[frm.seqRuns.length] = option; … … 65 91 } 66 92 93 function getPoolNum(poolName) 94 { 95 var num = poolName.match(/Pool(\d+)/); 96 return num ? parseInt(num[1], 10) : null; 97 } 98 99 67 100 function goNextAuto() 68 101 { … … 131 164 Forms.checkRadio(frm.outcome, seqRun.SequencingResult || 'Successful'); 132 165 outcomeOnChange(); 133 166 167 var fc = seqRun.flowCell; 168 setInnerHTML('flowCellInRun', '<b>['+seqRun.HiSeqPosition+']</b> ' + fc.FlowCellID); 169 170 var pools = fc.pools; 134 171 var html = ''; 135 var fc = seqRun.flowCell; 136 html += '<b>['+seqRun.HiSeqPosition+']</b> ' + fc.FlowCellID; 137 138 setInnerHTML('flowCellInRun', html); 172 var libPlateHtml = ''; 173 for (var poolNo = 0; poolNo < pools.length; poolNo++) 174 { 175 var pool = pools[poolNo]; 176 if (poolNo > 0) html += ', '; 177 html += Main.encodeTags(pool.name); 178 if (pool.LibPlate && libPlateHtml.indexOf(pool.LibPlate.name) == -1) 179 { 180 if (libPlateHtml.length > 0) libPlateHtml += ', '; 181 libPlateHtml += Main.encodeTags(pool.LibPlate.name); 182 } 183 } 184 setInnerHTML('pools', html); 185 setInnerHTML('libPlate', libPlateHtml || 'n/a'); 139 186 setInnerHTML('comments', Main.encodeTags(seqRun.comments)); 140 187 } … … 374 421 <td class="help"></td> 375 422 </tr> 376 377 423 <tr valign="top"> 378 424 <td class="subprompt">Flow cell</td> 379 425 <td class="input" id="flowCellInRun"></td> 426 <td class="status"></td> 427 <td class="help"></td> 428 </tr> 429 <tr valign="top"> 430 <td class="subprompt">Pools</td> 431 <td class="input" id="pools"></td> 432 <td class="status"></td> 433 <td class="help"></td> 434 </tr> 435 <tr valign="top"> 436 <td class="subprompt">LibPlate</td> 437 <td class="input" id="libPlate"></td> 380 438 <td class="status"></td> 381 439 <td class="help"></td> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/sequencing_ended.jsp
r2233 r2236 47 47 { 48 48 var seqRun = seqRuns[runNo]; 49 50 var option = new Option(seqRun.name+' (' + formatDate(seqRun.SequencingStart)+')', seqRun.id); 51 //option.title = title; 49 var flowCell = seqRun.flowCell; 50 var name = seqRun.name+': '; 51 52 var numPools = flowCell.pools.length; 53 var firstPoolNum = getPoolNum(flowCell.pools[0].name); 54 var lastPoolNum = getPoolNum(flowCell.pools[flowCell.pools.length-1].name); 55 56 if (lastPoolNum - firstPoolNum == numPools - 1) 57 { 58 // Display: PoolN -- PoolY 59 name += flowCell.pools[0].name + ' — ' + flowCell.pools[flowCell.pools.length-1].name; 60 } 61 else 62 { 63 // Display: PoolN + x more... 64 name += flowCell.pools[0].name + ' + ' + (numPools-1) + ' more...'; 65 } 66 67 // Tooltip is always all pools 68 var title = ''; 69 for (var poolNo=0; poolNo < numPools; poolNo++) 70 { 71 var pool = flowCell.pools[poolNo]; 72 if (poolNo > 0) title += ', '; 73 title += pool.name; 74 } 75 76 var option = new Option(name, seqRun.id); 77 option.title = title; 52 78 option.seqRun = seqRun; 53 79 frm.seqRuns.options[frm.seqRuns.length] = option; … … 64 90 // All is ok 65 91 frm.seqRuns.focus(); 92 } 93 94 function getPoolNum(poolName) 95 { 96 var num = poolName.match(/Pool(\d+)/); 97 return num ? parseInt(num[1], 10) : null; 66 98 } 67 99 … … 127 159 128 160 var fc = seqRun.flowCell; 129 var html = '<b>['+seqRun.HiSeqPosition+']</b> ' + fc.FlowCellID; 130 131 setInnerHTML('flowCellsInRun', html); 161 setInnerHTML('flowCellsInRun', '<b>['+seqRun.HiSeqPosition+']</b> ' + fc.FlowCellID); 162 163 var pools = fc.pools; 164 var html = ''; 165 var libPlateHtml = ''; 166 for (var poolNo = 0; poolNo < pools.length; poolNo++) 167 { 168 var pool = pools[poolNo]; 169 if (poolNo > 0) html += ', '; 170 html += Main.encodeTags(pool.name); 171 if (pool.LibPlate && libPlateHtml.indexOf(pool.LibPlate.name) == -1) 172 { 173 if (libPlateHtml.length > 0) libPlateHtml += ', '; 174 libPlateHtml += Main.encodeTags(pool.LibPlate.name); 175 } 176 } 177 setInnerHTML('pools', html); 178 setInnerHTML('libPlate', libPlateHtml || 'n/a'); 132 179 setInnerHTML('comments', Main.encodeTags(seqRun.comments)); 133 180 } … … 427 474 <td class="help"></td> 428 475 </tr> 429 430 476 <tr valign="top"> 431 477 <td class="subprompt">Flow cell</td> 432 478 <td class="input" id="flowCellsInRun"></td> 479 <td class="status"></td> 480 <td class="help"></td> 481 </tr> 482 <tr valign="top"> 483 <td class="subprompt">Pools</td> 484 <td class="input" id="pools"></td> 485 <td class="status"></td> 486 <td class="help"></td> 487 </tr> 488 <tr valign="top"> 489 <td class="subprompt">LibPlate</td> 490 <td class="input" id="libPlate"></td> 433 491 <td class="status"></td> 434 492 <td class="help"></td> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SequencingRunServlet.java
r2235 r2236 16 16 import org.json.simple.parser.JSONParser; 17 17 18 import net.sf.basedb.core.AnyToAny; 18 19 import net.sf.basedb.core.Application; 19 20 import net.sf.basedb.core.BioMaterialList; … … 33 34 import net.sf.basedb.reggie.dao.Annotationtype; 34 35 import net.sf.basedb.reggie.dao.BiomaterialList; 36 import net.sf.basedb.reggie.dao.BioplateType; 35 37 import net.sf.basedb.reggie.dao.FlowCell; 36 38 import net.sf.basedb.reggie.dao.PooledLibrary; 39 import net.sf.basedb.reggie.dao.ReactionPlate; 37 40 import net.sf.basedb.reggie.dao.ReggieRole; 38 41 import net.sf.basedb.reggie.dao.SequencingRun; … … 109 112 fc.loadAnnotations(dc, "FlowCellID", Annotationtype.FLOWCELL_ID, null); 110 113 fc.setAnnotation("comments", fc.getItem().getDescription()); 114 115 // Load pools on flow cell 116 List<PooledLibrary> pools = PooledLibrary.getByFlowCell(dc, fc); 117 JSONArray jsonPools = new JSONArray(); 118 for (PooledLibrary pool : pools) 119 { 120 try 121 { 122 AnyToAny libPlateLink = AnyToAny.getByName(dc, pool.getExtract(), "LibPlate"); 123 ReactionPlate libPlate = ReactionPlate.getById(dc, libPlateLink.getToId(), BioplateType.LIBRARY); 124 pool.setAnnotation("LibPlate", libPlate.asJSONObject()); 125 } 126 catch (RuntimeException ex) 127 {} 128 jsonPools.add(pool.asJSONObject()); 129 } 130 fc.setAnnotation("pools", jsonPools); 111 131 112 132 run.setAnnotation("flowCell", fc.asJSONObject()); … … 163 183 run.setAnnotation("comments", run.getDerivedBioAssay().getDescription()); 164 184 185 // Load flow cell information 165 186 FlowCell fc = FlowCell.getBySequencingRun(dc, run); 166 187 PhysicalBioAssay pba = fc.getItem(); … … 168 189 fc.setAnnotation("numLanes", pba.getSize()); 169 190 fc.setAnnotation("comments", pba.getDescription()); 191 192 // Load pools on flow cell 193 List<PooledLibrary> pools = PooledLibrary.getByFlowCell(dc, fc); 194 JSONArray jsonPools = new JSONArray(); 195 for (PooledLibrary pool : pools) 196 { 197 try 198 { 199 AnyToAny libPlateLink = AnyToAny.getByName(dc, pool.getExtract(), "LibPlate"); 200 ReactionPlate libPlate = ReactionPlate.getById(dc, libPlateLink.getToId(), BioplateType.LIBRARY); 201 pool.setAnnotation("LibPlate", libPlate.asJSONObject()); 202 } 203 catch (RuntimeException ex) 204 {} 205 jsonPools.add(pool.asJSONObject()); 206 } 207 fc.setAnnotation("pools", jsonPools); 170 208 171 209 run.setAnnotation("flowCell", fc.asJSONObject());
Note: See TracChangeset
for help on using the changeset viewer.