# sumstat_four_gamete: Summary Statistic: Four-Gamete-Condition In coala: A Framework for Coalescent Simulation

 sumstat_four_gamete R Documentation

## Summary Statistic: Four-Gamete-Condition

### Description

This summary statistic calculates a number of values (see 'Value') related to the Four-Gamete-Condition (see 'Details'). It is sensitive for recombination and particularly useful when estimating recombination rates with jaatha or Approximate Bayesian Computation.

### Usage

``````sumstat_four_gamete(
name = "four_gamete",
population = 1,
transformation = identity,
na.rm = FALSE
)
``````

### 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. Default is population 1. `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. `na.rm` should missing data be ignored? Default is FALSE.

### Details

The Four-Gamete-Condition for two SNPs is violated if all four combinations of derived and ancestral alleles at the SNPs are observed in a gamete/a haplotype. Under an Infinite-Sites mutation model, a violation indicates that there must have been at least one recombination event between the SNPs.

### Value

The statistic generates a matrix where each row represents one locus, and the columns give the statistic for different classes of pairs of SNPs:

mid_near

The value for all pairs of SNPs that are close together, that is within 10 percent of the locus" length. If locus trios are used, only pairs of SNPs were both SNPs are on the middle locus are considered.

mid_far

Same as `mid_near`, but for pairs of SNPs that are more that 10 percent of the locus" length apart.

outer

Only when using locus trios. The statistic for pairs where both SNPs are on the same outer locus.

between

Only when using locus trios. The statistic for pairs where one SNPs is on the middle locus, and the other is on an outer one.

mid

The value for all pairs on the middle locus or all pairs when not using trios.

perc_polym

The percentage of positions that are polymorpic.

### Unphased Data

For unphased data, the four gamete condition is only counted as violated if it is violated for all possible phasing of the data.

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_ihh()`, `sumstat_jsfs()`, `sumstat_mcmf()`, `sumstat_nucleotide_div()`, `sumstat_omega()`, `sumstat_seg_sites()`, `sumstat_sfs()`, `sumstat_tajimas_d()`, `sumstat_trees()`

### Examples

``````model <- coal_model(5, 2) +
feat_mutation(50) +
feat_recombination(10) +
sumstat_four_gamete()
stats <- simulate(model)
print(stats\$four_gamete)
``````

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