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

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.

Details

For non-inbred individuals a and b, their autosomal IBD coefficients (κ0, κ1, κ2) are defined as follows:

κ_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:

  • κ2 = φ_MM * φ_FF + φ_MF * φ_FM

  • κ1 = 4 * φ_ab - 2 * κ2

  • κ0 = 1 - κ1 - κ2

Here φ_MM denotes the kinship coefficient between the mothers of a and b, and so on. If either a or b is a founder, then κ2 = 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 κ2 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 φ, the formulas are:

  • Both male: (κ0, κ1, κ2) = (1-φ, φ, NA)

  • One male, one female: (κ0, κ1, κ2) = (1-2*φ, 2*φ, NA)

  • Two females: As in the autosomal case.

Value

If ids has length 2: A numeric vector of length 3: (κ0, κ1, κ2).

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 κ2 is NA whenever at least one of the two individuals is male.

See Also

Examples

### 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()
ids = 4:5

# Set founder inbreeding
fou = commonAncestors(x, ids) # robust to label change
founderInbreeding(x, fou) = 1

k = kappaIBD(x, ids)
stopifnot(identical(k, c(0, 1, 0)))

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.