Learn R Programming

ribd (version 1.1.0)

kappaIBD: IBD (kappa) coefficients

Description

Computes the three IBD coefficients summarising the relationship between two non-inbred individuals. Both autosomal and X chromosomal versions are implemented.

Usage

kappaIBD(x, ids = labels(x), inbredAction = 1)

kappaIbdX(x, ids, sparse = NA, 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 or more pedigree members.

inbredAction

An integer telling the program what to do if either of the ids individuals are inbred. Possible values are: 0 = do nothing; 1 = print a warning message (default); 2 = raise an error. In the first two cases the coefficients are reported as NA.

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.

Value

If ids has length 2: A numeric vector of length 3: \((\kappa0, \kappa1, \kappa2)\).

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

Unless inbredAction = 2, the coefficients of pairs involving inbred individuals (inbred females in the X version) are reported as NA. Furthermore, the X chromosomal \(\kappa2\) is NA whenever at least one of the two individuals is male.

Details

For non-inbred individuals a and b, their autosomal IBD coefficients \((\kappa0, \kappa1, \kappa2)\) are defined as follows: $$\kappa_i = P(a and b share i alleles IBD at a random autosomal locus)$$

The autosomal kappa coefficients are computed from the kinship coefficients. When a and b are both nonfounders, the following formulas are well-known:

  • \(\kappa2 = \phi_MM * \phi_FF + \phi_MF * \phi_FM\)

  • \(\kappa1 = 4 * \phi_ab - 2 * \kappa2\)

  • \(\kappa0 = 1 - \kappa1 - \kappa2\)

Here \(\phi_MM\) denotes the kinship coefficient between the mothers of a and b, and so on. If either a or b is a founder, then \(\kappa2 = 0\), while the other two formulas remain as above.

The X chromosomal IBD coefficients are defined as in the autosomal case, with the exception that \(\kappa2\) is undefined when at least one of the two individuals is male. Hence the computation is greatly simplified when males are involved. Denoting the standard kinship coefficient by \(\phi\), the formulas are:

  • Both male: \((\kappa0, \kappa1, \kappa2) = (1-\phi, \phi, NA)\)

  • One male, one female: \((\kappa0, \kappa1, \kappa2) = (1-2*\phi, 2*\phi, NA)\)

  • Two females: As in the autosomal case.

See Also

kinship(), condensedIdentity()

Examples

Run this code
# NOT RUN {
# Siblings
x = nuclearPed(2)
k = kappaIBD(x, 3:4)
stopifnot(identical(k, c(.25, .5, .25)))

# Quad half first cousins
x = quadHalfFirstCousins()
k = kappaIBD(x, leaves(x))
stopifnot(identical(k, c(17/32, 14/32, 1/32)))

# Paternal half brothers with 100% inbred father
# Genetically indistinguishable from an (outbred) father-son relationship
x = halfSibPed()
founderInbreeding(x, 1) = 1

k = kappaIBD(x, 4:5)
stopifnot(identical(k, c(0, 1, 0)))

# }

Run the code above in your browser using DataLab