Changeset 2232
- Timestamp:
- Feb 17, 2014, 3:30:06 PM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/reports/case_summary.jsp
r2159 r2232 780 780 } 781 781 } 782 783 var sequencingRuns = consentOk ? response.sequencingRun : null; 784 if (sequencingRuns && sequencingRuns.length > 0) 785 { 786 var truncateAt = TRUNCATE_SIZE[Math.min(sequencingRuns.length-1, TRUNCATE_SIZE.length)]; 787 for (var i = 0; i < sequencingRuns.length; i++) 788 { 789 var sr = sequencingRuns[i]; 790 var fc = sr.flowCell; 791 addColumn('sequencingRun.name', makeLink('DERIVEDBIOASSAY', sr)); 792 addColumn('sequencingRun.flowCell', makeLink('PHYSICALBIOASSAY', fc)); 793 addColumn('sequencingRun.result', (sr.result && sr.result != 'Successful') ? asFailInfo(sr.result, 'error.png') : null); 794 addColumn('sequencingRun.clusterDate', formatDate(fc.clusterDate)); 795 addColumn('sequencingRun.startDate', formatDate(sr.startDate)); 796 addColumn('sequencingRun.endDate', formatDate(sr.endDate)); 797 addColumn('sequencingRun.comment', truncate(sr.comment, truncateAt)); 798 } 799 } 800 else 801 { 802 if (consentOk) 803 { 804 addColumn('sequencingRun.name', asNoInfo('No sequencing information has been registered')); 805 Main.hide('sequencingRun-details'); 806 } 807 else 808 { 809 Main.hide('sequencingRun-info'); 810 } 811 812 } 782 813 } 783 814 … … 847 878 var details = document.getElementById(section.id+'-details'); 848 879 // If the details section is 'forcibly' hidden (eg. no items of that type), ignore this call 849 if (details .style.display != 'none')880 if (details && details.style.display != 'none') 850 881 { 851 882 var headerDiv = document.getElementById(section.id+'-header'); … … 1514 1545 </div> 1515 1546 </div> 1547 1548 <div class="info-section" id="sequencingRun-info"> 1549 <div> 1550 <table class="info-table dynamic-columns"> 1551 <thead> 1552 <tr id="sequencingRun.name"> 1553 <th id="sequencingRun-header">Sequencing runs</th> 1554 </tr> 1555 </thead> 1556 <tbody id="sequencingRun-details" class="info-details"> 1557 <tr id="sequencingRun.flowCell"> 1558 <th>Flow cell</th> 1559 </tr> 1560 <tr id="sequencingRun.clusterDate"> 1561 <th>Cluster date</th> 1562 </tr> 1563 <tr id="sequencingRun.startDate"> 1564 <th>Start date</th> 1565 </tr> 1566 <tr id="sequencingRun.endDate"> 1567 <th>End date</th> 1568 </tr> 1569 <tr id="sequencingRun.result" class="dynamic-column"> 1570 <th>Sequencing result</th> 1571 </tr> 1572 <tr id="sequencingRun.comment" class="comment dynamic-column"> 1573 <th>Comment</th> 1574 </tr> 1575 </tbody> 1576 </table> 1577 </div> 1578 </div> 1516 1579 1517 1580 </div> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/SequencingRun.java
r2225 r2232 9 9 import net.sf.basedb.core.DbControl; 10 10 import net.sf.basedb.core.DerivedBioAssay; 11 import net.sf.basedb.core.Extract; 11 12 import net.sf.basedb.core.ItemQuery; 13 import net.sf.basedb.core.Type; 12 14 import net.sf.basedb.core.query.Expressions; 13 15 import net.sf.basedb.core.query.Hql; … … 57 59 } 58 60 61 62 /** 63 Find all sequencing runs that include the library with the given case name. 64 This method will check for {@link Subtype#SEQUENCING_RUN} derived bioassays 65 that have a parent flow cell that include pools that contains libraries 66 with the given name. 67 @since 2.15 68 */ 69 public static List<SequencingRun> findByCaseName(DbControl dc, String name) 70 { 71 // Get rid of suffixes in the name (eg. 'C' which is used for pre-neoadjuvant forms) 72 if (name.length() > 7) name = name.substring(0, 7); 73 74 // Find all 'Pooled library aliquot':s where the lib we are looking for is present 75 ItemQuery<Extract> poolQuery = Extract.getQuery(); 76 Subtype.POOLED_LIBRARY_ALIQUOT.addFilter(dc, poolQuery); 77 poolQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 78 poolQuery.join(Hql.innerJoin("parent", "pool")); 79 poolQuery.join(Hql.innerJoin("pool", "creationEvent", "poolc")); 80 poolQuery.join(Hql.innerJoin("poolc", "sources", "poolsrc")); 81 poolQuery.join(Hql.innerJoin("poolsrc", "bioMaterial", "lib")); 82 poolQuery.restrict(Restrictions.like(Hql.property("lib", "name"), Expressions.parameter("name", name+".%", Type.STRING))); 83 84 // Find all Sequencing run items for flow cells that include any of the pools. 85 ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 86 Subtype.SEQUENCING_RUN.addFilter(dc, query); 87 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 88 query.join(Hql.innerJoin(null, "physicalBioAssays", "fc", true)); 89 query.join(Hql.innerJoin("fc", "creationEvent", "fcc", true)); 90 query.join(Hql.innerJoin("fcc", "sources", "src")); 91 query.join(Hql.innerJoin("src", "bioMaterial", "poolA")); 92 query.restrict(Restrictions.eq(Hql.alias("poolA"), Expressions.any(poolQuery))); 93 94 return toList(query.list(dc)); 95 } 96 59 97 60 98 public static List<SequencingRun> findByFlowCell(DbControl dc, FlowCell fc) -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/CaseSummaryServlet.java
r2185 r2232 23 23 import net.sf.basedb.core.BioWell; 24 24 import net.sf.basedb.core.DbControl; 25 import net.sf.basedb.core.DerivedBioAssay; 25 26 import net.sf.basedb.core.Extract; 26 27 import net.sf.basedb.core.File; … … 29 30 import net.sf.basedb.core.Permission; 30 31 import net.sf.basedb.core.PermissionDeniedException; 32 import net.sf.basedb.core.PhysicalBioAssay; 31 33 import net.sf.basedb.core.Sample; 32 34 import net.sf.basedb.core.SessionControl; … … 40 42 import net.sf.basedb.reggie.dao.Consent; 41 43 import net.sf.basedb.reggie.dao.Dna; 44 import net.sf.basedb.reggie.dao.FlowCell; 42 45 import net.sf.basedb.reggie.dao.FlowThrough; 43 46 import net.sf.basedb.reggie.dao.Histology; … … 49 52 import net.sf.basedb.reggie.dao.PooledLibrary; 50 53 import net.sf.basedb.reggie.dao.Rna; 54 import net.sf.basedb.reggie.dao.SequencingRun; 51 55 import net.sf.basedb.reggie.dao.SpecimenTube; 52 56 import net.sf.basedb.reggie.dao.Subtype; … … 331 335 json.put("pooledlib", jsonPooledLib); 332 336 } 337 338 List<SequencingRun> sequencingRuns = SequencingRun.findByCaseName(dc, caseName); 339 if (sequencingRuns.size() > 0) 340 { 341 JSONArray jsonSequencingRun = new JSONArray(); 342 for (SequencingRun sr : sequencingRuns) 343 { 344 loadSequencingRunInfo(dc, sr); 345 jsonSequencingRun.add(sr.asJSONObject()); 346 } 347 jsonSections.add(loadSectionInfo(sc, "sequencingRun")); 348 json.put("sequencingRun", jsonSequencingRun); 349 } 350 333 351 } 334 352 } … … 802 820 } 803 821 822 private void loadSequencingRunInfo(DbControl dc, SequencingRun sr) 823 { 824 DerivedBioAssay dba = sr.getDerivedBioAssay(); 825 826 sr.setAnnotation("editable", dba.hasPermission(Permission.WRITE)); 827 sr.loadAnnotations(dc, "startDate", Annotationtype.SEQUENCING_START, Reggie.CONVERTER_DATE_TO_STRING); 828 sr.loadAnnotations(dc, "endDate", Annotationtype.SEQUENCING_END, Reggie.CONVERTER_DATE_TO_STRING); 829 sr.loadAnnotations(dc, "result", Annotationtype.SEQUENCING_RESULT, null); 830 sr.setAnnotation("comment", dba.getDescription()); 831 832 FlowCell fc = FlowCell.getBySequencingRun(dc, sr); 833 PhysicalBioAssay pba = fc.getPhysicalBioAssay(); 834 835 fc.setAnnotation("editable", pba.hasPermission(Permission.WRITE)); 836 fc.loadAnnotations(dc, "clusterDate", Annotationtype.CLUSTER_START, Reggie.CONVERTER_DATE_TO_STRING); 837 sr.setAnnotation("flowCell", fc.asJSONObject()); 838 } 839 804 840 private BioPlate getBioPlate(MeasuredBioMaterial bioMaterial) 805 841 {
Note: See TracChangeset
for help on using the changeset viewer.