Skip to content

Commit b5990d7

Browse files
committed
Allow paragraph to write to normal scratch dir
1 parent d9a3e04 commit b5990d7

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/alignment/ParagraphStep.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public ParagraphStep()
5353
ToolParameterDescriptor.create("verbose", "Verbose Logging", "If checked, --verbose will be passed to paragraph to increase logging", "checkbox", new JSONObject(){{
5454
put("checked", false);
5555
}}, false),
56+
ToolParameterDescriptor.create("useLocalScratch", "User local scratch", "If checked, the tool will write the intermediate temp files to a folder in the working directory, rather than the job's tempDir. This can make debugging easier.", "checkbox", new JSONObject(){{
57+
put("checked", false);
58+
}}, false),
5659
ToolParameterDescriptor.create("retrieveReferenceSeq", "Retrieve Reference Sequence", "If checked, --debug will be passed to paragraph to increase logging", "checkbox", new JSONObject(){{
5760
put("checked", false);
5861
}}, false)
@@ -237,23 +240,27 @@ else if (!svVcf.exists())
237240
paragraphArgs.add("-o");
238241
paragraphArgs.add(paragraphOutDir.getPath());
239242

240-
File scratchDir = new File(ctx.getOutputDir(), "pgScratch");
241-
if (scratchDir.exists())
243+
File localScratchDir = new File(ctx.getOutputDir(), "pgScratch");
244+
if (localScratchDir.exists())
242245
{
243246
try
244247
{
245-
FileUtils.deleteDirectory(scratchDir);
248+
FileUtils.deleteDirectory(localScratchDir);
246249
}
247250
catch (IOException e)
248251
{
249252
throw new PipelineJobException(e);
250253
}
251254
}
252255

253-
paragraphArgs.add("--scratch-dir");
254-
paragraphArgs.add(scratchDir.getPath());
256+
boolean useLocalScratch = ctx.getParams().optBoolean("useLocalScratch", false);
257+
if (useLocalScratch)
258+
{
259+
paragraphArgs.add("--scratch-dir");
260+
paragraphArgs.add(localScratchDir.getPath());
255261

256-
ctx.getFileManager().addIntermediateFile(scratchDir);
262+
ctx.getFileManager().addIntermediateFile(localScratchDir);
263+
}
257264

258265
paragraphArgs.add("-i");
259266
paragraphArgs.add(svVcf.getPath());

0 commit comments

Comments
 (0)