private VariantCallContext estimateReferenceConfidence(
      VariantContext vc,
      Map<String, AlignmentContext> contexts,
      double theta,
      boolean ignoreCoveredSamples,
      double initialPofRef) {
    if (contexts == null) return null;

    double P_of_ref = initialPofRef;

    // for each sample that we haven't examined yet
    for (String sample : samples) {
      boolean isCovered = contexts.containsKey(sample);
      if (ignoreCoveredSamples && isCovered) continue;

      int depth = 0;

      if (isCovered) {
        depth = contexts.get(sample).getBasePileup().depthOfCoverage();
      }

      P_of_ref *= 1.0 - (theta / 2.0) * getRefBinomialProb(depth);
    }

    return new VariantCallContext(
        vc,
        QualityUtils.phredScaleErrorRate(1.0 - P_of_ref) >= UAC.STANDARD_CONFIDENCE_FOR_CALLING,
        false);
  }
 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);
 }