ibdEstimate | R Documentation |
Estimate the IBD coefficients \kappa = (\kappa_0, \kappa_1,
\kappa_2)
or the condensed identity coefficients \Delta =
(\Delta_1, ..., \Delta_9)
between a pair (or several pairs)
of pedigree members, using maximum likelihood methods. Estimates of
\kappa
may be visualised with showInTriangle()
.
ibdEstimate(
x,
ids = typedMembers(x),
param = c("kappa", "delta"),
markers = NULL,
start = NULL,
tol = sqrt(.Machine$double.eps),
beta = 0.5,
sigma = 0.5,
contourPlot = FALSE,
levels = NULL,
maxval = FALSE,
verbose = TRUE
)
x |
A |
ids |
Either a vector with ID labels, or a data frame/matrix with two
columns, each row indicating a pair of individuals. The entries are coerced
to characters, and must match uniquely against the ID labels of |
param |
Either "kappa" (default) or "delta"; indicating which set of coefficients should be estimated. |
markers |
A vector with names or indices of markers attached to x, indicating which markers to include. By default, all markers are used. |
start |
A probability vector (i.e., with nonnegative entries and sum 1)
of length 3 (if |
tol , beta , sigma |
Control parameters for the optimisation routine; can usually be left untouched. |
contourPlot |
A logical. If TRUE, contours of the log-likelihood function are plotted overlaying the IBD triangle. |
levels |
(Only relevant if |
maxval |
A logical. If TRUE, the maximum log-likelihood value is included in the output. Default: FALSE |
verbose |
A logical. |
It should be noted that this procedure estimates the realised identity coefficients of each pair, i.e., the actual fractions of the autosomes in each IBD state. These may deviate substantially from the theoretical pedigree coefficients.
Maximum likelihood estimation of relatedness coefficients originates with
Thompson (1975). Optimisation of \kappa
is done in the (\kappa_0,
\kappa_2)
-plane and restricted to the triangle defined by
\kappa_0 \ge 0, \kappa_2 \ge 0, \kappa_0 + \kappa_2 \le 1
Optimisation of \Delta
is done in unit simplex of R^8
, using the
first 8 coefficients.
The implementation optimises the log-likelihood using a projected gradient descent algorithm, combined with a version of Armijo line search.
When param = "kappa"
, the output may be fed directly to showInTriangle()
for visualisation.
An object of class ibdEst
, which is basically a data frame with
either 6 columns (if param = "kappa"
) or 12 columns (if param = "delta"
). The first three columns are id1
(label of first individual),
id2
(label of second individual) and N
(the number of markers with no
missing alleles). The remaining columns contain the coefficient estimates.
If maxval = T
, a column named maxloglik
is added at the end.
Magnus Dehli Vigeland
E. A. Thompson (1975). The estimation of pairwise relationships. Annals of Human Genetics 39.
E. A. Thompson (2000). Statistical Inference from Genetic Data on Pedigrees. NSF-CBMS Regional Conference Series in Probability and Statistics. Volume 6.
ibdBootstrap()
### Example 1: Siblings
# Create pedigree and simulate 100 markers
x = nuclearPed(2) |> markerSim(N = 100, alleles = 1:4, seed = 123)
x
# Estimate kappa (expectation: (0.25, 0.5, 0.25)
k = ibdEstimate(x, ids = 3:4)
k
# Visualise estimate
showInTriangle(k, labels = TRUE)
# Contour plot of the log-likelihood function
ibdEstimate(x, ids = 3:4, contourPlot = TRUE)
### Example 2: Full sib mating
y = fullSibMating(1) |>
markerSim(ids = 5:6, N = 1000, alleles = 1:10, seed = 123)
# Estimate
ibdEstimate(y, param = "delta")
# Exact coefficient by `ribd`:
ribd::condensedIdentity(y, 5:6, simplify = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.