sumstat_seg_sites {coala}R Documentation

Summary Statistic: Segregating Sites

Description

This summary statistics generates a matrix of segregating sites. This is useful for calculating summary statistics that coala does not support..

Usage

sumstat_seg_sites(name = "seg_sites", transformation = identity)

Arguments

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.

Value

A list of segsites objects. These can be treated as a matrix for most applications. Rows are individuals, columns are SNPs.

See Also

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()

Examples

model <- coal_model(5, 1) +
  feat_mutation(5) +
  sumstat_seg_sites("segsites")
stats <- simulate(model)
print(stats$segsites)

[Package coala version 0.7.2 Index]