Learn R Programming

forrel (version 1.0.0)

IBDestimate: Relatedness estimation

Description

Estimate the pairwise IBD coefficients \((\kappa_0, \kappa_1, \kappa_2)\) for specified pairs of pedigree members, using maximum likelihood methods. The optimisation machinery is imported from the maxLik package.

Usage

IBDestimate(x, ids = NULL, markers = NULL, start = c(0.99, 0.001), tol = 1e-07)

Arguments

x

A ped object or a list of such.

ids

Either a vector with ID labels, or a data frame/matrix with two columns, where each row contains the ID labels of two individuals. The entries are coerced to characters, and must match uniquely against the ID labels of x. If ids is a vector, it is converted to a matrix containing all pairs. By default, all individuals of x are included.

markers

A numeric indicating which marker(s) to include. If NULL (default), all markers are used.

start

Numeric of length 2, indicating the initial value of \((\kappa_0, \kappa_2)\) in the optimisation (passed on to maxLik).

tol

A single numeric: the optimising tolerance value; passed on to maxLik()).

Value

A data frame with 6 columns: ID1, ID2, N (the number of markers with no missing alleles), k0, k1 and k2.

Details

This function optimises the log-likelihood function first described in (Thompson, 1975). Optimisation is done in the \((\kappa_0, \kappa_2)\)-plane and restricted to the probability triangle defined by $$\kappa_0 \ge 0, \kappa_2 \ge 0, \kappa_0 + \kappa_2 \le 1.$$

References

  • 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.

See Also

maxLik::maxLik(), showInTriangle()

Examples

Run this code
# NOT RUN {
### Example 1: Siblings
x = nuclearPed(children = c("sib1", "sib2"))

# Simluate 200 equifrequent SNPs
x = markerSim(x, N = 200, alleles = 1:2, verbose = FALSE)

# Estimate IBD coefficients (exact = (0.25, 0.5, 0.25))
est = IBDestimate(x, ids = c("sib1", "sib2"))
showInTriangle(est, labels = TRUE)

### Example 2: Unrelated singletons
y = list(singleton(1), singleton(2))
y = markerSim(y, N = 200, alleles = 1:2, verbose = FALSE)

IBDestimate(y, ids = 1:2)


# }

Run the code above in your browser using DataLab