sumstat_ihh {coala}R Documentation

Summary Statistic: Integrated Extended Haplotype Homozygosity

Description

This summary statistic calculates a number of values based on extended haplotype homozygosity (EHH), including iHH, iES and optionally iHS. Coala relies on scan_hh from package rehh to calculate this statistic. Please refer to their documentation for detailed information on the implementation. Please cite the corresponding publication (see below) if you use the statistic for a publication.

Usage

sumstat_ihh(
  name = "ihh",
  population = 1,
  max_snps = 1000,
  calc_ihs = FALSE,
  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.

population

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

max_snps

The maximal number of SNPs per locus that are used for the calculation. If a locus has more SNPs, only a random subset of them will be used to increase performance. Set to Inf to use all SNPs.

calc_ihs

If set to TRUE, additionally standardized iHS is calculated.

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

If calc_ihs = FALSE, a data.frame with values for iHH and iES is returned. Otherwise, a list of two data frames are returned, one for IHH and IES values and the other one for IHS values.

In all data.frames rows are SNPs and the columns present the following values for each SNP:

References

Author(s)

Paul Staab

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

Examples

  model <- coal_model(20, 1, 1000) +
    feat_mutation(1000) +
    sumstat_ihh()

    stat <- simulate(model)
    print(stat$ihh)

[Package coala version 0.7.2 Index]