Skip to content

Commit 78c5bf0

Browse files
committed
Bugfix index creation
1 parent 8068a89 commit 78c5bf0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

singlecell/src/org/labkey/singlecell/run/CellRangerFeatureBarcodeHandler.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,19 @@ private File makeDummyIndex(JobContext ctx) throws PipelineJobException
256256
try
257257
{
258258
File indexDir = new File(ctx.getOutputDir(), "cellrangerIndex");
259-
if (!indexDir.exists())
259+
if (indexDir.exists())
260260
{
261-
indexDir.mkdirs();
261+
FileUtils.deleteDirectory(indexDir);
262262
}
263263

264-
File fasta = new File(indexDir, "genome.fasta");
264+
File fasta = new File(ctx.getOutputDir(), "genome.fasta");
265265
try (PrintWriter writer = PrintWriters.getPrintWriter(fasta))
266266
{
267267
writer.println(">1");
268268
writer.println("ATGATGATGATGATG");
269269
}
270270

271-
File gtf = new File(indexDir, "genome.gtf");
271+
File gtf = new File(ctx.getOutputDir(), "genome.gtf");
272272
try (PrintWriter writer = PrintWriters.getPrintWriter(gtf))
273273
{
274274
writer.println("1\tnowhere\texon\t1\t4\t.\t+\t.\ttranscript_id \"transcript1\"; gene_id \"gene1\"; gene_name \"gene1\";");
@@ -294,9 +294,13 @@ private File makeDummyIndex(JobContext ctx) throws PipelineJobException
294294
args.add("--memgb=" + maxRam.toString());
295295
}
296296

297-
wrapper.setWorkingDir(indexDir);
297+
wrapper.setWorkingDir(ctx.getOutputDir());
298298
wrapper.execute(args);
299299

300+
ctx.getFileManager().addIntermediateFile(fasta);
301+
ctx.getFileManager().addIntermediateFile(gtf);
302+
ctx.getFileManager().addIntermediateFile(indexDir);
303+
300304
return indexDir;
301305
}
302306
catch (IOException e)

0 commit comments

Comments
 (0)