Skip to content

Commit 75ba528

Browse files
committed
Add additional nimble debugging
1 parent 297c028 commit 75ba528

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,11 @@ private File doAlignment(NimbleGenome genome, File refJson, File bam, PipelineSt
296296
alignArgs.add("/work/nimbleDebug." + genome.genomeId + ".txt");
297297

298298
boolean alignOutput = getProvider().getParameterByName(ALIGN_OUTPUT).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
299+
File alignmentOutputFile = new File(getPipelineCtx().getWorkingDirectory(), "nimbleAlignment." + genome.genomeId + ".txt.gz");
299300
if (alignOutput)
300301
{
301302
alignArgs.add("-a");
302-
alignArgs.add("/work/nimbleAlignment." + genome.genomeId + ".txt.gz");
303+
alignArgs.add("/work/" + alignmentOutputFile.getName());
303304
}
304305

305306
String strandedness = getProvider().getParameterByName(STRANDEDNESS).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), String.class, null);
@@ -360,6 +361,17 @@ else if (!resultsGz.exists())
360361
throw new PipelineJobException(e);
361362
}
362363

364+
if (alignmentOutputFile.exists())
365+
{
366+
SimpleScriptWrapper runner = new SimpleScriptWrapper(getPipelineCtx().getLogger());
367+
File alignmentOutputFile2 = new File(alignmentOutputFile.getParentFile(), alignmentOutputFile.getName().replaceAll(".txt.gz$", ".subset.txt.gz$"));
368+
runner.execute(Arrays.asList("/bin/bash", "-c", "zcat '" + alignmentOutputFile.getPath() + "' | awk -F '\t' ' $10!=\"\" ' > " + alignmentOutputFile2.getPath()));
369+
}
370+
else
371+
{
372+
getPipelineCtx().getLogger().debug("Alignment output file not present: " + alignmentOutputFile.getName());
373+
}
374+
363375
return resultsTsv;
364376
}
365377

0 commit comments

Comments
 (0)