Merge pull request #530 from broadinstitute/vrr_gvcf_enabling_allele_trimming

Activate reverse allele trimming in GVCF
This commit is contained in:
Valentin Ruano Rubio 2014-02-20 04:26:25 -05:00
commit a567a4d42c
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));