Learn R Programming

ribd (version 1.1.0)

twoLocusIdentity: 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.

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.

Details

Let A, B be two pedigree members, and L1, L2 two loci with a given recombination rate \(\rho\). The two-locus identity coefficients \(\Delta_{i,j}(\rho)\), for \(1 \le i,j \le 9\) are 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 (2019).

References

M. D. Vigeland (2019) A recursive algorithm for two-locus identity coefficients (In progress)

See Also

twoLocusIBD()

Examples

Run this code
# NOT RUN {
### 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))


# }

Run the code above in your browser using DataLab