[A1] Hardy-Weinberg Equilibrium

[A1-1] - Agouti Gene

What we know

The coat color phenotype of rabbits is controlled by a gene called Agouti. The wild-type A allele is dominant and causes hairs to be black pigmented. We have 60 agouti and and 51 non-agouti individuals (phenotypes) in a local rabbit population.

  • Phenotype-Agouti: \(N(AA) + N(Aa) = 60\)
  • Phenotype-Non-Agouti: \(N(aa) = 51\)
Question

How many % of the individuals are homozygote for the agouti gene?

  • \(f(AA) = ?\)
Solution

We know how many rabbits we have in total (n=111) and we know how many are non-Agouti (\(n(aa)=51\)). So first we calculate the frequency of the non-Agouti rabbits:

  • \(f(aa) = p^2 = \frac{51}{111} = 0.4594595 \rightarrow \text{We have } 45.9 \%\) non-Agouti rabbits.

Now we can calculate the allele frequency of the a allele.

  • \(q = \sqrt{f(aa)} = \sqrt{45.9}=0.678\)

Next we calculate the allele frequency for dominat A allele.

  • \(p = 1 - q = 1 - 0.678 = 0.322\)

Now, we have everything we need to calculate the frequency of the homozygote Agouti rabbits f(AA) in this population.

  • \(f(AA) = f(A)^2 = p^2 = 0.1037907 \rightarrow \text{There are} \underline{\underline{10.4}} \%\) rabbits homozygote for the agouti gene?.

[A1-2] - Scarlet Tiger-Moth

What we know

Observed number of genotypes

  • \(n(AA) = 1469\)
  • \(n(Aa) = 138\)
  • \(n(aa) = 5\)
  • \(n(total) = 1612\)
Question
  1. Allele Frequency ? \(f(A)=p\) and \(f(a)=q\)
  2. HW expectation ? \(\hat{n}(AA)\), \(\hat{n}(Aa)\), and \(\hat{n}(aa)\)
  3. Pearson’s chi-square test ? \(\chi^2\)
Solution
  1. Allele Frequencies:
  • \(p = f(AA) + \frac{1}{2} * f(Aa) = \frac{1469}{1612} + \frac{1}{2} * \frac{138}{1612} = 0.954\)
  • \(q = 1-p = f(a) = 0.046\)
  1. Expected number of phenotype:
  • \(\hat{n}_{AA} = p^2N = 1467.11\)
  • \(\hat{n}_{Aa} = 2pqN = 141.19\)
  • \(\hat{n}_{aa} = q^2N = 3.4\)

Summary:

AA Aa aa Total
\(N_{obs}\) 1469 138 5 1612
\(N_{exp}\) 1467.11 141.19 3.4 1611.7
  1. Pearson’s chi-square test:
  • \(\chi^2 = 0.8309482\)
  • \(p-value = 0.362\)

⇒ At this loci, the observed population of Scarlet Tiger Moth appears to be at HW.


[A1-3] - 1 Locus, 3 Alleles

What we know
Genotypes AA AB AC BB BC CC Sum
Counts 17 86 5 61 9 0 178
Frequencies 0.096 0.483 0.028 0.343 0.051 0 1.000
Question

Calculate allele frequencies.

Solution #1

\(f(A) = f(AA)+\frac{f(AB)}{2}+\frac{f(AC)}{2} = 0.0955056+\frac{0.4831461}{2}+\frac{0.0280899}{2} = 0.351\)

\(f(B) = f(BB)+\frac{f(AB)}{2}+\frac{f(BC)}{2} = 0.3426966+\frac{0.4831461}{2}+\frac{0.0505618}{2} = 0.61\)

\(f(C) = f(CC)+\frac{f(AC)}{2}+\frac{f(BC)}{2} = 0+\frac{0.0280899}{2}+\frac{0.0505618}{2} = 0.039\)

Solution #2
abc.data   <- c(rep("A/A", 17),
                rep("A/B", 86),
                rep("A/C",  5),
                rep("B/B", 61),
                rep("B/C",  9),
                rep("C/C",  0))

