Merge pull request #530 from broadinstitute/vrr_gvcf_enabling_allele_trimming
Activate reverse allele trimming in GVCF
This commit is contained in:
commit
a567a4d42c
|
|
@ -229,9 +229,8 @@ public class GenotypingEngine {
|
||||||
|
|
||||||
VariantContext annotatedCall = annotationEngine.annotateContextForActiveRegion(tracker, stratifiedReadMap, call);
|
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);
|
annotatedCall = GATKVariantContextUtils.reverseTrimAlleles(annotatedCall);
|
||||||
}
|
|
||||||
|
|
||||||
// maintain the set of all called haplotypes
|
// maintain the set of all called haplotypes
|
||||||
for ( final Allele calledAllele : call.getAlleles() ) {
|
for ( final Allele calledAllele : call.getAlleles() ) {
|
||||||
|
|
|
||||||
|
|
@ -202,10 +202,12 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
|
||||||
|
|
||||||
// only re-genotype polymorphic sites
|
// only re-genotype polymorphic sites
|
||||||
if ( result.isVariant() ) {
|
if ( result.isVariant() ) {
|
||||||
final VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
|
VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
|
||||||
if ( regenotypedVC == null )
|
if ( regenotypedVC == null )
|
||||||
return 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
|
// 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());
|
final Map<String, Object> attrs = new HashMap<>(originalVC.getAttributes());
|
||||||
attrs.put(VCFConstants.MLE_ALLELE_COUNT_KEY, regenotypedVC.getAttribute(VCFConstants.MLE_ALLELE_COUNT_KEY));
|
attrs.put(VCFConstants.MLE_ALLELE_COUNT_KEY, regenotypedVC.getAttribute(VCFConstants.MLE_ALLELE_COUNT_KEY));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue