Activate reverse allele trimming in GVCF
Story: https://www.pivotaltracker.com/s/projects/1007536 Changes: 1. HC's GenotypingEngine now invokes reverseAlleleTrimming on GVCF variant output lines. 2. GenotypeGVCFs also reverse trim after regenotyping as some alt. alleles are dropped (observed in real-data).
This commit is contained in:
parent
132e2429c8
commit
463af7143f
|
|
@ -229,9 +229,8 @@ public class GenotypingEngine {
|
|||
|
||||
VariantContext annotatedCall = annotationEngine.annotateContextForActiveRegion(tracker, stratifiedReadMap, call);
|
||||
|
||||
if( !emitReferenceConfidence && call.getAlleles().size() != mergedVC.getAlleles().size() ) { // some alleles were removed so reverseTrimming might be necessary!
|
||||
if( call.getAlleles().size() != mergedVC.getAlleles().size() )
|
||||
annotatedCall = GATKVariantContextUtils.reverseTrimAlleles(annotatedCall);
|
||||
}
|
||||
|
||||
// maintain the set of all called haplotypes
|
||||
for ( final Allele calledAllele : call.getAlleles() ) {
|
||||
|
|
|
|||
|
|
@ -202,10 +202,12 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
|
|||
|
||||
// only re-genotype polymorphic sites
|
||||
if ( result.isVariant() ) {
|
||||
final VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
|
||||
VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
|
||||
if ( regenotypedVC == null )
|
||||
return null;
|
||||
|
||||
regenotypedVC = GATKVariantContextUtils.reverseTrimAlleles(regenotypedVC);
|
||||
|
||||
// we want to carry forward the attributes from the original VC but make sure to add the MLE-based annotations
|
||||
final Map<String, Object> attrs = new HashMap<>(originalVC.getAttributes());
|
||||
attrs.put(VCFConstants.MLE_ALLELE_COUNT_KEY, regenotypedVC.getAttribute(VCFConstants.MLE_ALLELE_COUNT_KEY));
|
||||
|
|
|
|||
Loading…
Reference in New Issue