Chapter 5. Population Genetics Simulation

In this chapter, we will cover the following recipes:

  • Introducing forward-time simulations
  • Simulating selection
  • Simulating population structure using island and stepping-stone models
  • Modeling complex demographic scenarios
  • Simulating the coalescent with Biopython and fastsimcoal

Introduction

In the previous chapter, we used Python to analyze population genetics datasets based on real data. In this chapter, we will see how to use Python to simulate population genetics data. From teaching to developing new statistical methods or to analyze the performance of existing methods, simulated datasets have plenty of applications.

There are two kinds of simulation. One is coalescent simulation that goes backwards in time. ...

Get Bioinformatics with Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.