Skip to content

Commit 93ec686

Browse files
committed
Change order of steps when no BAM present
1 parent 5330687 commit 93ec686

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ private void processAnalyses(AnalysisModelImpl analysisModel, int runId, List<Re
365365
getJob().getLogger().info("no analyses were selected");
366366
}
367367

368+
getJob().getLogger().info("creating analysis record");
369+
TableInfo ti = SequenceAnalysisSchema.getInstance().getSchema().getTable(SequenceAnalysisSchema.TABLE_ANALYSES);
370+
if (analysisModel.getRowId() == null)
371+
{
372+
analysisModel = Table.insert(getJob().getUser(), ti, analysisModel);
373+
getJob().getLogger().info("created analysis: " + analysisModel.getRowId());
374+
}
375+
else
376+
{
377+
getJob().getLogger().info("re-using existing analysis: " + analysisModel.getRowId());
378+
}
379+
368380
File bam = analysisModel.getAlignmentFile() == null ? null : ExperimentService.get().getExpData(analysisModel.getAlignmentFile()).getFile();
369381
if (bam == null)
370382
{
@@ -379,18 +391,6 @@ private void processAnalyses(AnalysisModelImpl analysisModel, int runId, List<Re
379391
return;
380392
}
381393

382-
getJob().getLogger().info("creating analysis record for BAM: " + bam.getName());
383-
TableInfo ti = SequenceAnalysisSchema.getInstance().getSchema().getTable(SequenceAnalysisSchema.TABLE_ANALYSES);
384-
if (analysisModel.getRowId() == null)
385-
{
386-
analysisModel = Table.insert(getJob().getUser(), ti, analysisModel);
387-
getJob().getLogger().info("created analysis: " + analysisModel.getRowId());
388-
}
389-
else
390-
{
391-
getJob().getLogger().info("re-using existing analysis: " + analysisModel.getRowId());
392-
}
393-
394394
if (!discardBam)
395395
{
396396
ExpData d = ExperimentService.get().getExpDataByURL(bam, getJob().getContainer());

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ public void complete(SequenceAnalysisJobSupport support, AnalysisModel model, Co
488488
throw new PipelineJobException("Unable to find dataId for output file");
489489
}
490490

491+
if (model.getRowId() == null)
492+
{
493+
throw new PipelineJobException("Unable to find rowId for analysis");
494+
}
495+
491496
File metrics = new File(outsDir, "metrics_summary.csv");
492497
if (metrics.exists())
493498
{

0 commit comments

Comments
 (0)