kinship: Kinship coefficients

View source: R/kinship.R

kinshipR Documentation

Kinship coefficients

Description

Compute the matrix of pairwise kinship coefficients in 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, simplify = TRUE, Xchrom = FALSE)

Arguments

x

A ped object or a list of such.

ids

Either NULL (default), or a vector of ID labels in x.

simplify

A logical. by default TRUE. See Value.

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

A symmetric N * N matrix, where N is the number of pedigree members, or length(ids) if this is given, containing the pairwise kinship coefficients. If ids has length 2, and simplify = TRUE, 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)

magnusdv/ribd documentation built on March 29, 2024, 5:20 a.m.