For GenotypeGVCFs -allSites mode, make genotypes no-call if depth is zero.

This commit is contained in:
Laura Gauthier 2014-10-17 09:26:38 -04:00
parent 5fa5724e4a
commit 5465e4484e
2 changed files with 7 additions and 5 deletions

View File

@ -313,10 +313,12 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
if ( createRefGTs ) {
final int ploidy = oldGT.getPloidy();
final List<Allele> refAlleles = new ArrayList<>(ploidy);
for ( int i = 0; i < ploidy; i++ )
refAlleles.add(VC.getReference());
builder.alleles(refAlleles);
final List<Allele> 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();

View File

@ -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);
}