diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index e2caf87c8..096aa3af1 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -202,14 +202,14 @@ public class UnifiedGenotyper extends LocusWalker contexts, double theta, boolean ignoreCoveredSamples, double initialPofRef) { + private VariantCallContext estimateReferenceConfidence(VariantContext vc, Map contexts, double theta, boolean ignoreCoveredSamples, double initialPofRef) { if ( contexts == null ) return null; @@ -518,7 +518,7 @@ public class UnifiedGenotyperEngine { P_of_ref *= 1.0 - (theta / 2.0) * MathUtils.binomialProbability(0, depth, 0.5); } - return new VariantCallContext(QualityUtils.phredScaleErrorRate(1.0 - P_of_ref) >= UAC.STANDARD_CONFIDENCE_FOR_CALLING); + return new VariantCallContext(vc, QualityUtils.phredScaleErrorRate(1.0 - P_of_ref) >= UAC.STANDARD_CONFIDENCE_FOR_CALLING, false); } protected void printVerboseData(String pos, VariantContext vc, double PofF, double phredScaledConfidence, double[] normalizedPosteriors) { @@ -651,6 +651,11 @@ public class UnifiedGenotyperEngine { return conf >= UAC.STANDARD_CONFIDENCE_FOR_CALLING; } + protected boolean confidentlyCalled(double conf, double PofF) { + return conf >= UAC.STANDARD_CONFIDENCE_FOR_CALLING || + (UAC.GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES && QualityUtils.phredScaleErrorRate(PofF) >= UAC.STANDARD_CONFIDENCE_FOR_CALLING); + } + protected void computeAlleleFrequencyPriors(int N) { // calculate the allele frequency priors for 1-N double sum = 0.0; diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java index f280b75b7..16dac6fbe 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/VariantCallContext.java @@ -35,29 +35,32 @@ import org.broad.tribble.util.variantcontext.VariantContext; * * Useful helper class to communicate the results of calculateGenotype to framework */ -public class VariantCallContext { - public VariantContext vc = null; +public class VariantCallContext extends VariantContext { public byte refBase; // Was the site called confidently, either reference or variant? public boolean confidentlyCalled = false; + // Should this site be emitted? + public boolean shouldEmit = true; + VariantCallContext(VariantContext vc, boolean confidentlyCalledP) { - this.vc = vc; + super(vc); this.confidentlyCalled = confidentlyCalledP; } + VariantCallContext(VariantContext vc, boolean confidentlyCalledP, boolean shouldEmit) { + super(vc); + this.confidentlyCalled = confidentlyCalledP; + this.shouldEmit = shouldEmit; + } + VariantCallContext(VariantContext vc, byte ref, boolean confidentlyCalledP) { - this.vc = vc; + super(vc); this.refBase = ref; this.confidentlyCalled = confidentlyCalledP; } - // blank variant context => we're a ref site - VariantCallContext(boolean confidentlyCalledP) { - this.confidentlyCalled = confidentlyCalledP; - } - public void setRefBase(byte ref) { this.refBase = ref; }