Learn R Programming

ribd (version 1.1.0)

constructPedigree: Pedigree construction

Description

Construct a pedigree yielding a prescribed set of IBD coefficients.

Usage

constructPedigree(kappa, verbose = FALSE)

Arguments

kappa

A probability vector of length 3; \((kappa0, kappa1, kappa2)\).

verbose

A logical. If TRUE, various details about the calculations are printed, as well as a textual description of the resulting relationship.

Value

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

Details

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

References

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

Examples

Run this code
# NOT RUN {
# Full siblings
kap = c(0.25, 0.5, 0.25)
x = constructPedigree(kap)

# Validation
kap2 = kappaIBD(x, leaves(x))
stopifnot(all.equal(kap, kap2))

# For kappa = (0,1,0), the result is not a parent-child relationship,
# but half siblings whose shared parent is completely inbred.
y = constructPedigree(kappa = c(0,1,0))
plot(y)

# }

Run the code above in your browser using DataLab