Documentation for SLiM function calcPairHeterozygosity, which is a method of the SLiM class SLiMBuiltin. Note that the R function is a stub, it does not do anything in R (except bring up this documentation). It will only do anything useful when used inside a slim_block function further nested in a slim_script function call, where it will be translated into valid SLiM code as part of a full SLiM script.

calcPairHeterozygosity(genome1, genome2, start, end, infiniteSites)

Arguments

genome1

An object of type Genome object. Must be of length 1 (a singleton). See details for description.

genome2

An object of type Genome object. Must be of length 1 (a singleton). See details for description.

start

An object of type null or integer. Must be of length 1 (a singleton). The default value is NULL. See details for description.

end

An object of type null or integer. Must be of length 1 (a singleton). The default value is NULL. See details for description.

infiniteSites

An object of type logical. Must be of length 1 (a singleton). The default value is T. See details for description.

Value

An object of type float. Return will be of length 1 (a singleton)

Details

Documentation for this function can be found in the official SLiM manual: page 752.

Calculates the heterozygosity for a pair of genomes; these will typically be the two genomes of a diploid individual (individual.genome1 and individual.genome2), but any two genomes may be supplied. The calculation can be narrowed to apply to only a window - a subrange of the full chromosome - by passing the interval bounds [start, end] for the desired window. In this case, the vector of mutations used for the calculation will be subset to include only mutations within the specified window. The default behavior, with start and end of NULL, provides the genome-wide heterozygosity. The implementation calcPairHeterozygosity(), viewable with functionSource(), treats every mutation as independent in the heterozygosity calculations by default (i.e., with infiniteSites=T). If mutations are stacked, the heterozygosity calculated therefore depends upon the number of unshared mutations, not the number of differing sites. Similarly, if multiple Mutation objects exist in different genomes at the same site (whether representing different genetic states, or multiple mutational lineages for the same genetic state), each Mutation object is treated separately for purposes of the heterozygosity calculation, just as if they were at different sites. One could regard these choices as embodying an infinite-sites interpretation of the segregating mutations. In most biologically realistic models, such genetic states will be quite rare, and so the impact of this choice will be negligible; however, in some models this distinction may be important. The behavior of calcPairHeterozygosity() can be switched to calculate based upon the number of differing sites, rather than the number of unshared mutations, by passing infiniteSites=F.

Author

Benjamin C Haller (bhaller@benhaller.com) and Philipp W Messer (messer@cornell.edu)

Examples

## This just brings up the documentation:
calcPairHeterozygosity()