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

constructPedigree

Pedigree construction


Description

Construct a pedigree yielding a prescribed set of IBD coefficients.

Usage

constructPedigree(kappa, describe = TRUE, verbose = FALSE)

Arguments

kappa

A probability vector of length 3; (κ_0, κ_1, κ_2).

describe

A logical. If TRUE, a textual description of the resulting relationship is printed.

verbose

A logical. If TRUE, various details about the calculations are printed.

Details

The construction follows the method and formulae given in Vigeland (2020).

Value

A ped object containing a pair of double half cousins with inbred founders. (In corner cases the relationship collapses into siblings.)

References

M. D. Vigeland (2020). Relatedness coefficients in pedigrees with inbred founders. Journal of mathematical biology. doi: 10.1007/s00285-020-01505-x

Examples

# Full siblings
x = constructPedigree(kappa = c(0.25, 0.5, 0.25))
kappaIBD(x, leaves(x))

# A relationship halfway between parent-child and full sibs
kap = c(1/8, 6/8, 1/8)
showInTriangle(kap, label = " (1/8, 1/8)", pos = 4)

y = constructPedigree(kappa = kap)
plot(y)

stopifnot(all.equal(kappaIBD(y, leaves(y)), kap))

# kappa = (0,1,0) does not give a parent-child relationship,
# but half siblings whose shared parent is completely inbred.
z = constructPedigree(kappa = c(0,1,0))
plot(z)

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.