identityCoefs {ribd}R Documentation

Omnibus function for identity coefficients

Description

This function calculates the pairwise identity coefficients described by Jacquard (1974). Unlike the previous condensedIdentity() (which will continue to exist), this function also computes the 15 detailed identity coefficients. The implementation supports pedigrees with inbred founders, and X-chromosomal coefficients.

Usage

identityCoefs(
  x,
  ids = labels(x),
  detailed = FALSE,
  Xchrom = FALSE,
  self = FALSE,
  simplify = TRUE,
  method = c("auto", "K", "WL", "LS", "GC", "idcoefs", "identity", "merlin"),
  verbose = FALSE,
  ...
)

detailed2condensed(d)

Arguments

x

A pedigree in the form of a pedtools::ped object.

ids

A vector of two ID labels.

detailed

A logical. If FALSE (default), the 9 condensed coefficients are computed; otherwise the 15 detailed identity coefficients.

Xchrom

A logical, by default FALSE.

self

A logical indicating if self-relationships (i.e., between a pedigree member and itself) should be included. FALSE by default.

simplify

Simplify the output (to a numeric of length 9) if ids has length 2. Default: TRUE.

method

Either "auto", "K", "WL", "LS", "GC", "idcoefs", "identity" or "merlin". By default ("auto") a suitable algorithm is chosen automatically.

verbose

A logical.

...

Further arguments.

d

Either a numeric vector of length 15, or a data frame with 17 columns.

Details

Both the condensed and detailed coefficients are given in the orders used by Jacquard (1974). The function detailed2condensed() converts from detailed coefficients (d1, ..., d15) to condensed ones (D1, ..., D9) using the following relations:

Algorithms for computing identity coefficients

The following is a brief overview of various algorithms for computing (single-locus) condensed and/or detailed identity coefficients. This topic is closely linked to that of generalised kinship coefficients, which is further described in the documentation of gKinship().

For each algorithm below, it is indicated in brackets how to enforce it in identityCoefs().

Value

A data frame with L + 2 columns, where L is either 9 or 15 (if detailed = TRUE).

If simplify = TRUE and length(ids) = 2: A numeric vector of length L.

References

See Also

condensedIdentity(), gKinship()

Examples

x = fullSibMating(1)

### Condensed coefficients
j1 = identityCoefs(x, method = "K")
j2 = identityCoefs(x, method = "WL")
j3 = identityCoefs(x, method = "LS")
j4 = identityCoefs(x, method = "GC")
j5 = condensedIdentity(x, ids = 1:6) # legacy version

stopifnot(all.equal(j1,j2), all.equal(j1,j3), all.equal(j1,j4), all.equal(j1,j5))

### Detailed coefficients
jdet1 = identityCoefs(x, detailed = TRUE, method = "LS")
jdet2 = identityCoefs(x, detailed = TRUE, method = "GC")

stopifnot(all.equal(jdet1,jdet2))

### X-chromosomal coefficients
jx1 = identityCoefs(x, Xchrom = TRUE, method = "K")
jx2 = identityCoefs(x, Xchrom = TRUE, method = "GC")
jx3 = condensedIdentityX(x, ids = 1:6)  # legacy version

stopifnot(all.equal(jx1,jx2), all.equal(jx1,jx3))

### Detailed X-chromosomal coefficients
jdx = identityCoefs(x, detailed = TRUE, Xchrom = TRUE, method = "GC")

stopifnot(all.equal(detailed2condensed(jdx), jx1))


[Package ribd version 1.7.0 Index]