Skip to content

Commit

Permalink
Remove workaround with nimble and allow nimble to directly output gzi…
Browse files Browse the repository at this point in the history
…pped output
  • Loading branch information
bbimber committed Feb 20, 2024
1 parent bccdbce commit bd6708e
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions singlecell/src/org/labkey/singlecell/run/NimbleHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ private Map<NimbleGenome, File> doAlignment(List<NimbleGenome> genomes, List<Fil
alignArgs.add(strandedness);
}

File alignmentTsvBase = new File(getPipelineCtx().getWorkingDirectory(), "alignResults." + (genomes.size() == 1 ? genomes.get(0).genomeId + "." : "") + "txt");
File alignmentTsvBase = new File(getPipelineCtx().getWorkingDirectory(), "alignResults." + (genomes.size() == 1 ? genomes.get(0).genomeId + "." : "") + "txt.gz");

alignArgs.add("--reference");
alignArgs.add(localRefJsons.stream().map(x -> "/work/" + x.getName()).collect(Collectors.joining(",")));
Expand All @@ -461,33 +461,19 @@ private Map<NimbleGenome, File> doAlignment(List<NimbleGenome> genomes, List<Fil
boolean dockerRan = runUsingDocker(alignArgs, output, "align.all");
for (NimbleGenome genome : genomes)
{
File alignResultsTsv = new File(getPipelineCtx().getWorkingDirectory(), "alignResults." + genome.genomeId + ".txt");
if (dockerRan && !alignResultsTsv.exists())
File alignResultsGz = new File(getPipelineCtx().getWorkingDirectory(), "alignResults." + genome.genomeId + ".txt.gz");
if (dockerRan && !alignResultsGz.exists())
{
File doneFile = getNimbleDoneFile(getPipelineCtx().getWorkingDirectory(), "align.all");
if (doneFile.exists())
{
doneFile.delete();
}

throw new PipelineJobException("Expected to find file: " + alignResultsTsv.getPath());
throw new PipelineJobException("Expected to find file: " + alignResultsGz.getPath());
}

File alignResultsGz = new File(alignResultsTsv.getPath() + ".gz");
if (dockerRan)
{
if (alignResultsGz.exists())
{
getPipelineCtx().getLogger().debug("Deleting pre-existing gz output: " + alignResultsGz.getName());
alignResultsGz.delete();
}

// NOTE: perform compression outside of nimble until nimble bugs fixed
getPipelineCtx().getLogger().debug("Compressing results TSV file");
alignResultsGz = Compress.compressGzip(alignResultsTsv);
alignResultsTsv.delete();
}
else if (!alignResultsGz.exists())
if (!alignResultsGz.exists())
{
throw new PipelineJobException("Expected to find gz file: " + alignResultsGz.getPath());
}
Expand Down

0 comments on commit bd6708e

Please sign in to comment.