### Siblings
x = nuclearPed(2)
kappaIBD(x)
k = kappaIBD(x, 3:4)
stopifnot(identical(k, c(.25, .5, .25)))
### Quad half first cousins
x = quadHalfFirstCousins()
k = kappaIBD(x, ids = leaves(x))
stopifnot(identical(k, c(17/32, 14/32, 1/32)))
### Paternal half brothers with 100% inbred father
# Genetically indistinguishable from an (outbred) father-son relationship
x = halfSibPed() |> setFounderInbreeding(ids = 2, value = 1)
plot(x, hatched = 4:5)
k = kappaIBD(x, 4:5)
stopifnot(identical(k, c(0, 1, 0)))
### X-chromosomal kappa
y = nuclearPed(2, sex = 2)
kappaIBD(y, Xchrom = TRUE)
Run the code above in your browser using DataLab