Changeset 5826
- Timestamp:
- Feb 18, 2020, 2:15:48 PM (3 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/config/reggie-config.xml
r5816 r5826 319 319 </align-hisat> 320 320 321 <!-- settings for aligning MIPs sequencing --> 322 <align-mips> 323 <!-- parallel environment option to the queue system --> 324 <!-- the default setting use up to 16 slots on hosts with at least 8 slots available --> 325 <parallel-environment>smp 8-16</parallel-environment> 326 327 </align-mips> 328 321 329 <mbaf> 322 330 <!-- parallel environment option to the queue system --> -
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r5801 r5826 991 991 </ul> 992 992 </dd> 993 994 <dt> 995 <base:icon image="<%=home+"/images/align.png" %>" /> 996 Alignment pipeline 997 </dt> 998 <dd> 999 <ul> 1000 <li><span class="require-permission" data-role="SecondaryAnalysis" data-link="mipsanalysis/align_start.jsp?ID=<%=ID%>" 1001 >Start MIPs alignment</span> 1002 <span class="counter" data-counter="merged-sequences-for-mips-alignment" 1003 title="Number of merged sequences waiting for MIPs alignment">∙</span> 1004 <span id="mips-align-pipeline-disabled" class="info-warning">auto-processing is disabled</span> 1005 </ul> 1006 </dd> 1007 993 1008 </dl> 994 1009 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/counter/CounterService.java
r5737 r5826 1174 1174 json.put("merged-sequences-for-hisat-alignment", hisatPipeline.getSize()); 1175 1175 1176 // Items in the MIPs pipeline waiting to be aligned 1177 ItemList mipsAlignPipeline = BiomaterialList.MIPS_ALIGN_PIPELINE.load(dc); 1178 json.put("merged-sequences-for-mips-alignment", mipsAlignPipeline.getSize()); 1179 1176 1180 // Hisat aligned sequences not confirmed 1177 1181 query = DerivedBioAssay.getQuery(); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Subtype.java
r5774 r5826 310 310 */ 311 311 public static final Subtype HISAT_ALIGN_JOB = new Subtype("HisatAlign", null, null, null, Item.JOB, false); 312 313 /** 314 The definition of the MIPs alignment job. 315 @since 4.26 316 */ 317 public static final Subtype MIPS_ALIGN_JOB = new Subtype("MIPsAlign", null, null, null, Item.JOB, false); 312 318 313 319 /** -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/JobCompletionHandlerFactory.java
r5772 r5826 87 87 action = new HisatAlignJobCreator.AlignJobCompletionHandler(); 88 88 } 89 else if (jobType.equals(Subtype.MIPS_ALIGN_JOB.get(dc))) 90 { 91 action = new MipsAlignJobCreator.AlignJobCompletionHandler(); 92 } 89 93 else if (jobType.equals(Subtype.TOPHAT_CUFFLINKS_JOB.get(dc))) 90 94 { -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r5799 r5826 329 329 jsonChecks.add(checkSubtype(dc, Subtype.TOPHAT_CUFFLINKS_JOB, null, createIfMissing)); 330 330 jsonChecks.add(checkSubtype(dc, Subtype.HISAT_ALIGN_JOB, null, createIfMissing)); 331 jsonChecks.add(checkSubtype(dc, Subtype.MIPS_ALIGN_JOB, null, createIfMissing)); 331 332 jsonChecks.add(checkSubtype(dc, Subtype.STRINGTIE_JOB, null, createIfMissing)); 332 333 jsonChecks.add(checkSubtype(dc, Subtype.VARIANT_CALLING_SOFTWARE, null, createIfMissing)); … … 668 669 createIfMissing, effectivePermissionsUse)); 669 670 jsonChecks.add(checkAnnotationType(dc, Annotationtype.ALIGNMENT_TYPE, 1, 670 new ValueOptions("Tophat", "Hisat" ),671 new ValueOptions("Tophat", "Hisat", "MIPs"), 671 672 createIfMissing, effectivePermissionsUse)); 672 673 jsonChecks.add(checkAnnotationType(dc, Annotationtype.EXPRESSION_TYPE, 1, -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MipsServlet.java
r5791 r5826 27 27 import net.sf.basedb.core.BioWell; 28 28 import net.sf.basedb.core.DbControl; 29 import net.sf.basedb.core.DerivedBioAssay; 29 30 import net.sf.basedb.core.Extract; 30 31 import net.sf.basedb.core.File; … … 32 33 import net.sf.basedb.core.Item; 33 34 import net.sf.basedb.core.ItemList; 35 import net.sf.basedb.core.ItemNotFoundException; 34 36 import net.sf.basedb.core.ItemQuery; 35 37 import net.sf.basedb.core.ItemSubtype; 38 import net.sf.basedb.core.Job; 36 39 import net.sf.basedb.core.Path; 37 40 import net.sf.basedb.core.PhysicalBioAssay; … … 39 42 import net.sf.basedb.core.Protocol; 40 43 import net.sf.basedb.core.SessionControl; 44 import net.sf.basedb.core.Software; 41 45 import net.sf.basedb.core.Tag; 42 46 import net.sf.basedb.core.Type; … … 46 50 import net.sf.basedb.core.query.Orders; 47 51 import net.sf.basedb.core.query.Restrictions; 52 import net.sf.basedb.core.snapshot.SnapshotManager; 53 import net.sf.basedb.opengrid.JobDefinition; 54 import net.sf.basedb.opengrid.OpenGridCluster; 55 import net.sf.basedb.opengrid.service.OpenGridService; 48 56 import net.sf.basedb.reggie.JsonUtil; 49 57 import net.sf.basedb.reggie.Reggie; … … 57 65 import net.sf.basedb.reggie.dao.FlowCell; 58 66 import net.sf.basedb.reggie.dao.Library; 67 import net.sf.basedb.reggie.dao.MergedSequences; 59 68 import net.sf.basedb.reggie.dao.Pipeline; 60 69 import net.sf.basedb.reggie.dao.PooledLibrary; … … 64 73 import net.sf.basedb.reggie.dao.Rna; 65 74 import net.sf.basedb.reggie.dao.Subtype; 75 import net.sf.basedb.reggie.grid.MipsAlignJobCreator; 76 import net.sf.basedb.reggie.grid.ScriptUtil; 66 77 import net.sf.basedb.reggie.plugins.AliquotImporter; 67 78 import net.sf.basedb.reggie.plugins.AliquotImporter.AliquotPlate; … … 82 93 {} 83 94 95 @SuppressWarnings("unchecked") 84 96 @Override 85 97 protected void doGet(HttpServletRequest req, HttpServletResponse resp) … … 429 441 int numNames = Values.getInt(req.getParameter("numNames")); 430 442 json.put("names", FlowCell.getNextNames(dc, numNames)); 443 } 444 else if ("GetMergedSequencesForAlignment".equals(cmd)) 445 { 446 dc = sc.newDbControl(); 447 448 List<MergedSequences> list = null; 449 String items = Values.getStringOrNull(req.getParameter("items")); 450 if (items == null) 451 { 452 // Load items from the pipeline list 453 ItemList mipsPipeline = BiomaterialList.MIPS_ALIGN_PIPELINE.load(dc); 454 ItemQuery<DerivedBioAssay> query = (ItemQuery<DerivedBioAssay>)mipsPipeline.getMembers(); 455 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 456 Subtype.MERGED_SEQUENCES.addFilter(dc, query); 457 // Join LibPlate for sorting 458 query.join(Hql.innerJoin(null, "extract", "lib", true)); 459 query.join(Hql.innerJoin("lib", "bioWell", "bw", true)); 460 query.join(Hql.innerJoin("bw", "bioPlate", "libPlate", true)); 461 query.order(Orders.asc(Hql.property("libPlate", "id"))); 462 query.order(Orders.asc(Hql.property("name"))); 463 query.setMaxResults(250); 464 list = MergedSequences.toList(query.list(dc)); 465 } 466 else 467 { 468 Integer[] ids = Values.getInt(items.split(",")); 469 list = new ArrayList<MergedSequences>(); 470 for (Integer id : ids) 471 { 472 list.add(MergedSequences.getById(dc, id)); 473 } 474 } 475 476 SnapshotManager manager = new SnapshotManager(); 477 JSONArray jsonMergedSequences = new JSONArray(); 478 for (MergedSequences ms : list) 479 { 480 ms.loadAnnotations(dc, "pipeline", Annotationtype.PIPELINE, null); 481 Library lib = ms.getLibrary(dc); 482 lib.loadBioPlateLocation(); 483 ms.setAnnotation("lib", lib.asJSONObject()); 484 ms.loadAnnotations(dc, manager, "AutoProcess", Annotationtype.AUTO_PROCESSING, null); 485 ms.loadDoNotUseAnnotations(dc, manager); 486 jsonMergedSequences.add(ms.asJSONObject()); 487 } 488 json.put("mergedSequences", jsonMergedSequences); 431 489 } 432 490 … … 925 983 dc.commit(); 926 984 } 985 else if ("StartMipsAlignment".equals(cmd)) 986 { 987 dc = sc.newDbControl(); 988 989 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.MIPS_SECONDARY_ANALYSIS, ReggieRole.ADMINISTRATOR); 990 991 JSONObject jsonReq = JsonUtil.parseRequest(req); 992 JSONArray jsonMerged = (JSONArray)jsonReq.get("mergedSequences"); 993 994 Number alignSoftwareId = (Number)jsonReq.get("alignSoftware"); 995 Number alignProtocolId = (Number)jsonReq.get("alignProtocol"); 996 997 String clusterId = (String)jsonReq.get("cluster"); 998 boolean debug = Boolean.TRUE.equals(jsonReq.get("debug")); 999 boolean autoConfirm = Boolean.TRUE.equals(jsonReq.get("autoConfirm")); 1000 Number priority = (Number)jsonReq.get("priority"); 1001 1002 OpenGridCluster cluster = OpenGridService.getInstance().getClusterById(dc, clusterId); 1003 if (cluster == null) 1004 { 1005 throw new ItemNotFoundException("OpenGridCluster[" + clusterId + "]"); 1006 } 1007 1008 // Load common items 1009 Software alignSoftware = alignSoftwareId != null ? Software.getById(dc, alignSoftwareId.intValue()) : null; 1010 Protocol alignProtocol = alignProtocolId != null ? Protocol.getById(dc, alignProtocolId.intValue()) : null; 1011 1012 // Align job creator implementation 1013 MipsAlignJobCreator jobCreator = new MipsAlignJobCreator(); 1014 jobCreator.setAutoConfirm(autoConfirm); 1015 jobCreator.setDebug(debug); 1016 jobCreator.setPriority(priority == null ? null : priority.intValue()); 1017 jobCreator.setAlignProtocol(alignProtocol); 1018 jobCreator.setAlignSoftware(alignSoftware); 1019 1020 List<MergedSequences> mergedSequences = new ArrayList<MergedSequences>(); 1021 for (int mgNo = 0; mgNo < jsonMerged.size(); mgNo++) 1022 { 1023 JSONObject jsonMg = (JSONObject)jsonMerged.get(mgNo); 1024 Number mergedId = (Number)jsonMg.get("id"); 1025 1026 MergedSequences ms = MergedSequences.getById(dc, mergedId.intValue()); 1027 mergedSequences.add(ms); 1028 1029 // Reset AUTO_PROCESSING annotation 1030 DerivedBioAssay merged = ms.getDerivedBioAssay(); 1031 Annotationtype.AUTO_PROCESSING.setAnnotationValue(dc, merged, null); 1032 } 1033 1034 List<JobDefinition> jobDefs = jobCreator.createMipsAlignJobs(dc, cluster, mergedSequences); 1035 List<Job> jobs = ScriptUtil.submitJobs(dc, cluster, jobDefs); 1036 for (Job job : jobs) 1037 { 1038 if (job.getStatus() == Job.Status.ERROR) 1039 { 1040 jsonMessages.add("[Error]Job submission for '" + job.getName() + "' failed: " + job.getStatusMessage()); 1041 } 1042 else 1043 { 1044 jsonMessages.add("Submitted MIPs alignment job to " + cluster.getConnectionInfo().getName() + " with id " + job.getExternalId()); 1045 } 1046 } 1047 dc.commit(); 1048 } 927 1049 json.put("messages", jsonMessages); 928 1050 CounterService.getInstance().setForceCount();
Note: See TracChangeset
for help on using the changeset viewer.