twoLocusIdentity: Two-locus identity coefficients

View source: R/twoLocusIdentity.R

twoLocusIdentityR Documentation

Two-locus identity coefficients

Description

Computes the 9*9 matrix of two-locus condensed identity coefficients of a pair of pedigree members, for a given recombination rate.

Usage

twoLocusIdentity(x, ids, rho, coefs = NULL, detailed = FALSE, verbose = FALSE)

Arguments

x

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

ids

A character (or coercible to character) containing ID labels of two pedigree members.

rho

A number in the interval [0, 0.5]; the recombination rate between the two loci.

coefs

A character indicating which coefficient(s) to compute. A subset of c('D00', 'D01', ..., 'D99'). By default, all coefficients are computed.

detailed

A logical, indicating whether the condensed (default) or detailed coefficients should be returned.

verbose

A logical.

Details

Let A, B be two pedigree members, and L1, L2 two loci with a given recombination rate \rho. The two-locus identity coefficient \Delta_{i,j}(\rho), for 1 \le i,j \le 9 is defined as the probability that the identity state of the alleles of A and B are \Sigma_i at L1 and \Sigma_j at L2 simultaneously. (The ordering of the 9 states follows Jacquard (1974).)

For details about the algorithm, see Vigeland (2022).

Value

By default, a symmetric 9*9 matrix containing the two-locus condensed identity coefficients \Delta_{i,j}.

If either coefs is explicitly given (i.e., not NULL), or detailed = TRUE, the computed coefficients are returned as a named vector.

References

  • Jacquard (1974). The Genetic Structure of Populations. Springer.

  • Vigeland (2022) Two-locus identity coefficients in pedigrees (In progress)

See Also

twoLocusIBD(), identityCoefs()

Examples

### Full sibs ###
x = nuclearPed(2)
kapp = twoLocusIBD(x, ids = 3:4, rho = 0.25)
jacq = twoLocusIdentity(x, ids = 3:4, rho = 0.25)

stopifnot(all.equal(jacq[9:7,9:7], kapp, check.attributes = FALSE))

### Parent-child ###
x = nuclearPed(1)
jacq = twoLocusIdentity(x, ids = c(1,3), rho = 0.25)

stopifnot(jacq[8,8] == 1)

### Full sib mating ###
x = fullSibMating(1)
j = condensedIdentity(x, ids = 5:6)
j2 = twoLocusIdentity(x, ids = 5:6, rho = 0.25)

stopifnot(identical(unname(rowSums(j2)), j))



ribd documentation built on Aug. 10, 2023, 5:08 p.m.