Tutorial for dadi

Program download: goto the DADI website
Tutorial material: download DADI_TUTORIAL.ZIP

Dadi is a python module and allows to estimate population genetics model parameters using the site frequency spectrum. It allows to set up a partial derivate equation (PDE) and then solves this numerically and then allows to calculate the Maximum composite likelihood.

It has facilities to generate bootstrap samples (non-parameteric and parametric) to generate a likelihood ratio test.

Our tutorial will discuss the necessary parts of a python program that need to be written if you want to use this method successfully.


  1. how to set up the model
  2. how to get some basic information about the data
  3. how the optimize the model
  4. how to bootstrap a model using ms
  5. how to run a likelihood ratio test


follow Ryan's guide: I will use an editor to show the program and explain details, we will use 'ipython notebook' to run the code, and it also will be handy of you have the manual.pdf open)

To install, and you have a compiler on your computer will be the easiest simply to git clone the directory:

git clone [if your computer does not have 'git' installed, you still can download the package, using this [1] [if you read this tutorial later than September 2015 you may need to figure out whether there is a newer version available]

Once you have the folder on your system:

  1. cd into the folder
  2. read the readme
  3. python install --user (if you are on a system that does not all root access)
  4. copy the tutorial from the class website onto your machine.
  5. cd into the tutorial folder
  6. We will discuss some population models and how to set them up.
  7. I will discuss the program in excruciating detail (and will extend this here, but time is fleeting)
  8. Run the program