Skip to content

Commit

Permalink
Improve error handling in paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Nov 21, 2024
1 parent 0891dd9 commit 60c109d
Showing 1 changed file with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public ParagraphStep()
}}, false),
ToolParameterDescriptor.create("debug", "Debug Logging", "If checked, --debug will be passed to paragraph to increase logging", "checkbox", new JSONObject(){{
put("checked", false);
}}, false),
ToolParameterDescriptor.create("retrieveReferenceSeq", "Retrieve Reference Sequence", "If checked, --debug will be passed to paragraph to increase logging", "checkbox", new JSONObject(){{
put("checked", false);
}}, false)
));
}
Expand Down Expand Up @@ -218,6 +221,24 @@ else if (!svVcf.exists())
paragraphArgs.add("-o");
paragraphArgs.add("/work/" + paragraphOutDir.getName());

File scratchDir = new File(ctx.getOutputDir(), "pgScratch");
if (scratchDir.exists())
{
try
{
FileUtils.deleteDirectory(scratchDir);
}
catch (IOException e)
{
throw new PipelineJobException(e);
}
}

paragraphArgs.add("--scratch-dir");
paragraphArgs.add(scratchDir.getPath());

ctx.getFileManager().addIntermediateFile(scratchDir);

paragraphArgs.add("-i");
dockerWrapper.ensureLocalCopy(svVcf, ctx.getWorkingDirectory(), ctx.getFileManager());
dockerWrapper.ensureLocalCopy(new File(svVcf.getPath() + ".tbi"), ctx.getWorkingDirectory(), ctx.getFileManager());
Expand All @@ -241,9 +262,10 @@ else if (!svVcf.exists())
dockerWrapper.ensureLocalCopy(new File(genomeFasta.getPath() + ".fai"), ctx.getWorkingDirectory(), ctx.getFileManager());
paragraphArgs.add("/work/" + genomeFasta.getName());

paragraphArgs.add("--scratch-dir");
paragraphArgs.add("/tmp");
dockerWrapper.setTmpDir(new File(SequencePipelineService.get().getJavaTempDir()));
if (ctx.getParams().optBoolean("retrieveReferenceSeq", false))
{
paragraphArgs.add("--retrieve-reference-sequence");
}

if (threads != null)
{
Expand Down

0 comments on commit 60c109d

Please sign in to comment.