|
1 | 1 | package org.labkey.sequenceanalysis; |
2 | 2 |
|
3 | 3 | import htsjdk.samtools.SAMFileHeader; |
4 | | -import htsjdk.samtools.ValidationStringency; |
5 | 4 | import org.apache.commons.io.FilenameUtils; |
6 | 5 | import org.apache.commons.lang3.StringUtils; |
7 | 6 | import org.apache.logging.log4j.LogManager; |
|
32 | 31 | import org.labkey.sequenceanalysis.pipeline.TaskFileManagerImpl; |
33 | 32 | import org.labkey.sequenceanalysis.run.preprocessing.PreprocessingOutputImpl; |
34 | 33 | import org.labkey.sequenceanalysis.run.preprocessing.TrimmomaticWrapper; |
35 | | -import org.labkey.sequenceanalysis.run.util.BuildBamIndexWrapper; |
36 | 34 | import org.labkey.sequenceanalysis.run.util.SortVcfWrapper; |
37 | 35 | import org.labkey.sequenceanalysis.util.FastqUtils; |
| 36 | +import org.labkey.sequenceanalysis.util.ReferenceLibraryHelperImpl; |
38 | 37 | import org.labkey.sequenceanalysis.util.SequenceUtil; |
39 | 38 |
|
40 | 39 | import java.io.File; |
@@ -231,7 +230,26 @@ public <StepType extends PipelineStep> List<PipelineStepCtx<StepType>> getSteps( |
231 | 230 | @Override |
232 | 231 | public void ensureSequenceDictionaryExists(File referenceFasta, Logger log, boolean forceRecreate) throws PipelineJobException |
233 | 232 | { |
234 | | - new CreateSequenceDictionaryWrapper(log).execute(referenceFasta, false); |
| 233 | + CreateSequenceDictionaryWrapper wrapper = new CreateSequenceDictionaryWrapper(log); |
| 234 | + if (wrapper.jarExists()) |
| 235 | + { |
| 236 | + new CreateSequenceDictionaryWrapper(log).execute(referenceFasta, false); |
| 237 | + return; |
| 238 | + } |
| 239 | + |
| 240 | + log.debug("picard.jar not found, creating directly"); |
| 241 | + ReferenceLibraryHelperImpl helper = new ReferenceLibraryHelperImpl(referenceFasta, log); |
| 242 | + if (forceRecreate) |
| 243 | + { |
| 244 | + File dict = helper.getSequenceDictionaryFile(false); |
| 245 | + if (dict.exists()) |
| 246 | + { |
| 247 | + log.debug("Deleting pre-existing dictionary: " + dict.getPath()); |
| 248 | + dict.delete(); |
| 249 | + } |
| 250 | + } |
| 251 | + |
| 252 | + helper.getSequenceDictionaryFile(true); |
235 | 253 | } |
236 | 254 |
|
237 | 255 | @Override |
|
0 commit comments