Description Usage Arguments Details Value Author(s) Examples
Compute the linkage phase similary between two populations.
1 2 3 |
X1 |
A numeric matrix. Data for the first population. |
X2 |
A numeric matrix. Data for the second population. |
pos |
An increasingly sorted numeric vector. The positions of the loci. |
min_dist |
A numeric vector. Minimum distances. |
max_dist |
A numeric vector. Maximum distances. |
method |
A string. Method use for computing linkag phase similarities, one of 'correlation', 'cosine_similarity' or 'sign_match'. |
signif_level |
A double. If the chi-square test yields a p-value above
|
is_phased |
A logical. Are the data phased? |
any_na |
A logical. May some genotypes contain missing values? If not, computations are more efficient for phased genotypes. |
check |
A logical. Should checks be performed? |
The computation is faster if signif_level = 1
and all pairs are included.
A data.frame with columns min_dist, max_dist, n (number of pairs), and lps (linkage phase similarity coefficient).
Dominik Mueller (dominikmueller64@yahoo.de)
1 2 3 4 5 6 7 8 9 10 11 12 | data('population', package = 'LDtools')
pos <- map$pos
mid <- nrow(X) %/% 2L
X1 <- X[1L:mid, , drop = FALSE]
X2 <- X[(mid + 1L):nrow(X), , drop = FALSE]
min_dist <- seq(sqrt(.Machine$double.eps), floor(max(pos) / 2), by = 1)
max_dist <- min_dist + 1
dat <- LP(X1, X2, pos, min_dist, max_dist, method = 'correlation')
with(dat,
plot(x = (min_dist + max_dist) / 2, y = lps, type = 'o', ylim = c(0, 1))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.