Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

twoLocusIdentity

Two-locus identity coefficients


Description

Computes the 9*9 matrix of two-locus condensed identity coefficients of a pair of pedigree members, for a given recombination rate.

Usage

twoLocusIdentity(x, ids, rho, coefs = NULL, detailed = FALSE, verbose = FALSE)

Arguments

x

A pedigree in the form of a pedtools::ped object.

ids

A character (or coercible to character) containing ID labels of two pedigree members.

rho

A number in the interval [0, 0.5]; the recombination rate between the two loci.

coefs

A character indicating which coefficient(s) to compute. A subset of c('d00', 'd01', ..., 'd99'). By default, all coefficients are computed.

detailed

A logical, indicating whether the condensed (default) or detailed coefficients should be returned.

verbose

A logical.

Details

Let A, B be two pedigree members, and L1, L2 two loci with a given recombination rate ρ. The two-locus identity coefficients Δ_ij(ρ), for 1 ≤ i,j ≤ 9 are defined as the probability that the identity state of the alleles of A and B are Σ_i at L1 and Σ_j at L2 simultaneously. (The ordering of the 9 states follows Jacquard (1974).)

For details about the algorithm, see Vigeland (2019).

Value

By default, a symmetric 9*9 matrix containing the two-locus condensed identity coefficients Δ_ij.

If either coefs is explicitly given (i.e., not NULL), or detailed = TRUE, the computed coefficients are returned as a named vector.

References

M. D. Vigeland (2019) A recursive algorithm for two-locus identity coefficients (In progress)

See Also

Examples

### Full sibs ###
x = nuclearPed(2)
kapp = twoLocusIBD(x, ids = 3:4, rho = 0.25)
jacq = twoLocusIdentity(x, ids = 3:4, rho = 0.25)
stopifnot(all.equal(jacq[9:7,9:7], kapp, check.attributes = FALSE))

#' ### Parent-child ###
x = nuclearPed(1)
jacq = twoLocusIdentity(x, ids = c(1,3), rho = 0.25)
stopifnot(jacq[8,8] == 1)

### Full sib mating ###
x = fullSibMating(1)
j = condensedIdentity(x, ids = 5:6)
j2 = twoLocusIdentity(x, ids = 5:6, rho = 0.25)
stopifnot(identical(unname(rowSums(j2)), j))

ribd

Pedigree-based Relatedness Coefficients

v1.2.0
GPL-3
Authors
Magnus Dehli Vigeland [aut, cre] (<https://orcid.org/0000-0002-9134-4962>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.