From 5465e4484edc1e5a5873722df0617da2831339af Mon Sep 17 00:00:00 2001 From: Laura Gauthier Date: Fri, 17 Oct 2014 09:26:38 -0400 Subject: [PATCH] For GenotypeGVCFs -allSites mode, make genotypes no-call if depth is zero. --- .../gatk/tools/walkers/variantutils/GenotypeGVCFs.java | 10 ++++++---- .../variantutils/GenotypeGVCFsIntegrationTest.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java index 500e8f94c..1e4d7223e 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java @@ -313,10 +313,12 @@ public class GenotypeGVCFs extends RodWalker refAlleles = new ArrayList<>(ploidy); - for ( int i = 0; i < ploidy; i++ ) - refAlleles.add(VC.getReference()); - builder.alleles(refAlleles); + final List refAlleles = Collections.nCopies(ploidy,VC.getReference()); + + //keep 0 depth samples as no-call + if (depth > 0) { + builder.alleles(refAlleles); + } // also, the PLs are technically no longer usable builder.noPL(); diff --git a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java index 627d2afcf..d4ebc3bc7 100644 --- a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java +++ b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java @@ -119,7 +119,7 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { " -V:sample3 " + privateTestDir + "combine.single.sample.pipeline.3.vcf" + " --includeNonVariantSites -L 20:10,030,000-10,033,000 -L 20:10,386,000-10,386,500", b37KGReference), 1, - Arrays.asList("4193e7c4e6fc889b4aa5a326899b1a4e")); + Arrays.asList("fdd06679c8a14ef2010d075cbae76519")); executeTest("combineSingleSamplePipelineGVCF_includeNonVariants", spec); }