Skip to content

Commit 630d6b6

Browse files
committed
Allow better resume in pacbio
1 parent e98e5ea commit 630d6b6

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/PbsvJointCallingHandler.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
176176

177177
private File runPbsvCall(JobContext ctx, List<File> inputs, ReferenceGenome genome, String outputBaseName, @Nullable String contig) throws PipelineJobException
178178
{
179+
File vcfOut = new File(ctx.getOutputDir(), outputBaseName + ".vcf");
180+
File doneFile = new File(ctx.getOutputDir(), outputBaseName + ".done");
181+
ctx.getFileManager().addIntermediateFile(doneFile);
182+
if (doneFile.exists())
183+
{
184+
ctx.getLogger().info("Existing file, found, re-using");
185+
return vcfOut;
186+
}
187+
179188
List<String> args = new ArrayList<>();
180189
args.add(getExe().getPath());
181190
args.add("call");
@@ -201,7 +210,6 @@ private File runPbsvCall(JobContext ctx, List<File> inputs, ReferenceGenome geno
201210
args.add(f.getPath());
202211
});
203212

204-
File vcfOut = new File(ctx.getOutputDir(), outputBaseName + ".vcf");
205213
args.add(vcfOut.getPath());
206214

207215
new SimpleScriptWrapper(ctx.getLogger()).execute(args);
@@ -211,6 +219,15 @@ private File runPbsvCall(JobContext ctx, List<File> inputs, ReferenceGenome geno
211219
throw new PipelineJobException("Unable to find file: " + vcfOut.getPath());
212220
}
213221

222+
try
223+
{
224+
FileUtils.touch(doneFile);
225+
}
226+
catch (IOException e)
227+
{
228+
throw new PipelineJobException(e);
229+
}
230+
214231
return vcfOut;
215232
}
216233

0 commit comments

Comments
 (0)