Coalescence
Simulates a coalescent history for n randomly-selected genes from among the 2*Ne genes in a random-mating population of size Ne. The MRCA is shown as a large, red-filled circle (if it is visible), but note that it will not be visible if it occurs at a time deeper than the T generations shown.
Use the drop-down controls below the plot to change n, Ne, or T The Rewrite History button regenerates the entire history (same as refreshing your browser except that n, Ne, and T do not revert to their default values). the Resample button (or s key) chooses a different random sample of n genes.
The status text at the bottom shows the generation at which the first coalescence event occurred, as well as the generation at which the most recent common ancestor (MRCA) of all sample genes occurs. After changing either n or Ne, each rewrite of history updates the mean time until the first coalescence. If it says “mean NA” (i.e. mean not available), it means that at least one run failed to coalesce at all over T generations, rendering the mean meaningless.
The expected time to the first coalescence is 4Ne/(n(n-1)), so increasing Ne results in longer average coalescence times while increasing n shortens the average coalescence time. The applet reports E[first] as the expected generation at which the first coalescence event happens (i.e. 1 greater than the expected time to coalescence). Note that the standard deviation of coalescence times equals the mean and can be quite large.
Acknowledgements
This applet makes use of the excellent d3js javascript library. Please see the GitHub site for details about licensing of other libraries that may have been used in the source code for this applet.
Licence
Creative Commons Attribution 4.0 International. License (CC BY 4.0). To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.