code: private static double pGenotype(Genotype g, double refProb) {
      switch(g) {
        case REF_HOMOZYGOUS:
          return refProb * refProb;
        case HETEROZYGOUS:
          return refProb * (1.0 - refProb);
        case NONREF_HOMOZYGOUS:
          return (1.0 - refProb) * (1.0 - refProb);
        default:
          throw new IllegalArgumentException("Illegal genotype");
      }
    }
docs: Compute the probability of a genotype given the reference allele probability.