Skip to content

Commit

Permalink
Allow CellRangerVDH to more easily skip BAM creation
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Aug 25, 2024
1 parent 4b3375e commit 760c35d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ public AlignmentStep.AlignmentOutput performAlignment(Readset rs, List<File> inp
lockFile.delete();
}

boolean discardBam = getProvider().getParameterByName(AbstractAlignmentStepProvider.DISCARD_BAM).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
args.add("--create-bam=" + !discardBam);

getWrapper().execute(args);

File outdir = new File(outputDirectory, id);
Expand Down Expand Up @@ -454,7 +457,6 @@ public AlignmentStep.AlignmentOutput performAlignment(Readset rs, List<File> inp
private File processOutputsForType(String sampleId, Readset rs, ReferenceGenome referenceGenome, File outdir, AlignmentOutputImpl output, String subdirName) throws PipelineJobException
{
boolean isPrimaryDir = "vdj_t".equals(subdirName);
String chainType = "vdj_t".equals(subdirName) ? "Alpha/Beta" : "Gamma/Delta";

File multiDir = new File(outdir, "multi/" + subdirName);
if (!multiDir.exists())
Expand Down Expand Up @@ -487,13 +489,14 @@ private File processOutputsForType(String sampleId, Readset rs, ReferenceGenome
}
}

boolean discardBam = getProvider().getParameterByName(AbstractAlignmentStepProvider.DISCARD_BAM).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
File bam = new File(sampleDir, "all_contig.bam");
if (!bam.exists())
if (!discardBam && !bam.exists())
{
throw new PipelineJobException("Unable to find file: " + bam.getPath());
}

if (isPrimaryDir)
if (!discardBam && isPrimaryDir)
{
output.setBAM(bam);
}
Expand Down

0 comments on commit 760c35d

Please sign in to comment.