Merge pull request #753 from broadinstitute/ldg_HCzeroDepth
Fix GenotypeGVCF bugs in -allSites mode
This commit is contained in:
commit
bcf6be0b08
|
|
@ -219,11 +219,14 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
|
||||||
// only re-genotype polymorphic sites
|
// only re-genotype polymorphic sites
|
||||||
if ( result.isVariant() ) {
|
if ( result.isVariant() ) {
|
||||||
VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
|
VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
|
||||||
if ( regenotypedVC == null )
|
if ( regenotypedVC == null) {
|
||||||
return null;
|
if (!INCLUDE_NON_VARIANTS)
|
||||||
|
return null;
|
||||||
regenotypedVC = GATKVariantContextUtils.reverseTrimAlleles(regenotypedVC);
|
}
|
||||||
result = addGenotypingAnnotations(originalVC.getAttributes(), regenotypedVC);
|
else {
|
||||||
|
regenotypedVC = GATKVariantContextUtils.reverseTrimAlleles(regenotypedVC);
|
||||||
|
result = addGenotypingAnnotations(originalVC.getAttributes(), regenotypedVC);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it turned monomorphic then we either need to ignore or fix such sites
|
// if it turned monomorphic then we either need to ignore or fix such sites
|
||||||
|
|
@ -313,10 +316,12 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
|
||||||
|
|
||||||
if ( createRefGTs ) {
|
if ( createRefGTs ) {
|
||||||
final int ploidy = oldGT.getPloidy();
|
final int ploidy = oldGT.getPloidy();
|
||||||
final List<Allele> refAlleles = new ArrayList<>(ploidy);
|
final List<Allele> refAlleles = Collections.nCopies(ploidy,VC.getReference());
|
||||||
for ( int i = 0; i < ploidy; i++ )
|
|
||||||
refAlleles.add(VC.getReference());
|
//keep 0 depth samples as no-call
|
||||||
builder.alleles(refAlleles);
|
if (depth > 0) {
|
||||||
|
builder.alleles(refAlleles);
|
||||||
|
}
|
||||||
|
|
||||||
// also, the PLs are technically no longer usable
|
// also, the PLs are technically no longer usable
|
||||||
builder.noPL();
|
builder.noPL();
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest {
|
||||||
" -V:sample3 " + privateTestDir + "combine.single.sample.pipeline.3.vcf" +
|
" -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),
|
" --includeNonVariantSites -L 20:10,030,000-10,033,000 -L 20:10,386,000-10,386,500", b37KGReference),
|
||||||
1,
|
1,
|
||||||
Arrays.asList("4193e7c4e6fc889b4aa5a326899b1a4e"));
|
Arrays.asList("fdd06679c8a14ef2010d075cbae76519"));
|
||||||
executeTest("combineSingleSamplePipelineGVCF_includeNonVariants", spec);
|
executeTest("combineSingleSamplePipelineGVCF_includeNonVariants", spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue