Merge pull request #493 from broadinstitute/eb_fix_failing_merge_for_tim

The UG engine can return a null VC if there are tons of alt alleles, cau...
This commit is contained in:
Eric Banks 2014-02-07 12:43:40 -05:00
commit 0a1385a4d9
1 changed files with 7 additions and 3 deletions

View File

@ -207,11 +207,15 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
final Map<String,Object> originalAttributes = combinedVC.getAttributes();
// only re-genotype polymorphic sites
if ( combinedVC.isVariant() )
result = new VariantContextBuilder(genotypingEngine.calculateGenotypes(result)).attributes(originalAttributes).make();
if ( combinedVC.isVariant() ) {
final VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
if ( regenotypedVC == null )
return null;
result = new VariantContextBuilder(regenotypedVC).attributes(originalAttributes).make();
}
// if it turned monomorphic and we don't want such sites, quit
if ( result == null || (!INCLUDE_NON_VARIANTS && result.isMonomorphicInSamples()) )
if ( !INCLUDE_NON_VARIANTS && result.isMonomorphicInSamples() )
return null;
// re-annotate it