# Create a genotype object
g3  <- genetics::genotype(abc.data)
# Chi-Square Test
genetics::HWE.chisq(g3, B = 10000) # B: Number of simulations, default: 10'000
## 
##  Pearson's Chi-squared test with simulated p-value (based on 10000
##  replicates)
## 
## data:  tab
## X-squared = 3.0775, df = NA, p-value = 0.5371
Solution #3
source("https://www.gdc-docs.ethz.ch/UniBS/EvolutionaryGenetics/PopGen/script/hw3.R")
hw3(AA = nAA, AB = nAB, AC = nAC, BB = nBB, BC = nBC, CC = nCC)
##    obs_N  obs_f(GT)    ex_f(GT)      exp_N           D
## AA    17 0.09550562 0.123287779 21.9452247 1.114376719
## BB    61 0.34269663 0.371551887 66.1362360 0.398887530
## CC     0 0.00000000 0.001546522  0.2752809 0.275280899
## AB    86 0.48314607 0.428055170 76.1938202 1.262059856
## AC     5 0.02808989 0.027616463  4.9157303 0.001444623
## BC     9 0.05056180 0.047942179  8.5337079 0.025478767
## [1] freq(A) =  0.35112   
## [1] freq(B) =  0.60955   
## [1] freq(C) =  0.03933   
## [1] X^2     =  3.07753   
## [1] p-value =  0.37983
## [1] "=> Population is in H-W at this locus"

[A1-4] - Brown Hare

What we know
Genotype Obs
1 100/100 4
2 100/81 6
3 81/81 14
4 100/66 4
5 81/66 7
6 66/66 3
Total 38
Question

Is the sampled population in Hardy-Weinberg proportions at the ACY1 locus?

Solution

Allele frequencies:

Fragment length 100 nt: \(\hat{p}=0.237\)

Fragment length 81 nt: \(\hat{q}=0.539\)

Fragment length 66 nt: \(\hat{r}=0.224\)

Expected number of genotype:

Genotype Obs Exp
1 100/100 4 2.1315789
2 100/81 6 9.7105263
3 100/66 4 4.0263158
4 81/81 14 11.0592105
5 81/66 7 9.1710526
6 66/66 3 1.9013158

\(\chi^2 test:\)

\(\chi^2=\sum{\frac{(obs-exp)^2}{exp}} \rightarrow \chi^2=4.9865923 \rightarrow p-value=0.1727816\) (n.s.)

⇒ At locus ACY1, the observed population of Brown Hare appears to be at HW.


[A1-5] - Bitter Taste

What we know

We have SNP-based genotyping for three different loci (position).

L145 L785 L886 Count
GC CC AG 1
GG CT GA 2
GG TT AA 9
CC CC AA 1
CG CC GG 3
CG CT GA 27
CC CC GG 12
CC CC AA 1
Questions
  1. Calculate allele and genotype frequency for the 3 different loci.
  2. Are the 3 loci in Hardy-Weinberg proportions?
  3. Create Ternary plots.
Solutions

Number of Genotypes

Locus 145: \(n(GG) = 11\); \(n(GC) + n(CG) = 31\); \(n(GG) = 14\)

Locus 785: \(n(CC) = 18\); \(n(CT) + n(TC) = 29\); \(n(TT) = 9\)

Locus 886: \(n(AA) = 11\); \(n(AG) + n(GA) = 30\); \(n(GG) = 15\)

(a1) Genotype frequency

Locus 145: \(f(GG)=0.196\); \(f(GC)=0.554\); \(f(CC)=0.25\)

Locus 785: \(f(CC)=0.321\); \(f(CT)=0.518\); \(f(TT)=0.161\)

Locus 886: \(f(AA)=0.196\); \(f(AG)=0.536\); \(f(GG)=0.268\)

(a2) Allele frequency

Locus 145: \(f(G)=0.473\); \(f(C)=0.527\)

Locus 785: \(f(C)=0.58\); \(f(T)=0.42\)

Locus 886: \(f(A)=0.464\); \(f(G)=0.536\)

(b + c) HW and Ternary Plots

Locus 145

## Chi-square test for Hardy-Weinberg equilibrium (autosomal)
## Chi2 =  0.6816642 DF =  1 p-value =  0.4090143 D =  1.540179 f =  -0.1103294

Locus 785

## Chi-square test for Hardy-Weinberg equilibrium (autosomal)
## Chi2 =  0.2235014 DF =  1 p-value =  0.6363849 D =  0.8616071 f =  -0.06317512

Locus 886

## Chi-square test for Hardy-Weinberg equilibrium (autosomal)
## Chi2 =  0.3313609 DF =  1 p-value =  0.5648588 D =  1.071429 f =  -0.07692308