5.20 Conclusion

In this lab, we built a Wright-Fisher simulation for one allele, allowing us to track how we expect its frequency to change over time under the principles of genetic drift.

  • Within each simulated generation, we drew the number of allele carriers in the next generation from a binomial distribution.

  • We performed these AF draws within a for loop, allowing us to update the current AF with each new generation.

  • Finally, we wrapped our Wright-Fisher simulation code into a function, allowing us to easily re-run our simulation with different parameters for the starting AF, population size, and number of generations to simulate for.

  • We observed that smaller population sizes and more extreme AFs (closer to 0 or 1) generally decrease an allele’s time to fixation.

This simple simulation forms the core of most models used in evolutionary genetics research, which often extend this model to simulate more complex phenomena (such as different forms of selection).