View source: R/sumstat_seg_sites.R
| sumstat_seg_sites | R Documentation |
This summary statistics generates a matrix of segregating sites. This is useful for calculating summary statistics that coala does not support..
sumstat_seg_sites(name = "seg_sites", transformation = identity)
name |
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. |
transformation |
An optional function for transforming the results of the statistic. If specified, the results of the transformation are returned instead of the original values. |
A list of segsites objects.
These can be treated as a matrix for
most applications. Rows are individuals, columns are SNPs.
For a description of the segregating sites class: create_segsites
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_sfs(),
sumstat_tajimas_d(),
sumstat_trees()
model <- coal_model(5, 1) +
feat_mutation(5) +
sumstat_seg_sites("segsites")
stats <- simulate(model)
print(stats$segsites)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.