private static void RecalibrateGenotypeByFisherExactTest(List <string> genotypes, int index, int refAllele, int altAllele)
        {
            var totalAllele = refAllele + altAllele;
            var halfAllele1 = totalAllele / 2;
            var halfAllele2 = totalAllele - halfAllele1;

            var g0 = MyFisherExactTest.TwoTailPValue(refAllele, altAllele, totalAllele, 0);
            var g1 = MyFisherExactTest.TwoTailPValue(refAllele, altAllele, halfAllele1, halfAllele2);

            if (halfAllele1 != halfAllele2)
            {
                g1 = Math.Max(g1, MyFisherExactTest.TwoTailPValue(refAllele, altAllele, halfAllele2, halfAllele1));
            }
            var g2 = MyFisherExactTest.TwoTailPValue(refAllele, altAllele, 0, totalAllele);

            if (g0 > g1 && g0 > g2)
            {
                genotypes[index] = "0";
            }
            else if (g1 > g2)
            {
                genotypes[index] = "1";
            }
            else
            {
                genotypes[index] = "2";
            }
        }
 public double CalculateTwoTailPValue()
 {
     //When sample size < 20
     PValue = MyFisherExactTest.TwoTailPValue(Sample1.Succeed, Sample1.Failed, Sample2.Succeed, Sample2.Failed);
     return(PValue);
 }