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

condensedIdentity

Condensed identity coefficients


Description

Computes the 9 condensed identity coefficients of pairwise relationships in a pedigree. Founders of the pedigree may be inbred; use pedtools::founderInbreeding() to set this up.

Usage

condensedIdentity(x, ids, sparse = NA, verbose = FALSE, checkAnswer = verbose)

Arguments

x

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

ids

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

sparse

A positive integer, indicating the pedigree size limit for using sparse arrays (as implemented by the slam package) instead of ordinary arrays.

verbose

A logical

checkAnswer

A logical. If TRUE, and the identity package is installed, the result is checked against the output of identity::identity.coefs(). This option is ignored if any of the founders are inbred, or if ids has length greater than 2.

Details

The implementation is a modified version of Karigl's recursive algorithm (1981).

Value

If ids has length 2: A vector of length 9, containing the condensed identity coefficients.

If ids has length > 2: A data frame with one row for each pair of individuals, and 11 columns. The first two columns contain the ID labels, and columns 3-11 contain the condensed identity coefficients.

References

G. Karigl (1981). A recursive algorithm for the calculation of identity coefficients Annals of Human Genetics, vol. 45.

See Also

Examples

# One generation of full sib mating.
# (One of the simplest examples with all 9 coefficients nonzero.)
x = fullSibMating(1)
j1 = condensedIdentity(x, ids = 5:6)

stopifnot(all.equal(j1, c(2, 1,4, 1, 4, 1, 7, 10, 2)/32))

# Recalculate the coefficients when the founders are 100% inbred
founderInbreeding(x, 1:2) = 1
condensedIdentity(x, ids = 5:6)

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.