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

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.

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.

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

Examples

# 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)

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.