| parentChildLikelihood | R Documentation |
Fast likelihood computation of pedigrees in which the only genotyped
individuals are a (noninbred) parent and their (possibly inbred) child. In
this case the pedigree information is fully captured by the inbreeding
coefficient f of the child, enabling efficient calculations by
vectorising over the markers.
parentChildLikelihood(x, parent = NULL, child = NULL, f = NULL, check = TRUE)
x |
A |
parent |
ID of parent; identified automatically if missing. |
child |
ID of child; identified automatically if missing. |
f |
Inbreeding coefficient of child, calculated with
|
check |
A logical indicating whether to check parent and child in |
A numeric vector with per-marker likelihoods P(parent & child genotypes | f).
db = NorwegianFrequencies[1:10]
# Simulate genotypes for a child of first cousins, and his mother
x = cousinPed(1, child = TRUE) |> profileSim(ids = 8:9, markers = db)
plot(x, hatched = typedMembers)
liks = parentChildLikelihood(x)
# Compare with standard likelihood calculation, requiring loop breaking etc.
stopifnot(all.equal(liks, pedprobr::likelihood(x)))
# bench::mark(parentChildLikelihood(x), pedprobr::likelihood(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.