diff --git a/protected/gatk-protected/src/main/java/org/broadinstitute/sting/gatk/walkers/variantutils/CombineReferenceCalculationVariants.java b/protected/gatk-protected/src/main/java/org/broadinstitute/sting/gatk/walkers/variantutils/CombineReferenceCalculationVariants.java index 2a004aaca..66bf562d7 100644 --- a/protected/gatk-protected/src/main/java/org/broadinstitute/sting/gatk/walkers/variantutils/CombineReferenceCalculationVariants.java +++ b/protected/gatk-protected/src/main/java/org/broadinstitute/sting/gatk/walkers/variantutils/CombineReferenceCalculationVariants.java @@ -153,9 +153,12 @@ public class CombineReferenceCalculationVariants extends RodWalker vcfRods = GATKVCFUtils.getVCFHeadersFromRods(getToolkit()); - final Set samples = SampleUtils.getSampleList(vcfRods, GATKVariantContextUtils.GenotypeMergeType.REQUIRE_UNIQUE); final Set headerLines = VCFUtils.smartMergeHeaders(vcfRods.values(), true); headerLines.addAll(Arrays.asList(ChromosomeCountConstants.descriptions)); + if ( dbsnp != null && dbsnp.dbsnp.isBound() ) + VCFStandardHeaderLines.addStandardInfoLines(headerLines, true, VCFConstants.DBSNP_KEY); + + final Set samples = SampleUtils.getSampleList(vcfRods, GATKVariantContextUtils.GenotypeMergeType.REQUIRE_UNIQUE); final VCFHeader vcfHeader = new VCFHeader(headerLines, samples); vcfWriter.writeHeader(vcfHeader); @@ -204,7 +207,7 @@ public class CombineReferenceCalculationVariants extends RodWalker VCs, final GenomeLoc loc, final Byte refBase) { - - if ( VCs == null || VCs.size() == 0 ) throw new IllegalArgumentException("VCs cannot be null or empty"); + // this can happen if e.g. you are using a dbSNP file that spans a region with no gVCFs + if ( VCs == null || VCs.size() == 0 ) + return null; // establish the baseline info (sometimes from the first VC) final VariantContext first = VCs.get(0); @@ -1536,6 +1537,8 @@ public class GATKVariantContextUtils { final List remappedAlleles, final List targetAlleles) { for ( final Genotype g : VC.getGenotypes() ) { + if ( !g.hasPL() ) + throw new UserException("cannot merge genotypes from samples without PLs; sample " + g.getSampleName() + " does not have likelihoods at position " + VC.getChr() + ":" + VC.getStart()); // only add if the name is new final String name = g.getSampleName();