Example #1
0
  public boolean selectSiteInSamples(VariantContext vc) {
    if (samples == null || samples.isEmpty()) return true;
    // want to include a site in the given samples if it is *likely* to be variant (via the EXACT
    // model)
    // first subset to the samples
    VariantContext subContext = vc.subContextFromSamples(samples);

    if (!subContext.isPolymorphicInSamples()) return false;

    // now check to see (using EXACT model) whether this should be variant
    // do we want to apply a prior? maybe user-spec?
    if (flatPriors == null) {
      flatPriors = new double[1 + 2 * samples.size()];
      AFCalculator = AFCalcFactory.createAFCalc(samples.size(), 4, 2);
    }
    final AFCalcResult result = AFCalculator.getLog10PNonRef(subContext, flatPriors);
    // do we want to let this qual go up or down?
    if (result.getLog10LikelihoodOfAFEq0() < referenceLikelihood) {
      return true;
    }

    return false;
  }