|
29 | 29 | import org.labkey.api.security.User; |
30 | 30 | import org.labkey.api.sequenceanalysis.SequenceOutputFile; |
31 | 31 | import org.labkey.api.sequenceanalysis.pipeline.PipelineContext; |
| 32 | +import org.labkey.api.sequenceanalysis.pipeline.PipelineOutputTracker; |
32 | 33 | import org.labkey.api.sequenceanalysis.pipeline.SequenceAnalysisJobSupport; |
33 | 34 | import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputHandler; |
34 | 35 | import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService; |
35 | 36 | import org.labkey.api.sequenceanalysis.run.AbstractCommandWrapper; |
36 | 37 | import org.labkey.api.sequenceanalysis.run.CommandWrapper; |
| 38 | +import org.labkey.api.sequenceanalysis.run.DockerWrapper; |
37 | 39 | import org.labkey.api.util.FileType; |
38 | 40 | import org.labkey.api.util.FileUtil; |
39 | 41 | import org.labkey.api.util.Pair; |
40 | 42 | import org.labkey.api.view.ActionURL; |
41 | 43 | import org.labkey.api.writer.PrintWriters; |
42 | 44 | import org.labkey.primeseq.PrimeseqModule; |
43 | | -import org.labkey.primeseq.pipeline.CombpRunner; |
44 | 45 |
|
45 | 46 | import java.io.BufferedReader; |
46 | 47 | import java.io.File; |
@@ -487,8 +488,7 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c |
487 | 488 | Double seed = ctx.getParams().optDouble("seed", 0.05); |
488 | 489 | Integer step = ctx.getParams().optInt("step", 100); |
489 | 490 |
|
490 | | - CombpRunner combp = new CombpRunner(ctx.getLogger()); |
491 | | - File outBed = combp.runCompP(finalOut, ctx.getOutputDir(), dist, seed, step); |
| 491 | + File outBed = runCompP(finalOut, ctx.getOutputDir(), dist, seed, step, ctx, ctx.getFileManager()); |
492 | 492 | SequenceOutputFile so2 = new SequenceOutputFile(); |
493 | 493 | so2.setName("Comb-p: " + ctx.getJob().getDescription()); |
494 | 494 | so2.setDescription("Comb-p: " + jobDescription); |
@@ -726,4 +726,36 @@ else if (i2.compareTo(il) > 0) |
726 | 726 | } |
727 | 727 | } |
728 | 728 | } |
| 729 | + |
| 730 | + private File runCompP(File inputBed, File outputDir, int dist, double seed, int stepSize, PipelineContext ctx, PipelineOutputTracker tracker) throws PipelineJobException |
| 731 | + { |
| 732 | + // See: https://github.com/bbimber/combpdocker |
| 733 | + DockerWrapper wrapper = new DockerWrapper("bbimber/combpdocker", ctx.getLogger(), ctx); |
| 734 | + File outputPrefix = new File(outputDir, FileUtil.getBaseName(inputBed) + ".combp"); |
| 735 | + |
| 736 | + List<String> args = new ArrayList<>(); |
| 737 | + args.add("comb-p"); |
| 738 | + args.add("pipeline"); |
| 739 | + args.add("-c"); |
| 740 | + args.add("5"); |
| 741 | + args.add("--dist"); |
| 742 | + args.add(String.valueOf(dist)); |
| 743 | + args.add("--step"); |
| 744 | + args.add(String.valueOf(stepSize)); |
| 745 | + args.add("--seed"); |
| 746 | + args.add(String.valueOf(seed)); |
| 747 | + args.add("--p"); |
| 748 | + args.add(outputPrefix.getPath()); |
| 749 | + args.add(inputBed.getPath()); |
| 750 | + |
| 751 | + wrapper.executeWithDocker(args, ctx.getWorkingDirectory(), tracker, Arrays.asList(inputBed)); |
| 752 | + |
| 753 | + File outputBed = new File(outputPrefix.getPath() + ".regions.bed"); |
| 754 | + if (!outputBed.exists()) |
| 755 | + { |
| 756 | + throw new PipelineJobException("Unable to find expected output: " + outputBed.getPath()); |
| 757 | + } |
| 758 | + |
| 759 | + return outputBed; |
| 760 | + } |
729 | 761 | } |
0 commit comments