Introduction

In Chapter 4, Population Genetics, we used Python to analyze population genetics datasets based on real data. In this chapter, we will look at how we can use Python to simulate population genetics data. From teaching, to developing new statistical methods, to analyzing the performance of existing methods, simulated datasets have plenty of applications.

There are two kinds of simulation: one is the coalescent, going backward in time, while the second is forward-time simulation. Coalescent simulation is computationally less expensive because only the most recent generation of individuals needs to be completely rendered; previous generations only need parents of the next generation to be maintained. On the other hand, this severely ...

Get Bioinformatics with Python Cookbook - Second Edition 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.