You are on page 1of 10

Read the accompanying word document "Evolution with Hardy-Weinberg Equation.

doc"

Recap
A is dominant, a is recessive
Gene frequency for A is p, for a is q
Relative proportion of AA, Aa and aa genotypes are p^2 (p squared), 2pq and q^2 (q squared)
p^2 + 2pq + q^2 = 1
Fitness coefficient is s
A is completely dominant. Fitness for AA and Aa are 1+s, fitness for aa is 1
Instead of the relative proportion being p^2, 2pq, q^2, after selection, the relative proportions are p^2(1+s), 2pq(1+s), q^2
p(new) can be calculated by (2 x number of AA individuals + number of Aa individuals) / 2(total number of individuals) [2 x total, b/c each ind'l has 2 all.]
The new population after selection is now p^2(1+s) + 2pq(1+s) + q^2
So, p(new) = {2p^2(1+s) + 2pq(1+s)} / 2{p^2(1+s) + 2pq(1+s) + q^2}
This is surprisingly easy to calculate in excel

Now look at "How the sheet works" page, which explains how the spreadsheet works.

Main worksheet can be manipulated by changing the values of s and starting p


For example, try changing s to a different value
You can also add rows at the bottom to simulate more generations. Select the cells and use Edit->Fill->Down to fill the cells with the formulae.
This sheet describes how this spreadsheet works
The pertinent formula is p(new) = {2p^2(1+s) + 2pq(1+s)} / 2{p^2(1+s) + 2pq(1+s) + q^2}
2 cancels to give {p^2(1+s) + pq(1+s)} / (p^2(1+s) + 2pq(1+s) + q^2)
T = p^2(1+s) + 2pq(1+s) + q^2

s= 0.1 <-- Here we define the selection coefficient. This is the advantage the dominant form has over the recessive form. If it's 0.1, then the advantage is 10%.
starting p = 0.01 <-- Here we define the starting gene frequency for the dominant allele A. 0.01 means it starts at 1% of the gene pool.

Before selection After selection New gene frequencies Phenotypes


generations p q pq p^2(1+s) pq(1+s) q^2 T new p new q p^2+2pq q^2
1 0.01 0.99 0.01 0 0.01 0.98 1 0.01 0.99 0.02 0.98
2 0.01 0.99 0.01 0 0.01 0.98 1 0.01 0.99 0.02 0.98
3 0.01 0.99 0.01 0 0.01 0.98 1 0.01 0.99 0.02 0.98
4 0.01 0.99 0.01 0 0.01 0.97 1 0.01 0.99 0.03 0.97
5 0.01 0.99 0.01 0 0.02 0.97 1 0.02 0.98 0.03 0.97
6 0.02 0.98 0.02 0 0.02 0.97 1 0.02 0.98 0.03 0.97

form after selection. Selection value uses the $B$6 notation.

form after selection. Selection value uses the $B$6 notation.


"=$B$7" in cell B11). Values for subsequent generations are
This is the column for the gene frequency p. The first value

