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:
Valentin Ruano-Rubio 2014-02-19 20:19:09 -05:00
parent 132e2429c8
commit 463af7143f
2 changed files with 4 additions and 3 deletions

View File

@ -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() ) {

View File

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