View source: R/condensedIdentity.R
condensedIdentity | R Documentation |
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.
condensedIdentity(
x,
ids,
sparse = NA,
simplify = TRUE,
self = FALSE,
verbose = FALSE
)
x |
A pedigree in the form of a |
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. |
simplify |
Simplify the output (to a numeric of length 9) if |
self |
A logical indicating if self-relationships (i.e., between a pedigree member and itself) should be included. FALSE by default. |
verbose |
A logical |
The implementation is a modified version of Karigl's recursive algorithm (1981).
If ids
has length 2 and simplify = TRUE
: A vector of length 9,
containing the condensed identity coefficients.
Otherwise, a data frame with 11 columns and one row for each pair of individuals. The first two columns contain the ID labels, and columns 3-11 contain the condensed identity coefficients.
G. Karigl (1981). A recursive algorithm for the calculation of identity coefficients. Annals of Human Genetics, vol. 45.
kappa()
, identityCoefs()
, pedtools::founderInbreeding()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.