Changeset 4979
- Timestamp:
- Sep 24, 2018, 11:38:50 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/GenotypeServlet.java
r4977 r4979 38 38 import net.sf.basedb.core.SimpleProgressReporter; 39 39 import net.sf.basedb.core.Subtypable; 40 import net.sf.basedb.core.Type; 40 41 import net.sf.basedb.core.query.Annotations; 41 42 import net.sf.basedb.core.query.Expressions; … … 506 507 ItemList flaggedAlignments = BiomaterialList.FLAGGED_ALIGNMENT.get(dc); 507 508 509 ItemQuery<Extract> dnaFtQuery = Extract.getQuery(); 510 dnaFtQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 511 // We find ALL child items to a specific Lysate with the same Qiacube date and run number 512 dnaFtQuery.join(Hql.innerJoin("parent", "lys")); 513 dnaFtQuery.join(Annotations.innerJoin(Annotationtype.QIACUBE_DATE.load(dc), "qcDate")); 514 dnaFtQuery.join(Annotations.innerJoin(Annotationtype.QIACUBE_RUN_NO.load(dc), "qcRun")); 515 dnaFtQuery.restrict(Restrictions.eq(Hql.alias("lys"), Hql.entityParameter("lysate", Item.EXTRACT))); 516 dnaFtQuery.restrict(Restrictions.eq(Hql.alias("qcDate"), Expressions.parameter("qcDate", Type.DATE))); 517 dnaFtQuery.restrict(Restrictions.eq(Hql.alias("qcRun"), Expressions.parameter("qcRun", Type.INT))); 518 508 519 GenoTypeChecker checker = new GenoTypeChecker(); 509 520 checker.preloadVcfForFlaggedAlignments(dc); … … 547 558 // Load all downstream items (by matching the name) 548 559 List<BasicItem> allChildItems = getAllChildItems(dc, rootItem); 560 if ("RNA".equals(doNotUse)) 561 { 562 Extract rna = (Extract)rootItem; 563 Extract lysate = (Extract)rna.getParent(); 564 Date qcDate = (Date)Annotationtype.QIACUBE_DATE.getAnnotationValue(dc, rna); 565 Integer qcRun = (Integer)Annotationtype.QIACUBE_RUN_NO.getAnnotationValue(dc, rna); 566 // Also include DNA and FlowThrough from the same Qiacube run 567 if (lysate != null && qcDate != null && qcRun != null) 568 { 569 dnaFtQuery.setEntityParameter("lysate", lysate); 570 dnaFtQuery.setParameter("qcDate", qcDate, Type.DATE); 571 dnaFtQuery.setParameter("qcRun", qcRun, Type.INT); 572 for (Extract e : dnaFtQuery.list(dc)) 573 { 574 if (!e.equals(rootItem)) // The query return all children for the lysate but we do not need to process the RNA twice 575 { 576 List<BasicItem> dnaFtItems = getAllChildItems(dc, e); 577 allChildItems.addAll(dnaFtItems); 578 jsonDebug.add("[Debug]Added " + dnaFtItems.size() + " items related to " + e); 579 } 580 } 581 } 582 } 549 583 550 584 for (BasicItem basicItem : allChildItems)
Note: See TracChangeset
for help on using the changeset viewer.