sumstat_mcmf {coala} | R Documentation |
Summary Statistic: Most Common Mutation's Frequency
Description
This summary statistic calculates the observed frequency of the mutational pattern that is observed most often in the data.
Usage
sumstat_mcmf(
name = "mcmf",
population = 1,
transformation = identity,
expand_mcmf = FALSE,
type_expand = 1
)
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. |
population |
The population for which the statistic is calculated. Can also be "all" to calculate it from all populations. |
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. |
expand_mcmf |
Whether to use or not the expanded MCMF. See Details |
type_expand |
Specifies the type of expanded MCMF to be used. See Details |
Details
The expand_mcmf = FALSE calculates the mcmf per locus and returns a vector. The expand_mcmf = TRUE and type_expand = 1 returns the same results as the first column of a Matrix. The expand_mcmf = TRUE and type_expand = 2 adds the frequency of derived alleles in the most frequently observed mutational pattern as a second column. The expand_mcmf = TRUE and type_expand = 3 adds the percentage of positions that are polymorpic. When expanded_mcmf = TRUE results are returned as a matrix.
Value
A numeric vector or matrix containing MCMF for each locus.
- mcmf
The observed frequency of the mutational pattern that is observed most often in the data.
- bal
The frequency of derived alleles in the most frequently observed mutational pattern.
- perc_poly
The percentage of positions that are polymorpic.
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_nucleotide_div()
,
sumstat_omega()
,
sumstat_seg_sites()
,
sumstat_sfs()
,
sumstat_tajimas_d()
,
sumstat_trees()
Examples
# Calculate MCMF for a panmictic population
model <- coal_model(10, 2) +
feat_mutation(50) +
sumstat_mcmf()
simulate(model)