Skip to content

Commit 608cbe4

Browse files
committed
Improve SnpEff index check
1 parent 26db835 commit 608cbe4

File tree

1 file changed

+8
-4
lines changed
  • SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant

1 file changed

+8
-4
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant/SNPEffStep.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@ public static File checkOrCreateIndex(SequenceAnalysisJobSupport support, Logger
7575

7676
SnpEffWrapper wrapper = new SnpEffWrapper(log);
7777
File snpEffIndexDir = wrapper.getExpectedIndexDir(snpEffBaseDir, genome.getGenomeId(), geneFileId);
78-
if (!snpEffIndexDir.exists())
78+
if (snpEffIndexDir.exists())
7979
{
80-
wrapper.buildIndex(snpEffBaseDir, genome, geneFile, geneFileId);
80+
log.debug("previously created index found, re-using: " + snpEffIndexDir.getPath());
81+
return snpEffBaseDir;
8182
}
82-
else
83+
84+
File binFile = new File(snpEffIndexDir, "snpEffectPredictor.bin");
85+
if (!binFile.exists())
8386
{
84-
log.debug("previously created index found, re-using: " + snpEffIndexDir.getPath());
87+
log.debug("existing index not found, expected: " + binFile.getPath());
88+
wrapper.buildIndex(snpEffBaseDir, genome, geneFile, geneFileId);
8589
}
8690

8791
return snpEffBaseDir;

0 commit comments

Comments
 (0)