sumstat_tajimas_d: Summary Statistic: Tajima's D

View source: R/sumstat_tajimas_d.R

sumstat_tajimas_dR Documentation

Summary Statistic: Tajima's D


This statistic calculates Tajima's D from the simulation results when added to a model. Tajima's D primarily measures an deviation of singletons from the neutral expectation of an equilibrium model. Negative values indicate an excess of singletons, while positive values code a depletion of them.


  name = "tajimas_d",
  population = "all",
  transformation = identity



The name of the summary statistic. When simulating a model, the value of the statistics are written to an entry of the returned list with this name. Summary statistic names must be unique in a model.


The population for which the statistic is calculated. Can also be "all" to calculate it from all populations. Default is population 1.


An optional function for transforming the results of the statistic. If specified, the results of the transformation are returned instead of the original values.


On simulation, this returns a vector with the value of Tajima's D for each locus.


Tajima, F. (1989). "Statistical method for testing the neutral mutation hypothesis by DNA polymorphism.". Genetics 123 (3): 585-95.

See Also

To create a demographic model: coal_model

To calculate this statistic from data: calc_sumstats_from_data

Other summary statistics: sumstat_dna(), sumstat_file(), sumstat_four_gamete(), sumstat_ihh(), sumstat_jsfs(), sumstat_mcmf(), sumstat_nucleotide_div(), sumstat_omega(), sumstat_seg_sites(), sumstat_sfs(), sumstat_trees()


# A neutral model that should yield values close to zero:
model <- coal_model(5, 2) +
  feat_mutation(20) +
  feat_recombination(10) +
stats <- simulate(model)

coala documentation built on May 29, 2024, 11:14 a.m.