Skip to content

Commit f5e1eb7

Browse files
committed
Second fix for alignments that dont produce BAMs
1 parent 760c35d commit f5e1eb7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/SequenceAlignmentTask.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,13 @@ private void alignSet(Readset rs, String basename, Map<ReadData, Pair<File, File
692692

693693
if (getHelper().getFileManager().performCleanupAfterEachStep())
694694
{
695-
List<File> toRetain = Arrays.asList(bam, SequenceUtil.getExpectedIndex(bam));
695+
List<File> toRetain = bam == null ? Collections.emptyList() : Arrays.asList(bam, SequenceUtil.getExpectedIndex(bam));
696696
getTaskFileManagerImpl().deleteIntermediateFiles(toRetain);
697697
}
698698

699-
_resumer.setInitialAlignmentDone(bam, alignActions);
699+
AlignmentStep alignmentStep = getHelper().getSingleStep(AlignmentStep.class).create(getHelper());
700+
boolean discardBam = alignmentStep.getProvider().getParameterByName(AbstractAlignmentStepProvider.DISCARD_BAM).extractValue(getJob(), alignmentStep.getProvider(), alignmentStep.getStepIdx(), Boolean.class, false);
701+
_resumer.setInitialAlignmentDone(bam, alignActions, discardBam);
700702
}
701703

702704
//post-processing
@@ -1593,9 +1595,9 @@ public boolean isInitialAlignmentDone()
15931595
return _mergedBamFile != null;
15941596
}
15951597

1596-
public void setInitialAlignmentDone(File mergedBamFile, List<RecordedAction> actions) throws PipelineJobException
1598+
public void setInitialAlignmentDone(File mergedBamFile, List<RecordedAction> actions, boolean allowNullBam) throws PipelineJobException
15971599
{
1598-
if (mergedBamFile == null)
1600+
if (!allowNullBam && mergedBamFile == null)
15991601
{
16001602
throw new PipelineJobException("BAM is null");
16011603
}

0 commit comments

Comments
 (0)