|
1 | 1 | package org.labkey.sequenceanalysis.pipeline; |
2 | 2 |
|
3 | | -import htsjdk.samtools.SAMSequenceDictionary; |
4 | 3 | import htsjdk.samtools.util.Interval; |
5 | 4 | import htsjdk.tribble.AbstractFeatureReader; |
6 | 5 | import htsjdk.tribble.FeatureReader; |
7 | | -import htsjdk.variant.utils.SAMSequenceDictionaryExtractor; |
8 | 6 | import htsjdk.variant.vcf.VCFCodec; |
9 | 7 | import htsjdk.variant.vcf.VCFFileReader; |
10 | 8 | import htsjdk.variant.vcf.VCFHeader; |
|
38 | 36 | import org.labkey.api.sequenceanalysis.run.SimpleScriptWrapper; |
39 | 37 | import org.labkey.api.util.FileType; |
40 | 38 | import org.labkey.api.util.FileUtil; |
| 39 | +import org.labkey.api.util.URIUtil; |
41 | 40 | import org.labkey.api.view.ActionURL; |
42 | 41 | import org.labkey.api.writer.PrintWriters; |
43 | 42 | import org.labkey.sequenceanalysis.SequenceAnalysisModule; |
@@ -403,9 +402,22 @@ public static File processVCF(File input, Integer libraryId, JobContext ctx, Res |
403 | 402 | action.addInput(vcfIdx, "Input VCF Index"); |
404 | 403 | } |
405 | 404 |
|
406 | | - resumer.getFileManager().addIntermediateFile(currentVCF); |
407 | | - resumer.getFileManager().addIntermediateFile(vcfIdx); |
408 | | - |
| 405 | + if (!currentVCF.equals(input)) |
| 406 | + { |
| 407 | + if (!URIUtil.isDescendant(ctx.getOutputDir().toURI(), currentVCF.toURI())) |
| 408 | + { |
| 409 | + ctx.getLogger().info("VCF is not a descendent of the output directory, will not add as intermediate file: " + currentVCF.getPath()); |
| 410 | + } |
| 411 | + else |
| 412 | + { |
| 413 | + resumer.getFileManager().addIntermediateFile(currentVCF); |
| 414 | + resumer.getFileManager().addIntermediateFile(vcfIdx); |
| 415 | + } |
| 416 | + } |
| 417 | + else |
| 418 | + { |
| 419 | + ctx.getLogger().info("ending VCF same as input, will not add as intermediate file: " + input.getPath()); |
| 420 | + } |
409 | 421 | ReferenceGenome genome = ctx.getSequenceSupport().getCachedGenome(libraryId); |
410 | 422 | action.addInput(genome.getSourceFastaFile(), "Reference FASTA"); |
411 | 423 |
|
|
0 commit comments