#note Population Genetics A Concise Guide (13)

This is a note for the book Population Genetics: A Concise Guide (Second Edition).

Page 27

Problem 2.4 Graph Ht and Gt for 100 generations with H0 = 1 and population sizes of 1, 10, 100, and 1,000,000.

Note:

According to the formula:

    \[H_{t} = H_{0}(1-\frac{1}{2N})^{t}\]

import numpy as np
from matplotlib import pyplot as plt

def h(t,y):
   return (1-1/(2*y))**t

fig = plt.figure(figsize=(24, 12))
t = np.arange(1, 100, 1)
plt.plot(t, h(t,1) , color='red')
plt.plot(t, h(t,10) , color='blue')
plt.plot(t, h(t,100) , color='green')
plt.plot(t, h(t,1000000) , color='purple')
plt.xlabel('Generation')
plt.ylabel('Ht')
x_ticks = np.arange(1, 100, 1)
y_ticks = np.arange(0, 1, 0.1)
plt.xticks(x_ticks)
plt.yticks(y_ticks)
plt.show()

Output:

Figure 1: Calculation of Ht. Polulation sizes of 1 (red), 10 (blue), 100 (green) and 1,000,000 (purple).

This indicates that genetic drift has a greater impact on small populations rather than large populations, small populations tend to lose genetic diversity more quickly than large populations.

Graph Gt where

    \[G_{t} = 1 - H_{t}\]

import numpy as np
from matplotlib import pyplot as plt

def g(t,y):
   return 1-(1-1/(2*y))**t

fig = plt.figure(figsize=(24, 12))
t = np.arange(1, 100, 1)
plt.plot(t, g(t,1) , color='red')
plt.plot(t, g(t,10) , color='blue')
plt.plot(t, g(t,100) , color='green')
plt.plot(t, g(t,1000000) , color='purple')
plt.xlabel('Generation')
plt.ylabel('Gt')
x_ticks = np.arange(1, 100, 1)
y_ticks = np.arange(0, 1, 0.1)
plt.xticks(x_ticks)
plt.yticks(y_ticks)
plt.show()

Output:

Figure 2: Calculation of Gt. Polulation sizes of 1 (red), 10 (blue), 100 (green) and 1,000,000 (purple).

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top