Skip to content

Commit e8d55b2

Browse files
committed
Dont error for missing BAM if discardBAM=true
1 parent a0c56b8 commit e8d55b2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ public RecordedActionSet run() throws PipelineJobException
155155
ExpRun run = ExperimentService.get().getExpRun(runId);
156156
AnalysisModelImpl analysisModel = null;
157157

158+
//optionally delete the BAM itself:
159+
boolean discardBam = false;
160+
if (SequenceTaskHelper.isAlignmentUsed(getJob()))
161+
{
162+
AlignmentStep alignmentStep = taskHelper.getSingleStep(AlignmentStep.class).create(taskHelper);
163+
ToolParameterDescriptor discardBamParam = alignmentStep.getProvider().getParameterByName(AbstractAlignmentStepProvider.DISCARD_BAM);
164+
discardBam = discardBamParam.extractValue(getJob(), alignmentStep.getProvider(), alignmentStep.getStepIdx(), Boolean.class, false);
165+
}
166+
158167
if (SequenceTaskHelper.isAlignmentUsed(getJob()))
159168
{
160169
SequenceReadsetImpl rs = getPipelineJob().getReadset();
@@ -211,7 +220,7 @@ public RecordedActionSet run() throws PipelineJobException
211220
}
212221
}
213222

214-
if (analysisModel.getAlignmentFile() == null)
223+
if (!discardBam && analysisModel.getAlignmentFile() == null)
215224
{
216225
getJob().getLogger().info("Total BAMs found : " + datas.size());
217226
for (ExpData d : datas)
@@ -277,15 +286,6 @@ else if (d.getFile().exists())
277286
}
278287
}
279288

280-
//optionally delete the BAM itself:
281-
boolean discardBam = false;
282-
if (SequenceTaskHelper.isAlignmentUsed(getJob()))
283-
{
284-
AlignmentStep alignmentStep = taskHelper.getSingleStep(AlignmentStep.class).create(taskHelper);
285-
ToolParameterDescriptor discardBamParam = alignmentStep.getProvider().getParameterByName(AbstractAlignmentStepProvider.DISCARD_BAM);
286-
discardBam = discardBamParam.extractValue(getJob(), alignmentStep.getProvider(), alignmentStep.getStepIdx(), Boolean.class, false);
287-
}
288-
289289
if (analysisModel == null)
290290
{
291291
getJob().getLogger().info("No analyses were created");

0 commit comments

Comments
 (0)