kinship: Kinship coefficients

View source: R/kinship.R

kinshipR Documentation

Kinship coefficients

Description

Compute the matrix of kinship coefficients of all members of a pedigree. Both autosomal and X-chromosomal versions are supported. The pedigree founders are allowed to be inbred; see pedtools::founderInbreeding() for how to set this up, and see Examples below.

Usage

kinship(x, ids = NULL, Xchrom = FALSE)

kinshipX(x, ids = NULL)

Arguments

x

A ped object or a list of such.

ids

Either NULL (default), or a vector of length 2, containing the IDs of two (possibly equal) members of x.

Xchrom

A logical, indicating if the autosomal (default) or X-chromosomal kinship coefficients should be computed.

Details

For two (possibly equal) members A, B of a pedigree, their autosomal (resp. X-chromosomal) kinship coefficient is defined as the probability that a random allele from A and a random allele from B, sampled at the same autosomal (resp. X-chromosomal) locus, are identical by descent relative to the pedigree.

Value

If ids = NULL, a symmetric matrix containing all pairwise kinship coefficients in x. If ids has length 2, the function returns a single number.

See Also

inbreeding(), kappa()

Examples

# Kinship coefficients in a nuclear family with two children
x = nuclearPed(2)
kinship(x)

# X chromosomal kinship coefficients in the same family
kinship(x, Xchrom = TRUE)

# Autosomal kinships if the mother is 100% inbred
founderInbreeding(x, 2) = 1
kinship(x)

# Similar for X:
founderInbreeding(x, 2, chromType = "X") = 1
kinship(x, Xchrom = TRUE)

ribd documentation built on Aug. 10, 2023, 5:08 p.m.