Learn R Programming

ribd (version 1.1.0)

kinship: Kinship coefficients

Description

Compute the matrix of kinship coefficients (autosomal or X) of all members of a pedigree. The founders may be inbred; see pedtools::founderInbreeding() for how to set this up.

Usage

kinship(x, ids = NULL)

kinshipX(x, ids = NULL)

Arguments

x

A pedigree, in the form of a pedtools::ped object.

ids

Either a character of length 2, or NULL. In the former case, it must contain the ID labels of two members of x, and the function will return their kinship coefficient as a single number. If ids is NULL (this is the default), the output is the complete kinship matrix.

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.

Details

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

See Also

inbreeding(), kappa()

Examples

Run this code
# NOT RUN {
# Kinship coefficients in a nuclear family with two children
x = nuclearPed(2)
kinship(x)

# X chromosomal kinship coefficients in the same family
kinshipX(x)

# Recalculate the autosomal kinships if the father is 100% inbred
founderInbreeding(x, 1) = 1
kinship(x)

# }

Run the code above in your browser using DataLab