View source: R/twoLocusIdentity.R
twoLocusIdentity | R Documentation |
Computes the 9*9 matrix of two-locus condensed identity coefficients of a pair of pedigree members, for a given recombination rate.
twoLocusIdentity(x, ids, rho, coefs = NULL, detailed = FALSE, verbose = FALSE)
x |
A pedigree in the form of a |
ids |
A character (or coercible to character) containing ID labels of two pedigree members. |
rho |
A number in the interval |
coefs |
A character indicating which coefficient(s) to compute. A subset
of |
detailed |
A logical, indicating whether the condensed (default) or detailed coefficients should be returned. |
verbose |
A logical. |
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).
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.
Jacquard (1974). The Genetic Structure of Populations. Springer.
Vigeland (2022) Two-locus identity coefficients in pedigrees (In progress)
twoLocusIBD()
, identityCoefs()
### 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.