Skip to content

Commit 54ebc1e

Browse files
committed
Bugfixes to GenotypeGVCFs when run using multple GVCFs
1 parent 713e475 commit 54ebc1e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/GenotypeGVCFHandler.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ private File runGenotypeGVCFs(PipelineJob job, JobContext ctx, ProcessVariantsHa
312312
if (filesToProcess.size() > 1)
313313
{
314314
inputVcf = combineInputs(ctx, filesToProcess, genomeId);
315+
ctx.getFileManager().addIntermediateFile(inputVcf);
316+
ctx.getFileManager().addIntermediateFile(new File(inputVcf.getPath() + ".tbi"));
315317
}
316318
else
317319
{
@@ -387,8 +389,13 @@ private File runGenotypeGVCFs(PipelineJob job, JobContext ctx, ProcessVariantsHa
387389

388390
private File combineInputs(JobContext ctx, List<File> inputFiles, int genomeId) throws PipelineJobException
389391
{
390-
// TODO: this should ultimately be expanded to include smarter merge with GenomicsDB
391-
// Also consider allowing the input to be a folder with per-contig gVCFs
392+
for (File f : inputFiles)
393+
{
394+
if (!GenotypeGVCFsWrapper.GVCF.isType(f))
395+
{
396+
throw new PipelineJobException("If multiple inputs are used, all must be gVCFs: " + f.getName());
397+
}
398+
}
392399

393400
String basename = getBasename(ctx);
394401
File combined = new File(ctx.getOutputDir(), basename + ".combined.gvcf.gz");

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/GenotypeGVCFsWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ else if (inputFile.isDirectory())
8080
}
8181
}
8282

83-
private static FileType GVCF = new FileType(".g.vcf", FileType.gzSupportLevel.SUPPORT_GZ);
83+
public static FileType GVCF = new FileType(Arrays.asList(".g.vcf", ".gvcf"), ".g.vcf", FileType.gzSupportLevel.SUPPORT_GZ);
8484

8585
public static List<File> copyVcfsLocally(Collection<File> inputGVCFs, Collection<File> toDelete, File localWorkDir, Logger log, boolean isResume) throws PipelineJobException
8686
{

0 commit comments

Comments
 (0)