Welcome to Kingman’s documentation!

This is the documentation for the kingman package. This package is a simple example of how to put together a Python package, using current best practises. See the WTCHG CodeMonkeys post for more details.

Contents:

API Documentation

An example Python package, illustrating current best-practises.

kingman.simulate(sample_size, random_seed=None)

Simulates the Kingman coalescent for the specified sample size and random seed.

Returns a tuple (parent, time) which describes the simulated history of the sample as an oriented forest. parent is a list of integers, in which the parent of node j is parent[j]. time an array of floating point values in which the time at which node j was created is time[j]. See http://jeromekelleher.github.io/ercs/#oriented-trees-and-forests for further information on oriented forests.

Time is measured in units of 4Ne generations, following Hudson’s ms.

Parameters:
  • sample_size (integer) – The sample size; must be >= 2.
  • random_seed (integer or None) – The random seed for simulations
Return type:

(list, list)

Command line interface

This is the documentation for the kingman program, a simple command line interface to the simulations for the Kingman coalescent.

Note

TODO: Find good sphinx based method for documenting a CLI. We should be able to import the command line parser from the kingman package, and generated the documentaion from this.

Indices and tables