from calculated values in the preceeding rows (see yellow


is defined by the value set in cell B7 (by using the formula

Calculates the gene frequency from the heterozygous Aa


Calculates the gene frequency from the homozygous AA

This is what's known as the absolute reference in excel.


This is what's known as the absolute reference in excel.
This column shows the generation number

T is the sum of p^2(1+s) + 2pq(1+s) + q^2


q is a calculated value given by 1-p

Proportion of recessive phenotype


Proportion of dominant phenotype
Simply calculated from q

{p^2(1+s) + pq(1+s)} / T
pq is a calculated value
and blue shaded cells)

1-p
If it's 0.1, then the advantage is 10%.
This is the same sheet as "How the sheet works," except it shows the first 100 generations
The pertinent formula is p(new) = {2p^2(1+s) + 2pq(1+s)} / 2{p^2(1+s) + 2pq(1+s) + q^2}
2 cancels to give {p^2(1+s) + pq(1+s)} / (p^2(1+s) + 2pq(1+s) + q^2)
T = p^2(1+s) + 2pq(1+s) + q^2

s= 0.1 <-- Here we define the selection coefficient. This is the advantage the dominant form has over the recessive form. If it's 0.1, then the advantage is 10%.
starting p = 0.01 <-- Here we define the starting gene frequency for the dominant allele A. 0.01 means it starts at 1% of the gene pool.
The graph on the next sheet plots p vs generations

Before selection After selection New gene frequencies Phenotypes


generations p q pq p^2(1+s) pq(1+s) q^2 T new p new q p^2+2pq q^2
1 0.01 0.99 0.01 0 0.01 0.98 1 0.01 0.99 0.02 0.98
2 0.01 0.99 0.01 0 0.01 0.98 1 0.01 0.99 0.02 0.98
3 0.01 0.99 0.01 0 0.01 0.98 1 0.01 0.99 0.02 0.98
4 0.01 0.99 0.01 0 0.01 0.97 1 0.01 0.99 0.03 0.97
5 0.01 0.99 0.01 0 0.02 0.97 1 0.02 0.98 0.03 0.97
6 0.02 0.98 0.02 0 0.02 0.97 1 0.02 0.98 0.03 0.97
7 0.02 0.98 0.02 0 0.02 0.97 1 0.02 0.98 0.03 0.97
8 0.02 0.98 0.02 0 0.02 0.96 1 0.02 0.98 0.04 0.96
9 0.02 0.98 0.02 0 0.02 0.96 1 0.02 0.98 0.04 0.96
10 0.02 0.98 0.02 0 0.02 0.95 1 0.03 0.97 0.05 0.95
11 0.03 0.97 0.02 0 0.03 0.95 1 0.03 0.97 0.05 0.95
12 0.03 0.97 0.03 0 0.03 0.95 1.01 0.03 0.97 0.05 0.95
13 0.03 0.97 0.03 0 0.03 0.94 1.01 0.03 0.97 0.06 0.94
14 0.03 0.97 0.03 0 0.04 0.94 1.01 0.04 0.96 0.06 0.94
15 0.04 0.96 0.03 0 0.04 0.93 1.01 0.04 0.96 0.07 0.93
16 0.04 0.96 0.04 0 0.04 0.92 1.01 0.04 0.96 0.08 0.92
17 0.04 0.96 0.04 0 0.05 0.92 1.01 0.05 0.95 0.08 0.92
18 0.05 0.95 0.04 0 0.05 0.91 1.01 0.05 0.95 0.09 0.91
19 0.05 0.95 0.05 0 0.05 0.9 1.01 0.06 0.94 0.1 0.9
20 0.06 0.94 0.05 0 0.06 0.89 1.01 0.06 0.94 0.11 0.89
21 0.06 0.94 0.06 0 0.06 0.88 1.01 0.07 0.93 0.12 0.88
22 0.07 0.93 0.06 0 0.07 0.87 1.01 0.07 0.93 0.13 0.87
23 0.07 0.93 0.07 0.01 0.07 0.86 1.01 0.08 0.92 0.14 0.86
24 0.08 0.92 0.07 0.01 0.08 0.85 1.01 0.08 0.92 0.15 0.85
25 0.08 0.92 0.08 0.01 0.08 0.84 1.02 0.09 0.91 0.16 0.84
26 0.09 0.91 0.08 0.01 0.09 0.83 1.02 0.1 0.9 0.17 0.83
27 0.1 0.9 0.09 0.01 0.1 0.81 1.02 0.11 0.89 0.19 0.81
28 0.11 0.89 0.09 0.01 0.1 0.8 1.02 0.11 0.89 0.2 0.8
29 0.11 0.89 0.1 0.01 0.11 0.78 1.02 0.12 0.88 0.22 0.78
30 0.12 0.88 0.11 0.02 0.12 0.77 1.02 0.13 0.87 0.23 0.77
31 0.13 0.87 0.11 0.02 0.13 0.75 1.02 0.14 0.86 0.25 0.75
32 0.14 0.86 0.12 0.02 0.13 0.74 1.03 0.15 0.85 0.26 0.74
33 0.15 0.85 0.13 0.03 0.14 0.72 1.03 0.16 0.84 0.28 0.72
34 0.16 0.84 0.14 0.03 0.15 0.7 1.03 0.17 0.83 0.3 0.7
35 0.17 0.83 0.14 0.03 0.16 0.68 1.03 0.19 0.81 0.32 0.68
36 0.19 0.81 0.15 0.04 0.17 0.66 1.03 0.2 0.8 0.34 0.66
37 0.2 0.8 0.16 0.04 0.17 0.64 1.04 0.21 0.79 0.36 0.64
38 0.21 0.79 0.17 0.05 0.18 0.62 1.04 0.22 0.78 0.38 0.62
39 0.22 0.78 0.17 0.05 0.19 0.6 1.04 0.24 0.76 0.4 0.6
40 0.24 0.76 0.18 0.06 0.2 0.58 1.04 0.25 0.75 0.42 0.58
41 0.25 0.75 0.19 0.07 0.21 0.56 1.04 0.26 0.74 0.44 0.56
42 0.26 0.74 0.19 0.08 0.21 0.54 1.05 0.28 0.72 0.46 0.54
43 0.28 0.72 0.2 0.08 0.22 0.52 1.05 0.29 0.71 0.48 0.52
44 0.29 0.71 0.21 0.09 0.23 0.5 1.05 0.3 0.7 0.5 0.5
45 0.3 0.7 0.21 0.1 0.23 0.49 1.05 0.32 0.68 0.51 0.49
46 0.32 0.68 0.22 0.11 0.24 0.47 1.05 0.33 0.67 0.53 0.47
47 0.33 0.67 0.22 0.12 0.24 0.45 1.06 0.35 0.65 0.55 0.45
48 0.35 0.65 0.23 0.13 0.25 0.43 1.06 0.36 0.64 0.57 0.43
49 0.36 0.64 0.23 0.14 0.25 0.41 1.06 0.37 0.63 0.59 0.41
50 0.37 0.63 0.23 0.15 0.26 0.39 1.06 0.39 0.61 0.61 0.39
51 0.39 0.61 0.24 0.17 0.26 0.38 1.06 0.4 0.6 0.62 0.38
52 0.4 0.6 0.24 0.18 0.26 0.36 1.06 0.41 0.59 0.64 0.36
53 0.41 0.59 0.24 0.19 0.27 0.34 1.07 0.43 0.57 0.66 0.34
54 0.43 0.57 0.24 0.2 0.27 0.33 1.07 0.44 0.56 0.67 0.33
55 0.44 0.56 0.25 0.21 0.27 0.31 1.07 0.45 0.55 0.69 0.31
56 0.45 0.55 0.25 0.23 0.27 0.3 1.07 0.47 0.53 0.7 0.3
57 0.47 0.53 0.25 0.24 0.27 0.28 1.07 0.48 0.52 0.72 0.28
58 0.48 0.52 0.25 0.25 0.27 0.27 1.07 0.49 0.51 0.73 0.27
59 0.49 0.51 0.25 0.27 0.27 0.26 1.07 0.5 0.5 0.74 0.26
60 0.5 0.5 0.25 0.28 0.27 0.25 1.08 0.51 0.49 0.75 0.25
61 0.51 0.49 0.25 0.29 0.27 0.24 1.08 0.53 0.47 0.76 0.24
62 0.53 0.47 0.25 0.3 0.27 0.22 1.08 0.54 0.46 0.78 0.22
63 0.54 0.46 0.25 0.32 0.27 0.21 1.08 0.55 0.45 0.79 0.21
64 0.55 0.45 0.25 0.33 0.27 0.2 1.08 0.56 0.44 0.8 0.2
65 0.56 0.44 0.25 0.34 0.27 0.2 1.08 0.57 0.43 0.8 0.2
66 0.57 0.43 0.25 0.35 0.27 0.19 1.08 0.58 0.42 0.81 0.19
67 0.58 0.42 0.24 0.37 0.27 0.18 1.08 0.59 0.41 0.82 0.18
68 0.59 0.41 0.24 0.38 0.27 0.17 1.08 0.6 0.4 0.83 0.17
69 0.6 0.4 0.24 0.39 0.26 0.16 1.08 0.61 0.39 0.84 0.16
70 0.61 0.39 0.24 0.4 0.26 0.16 1.08 0.61 0.39 0.84 0.16
71 0.61 0.39 0.24 0.41 0.26 0.15 1.09 0.62 0.38 0.85 0.15
72 0.62 0.38 0.23 0.43 0.26 0.14 1.09 0.63 0.37 0.86 0.14
73 0.63 0.37 0.23 0.44 0.26 0.14 1.09 0.64 0.36 0.86 0.14
74 0.64 0.36 0.23 0.45 0.25 0.13 1.09 0.65 0.35 0.87 0.13
75 0.65 0.35 0.23 0.46 0.25 0.13 1.09 0.65 0.35 0.87 0.13
76 0.65 0.35 0.23 0.47 0.25 0.12 1.09 0.66 0.34 0.88 0.12
77 0.66 0.34 0.22 0.48 0.25 0.11 1.09 0.67 0.33 0.89 0.11
78 0.67 0.33 0.22 0.49 0.24 0.11 1.09 0.67 0.33 0.89 0.11
79 0.67 0.33 0.22 0.5 0.24 0.11 1.09 0.68 0.32 0.89 0.11
80 0.68 0.32 0.22 0.51 0.24 0.1 1.09 0.69 0.31 0.9 0.1
81 0.69 0.31 0.21 0.52 0.24 0.1 1.09 0.69 0.31 0.9 0.1
82 0.69 0.31 0.21 0.53 0.23 0.09 1.09 0.7 0.3 0.91 0.09
83 0.7 0.3 0.21 0.54 0.23 0.09 1.09 0.71 0.29 0.91 0.09
84 0.71 0.29 0.21 0.55 0.23 0.09 1.09 0.71 0.29 0.91 0.09
85 0.71 0.29 0.21 0.56 0.23 0.08 1.09 0.72 0.28 0.92 0.08
86 0.72 0.28 0.2 0.56 0.22 0.08 1.09 0.72 0.28 0.92 0.08
87 0.72 0.28 0.2 0.57 0.22 0.08 1.09 0.73 0.27 0.92 0.08
88 0.73 0.27 0.2 0.58 0.22 0.07 1.09 0.73 0.27 0.93 0.07
89 0.73 0.27 0.2 0.59 0.22 0.07 1.09 0.74 0.26 0.93 0.07
90 0.74 0.26 0.19 0.6 0.21 0.07 1.09 0.74 0.26 0.93 0.07
91 0.74 0.26 0.19 0.6 0.21 0.07 1.09 0.75 0.25 0.93 0.07
92 0.75 0.25 0.19 0.61 0.21 0.06 1.09 0.75 0.25 0.94 0.06
93 0.75 0.25 0.19 0.62 0.21 0.06 1.09 0.75 0.25 0.94 0.06
94 0.75 0.25 0.19 0.63 0.2 0.06 1.09 0.76 0.24 0.94 0.06
95 0.76 0.24 0.18 0.63 0.2 0.06 1.09 0.76 0.24 0.94 0.06
96 0.76 0.24 0.18 0.64 0.2 0.06 1.09 0.77 0.23 0.94 0.06
97 0.77 0.23 0.18 0.65 0.2 0.05 1.09 0.77 0.23 0.95 0.05
98 0.77 0.23 0.18 0.65 0.19 0.05 1.09 0.77 0.23 0.95 0.05
99 0.77 0.23 0.17 0.66 0.19 0.05 1.09 0.78 0.22 0.95 0.05
100 0.78 0.22 0.17 0.67 0.19 0.05 1.1 0.78 0.22 0.95 0.05
hen the advantage is 10%.
Gene Frequency change under selection
1

0.9

Column B Column K
0.8

0.7

0.6

0.5
p

0.4

0.3

0.2

0.1

0
0 20 40 60 80 100

Generations