LP: Compute linkage phase similarity

Description Usage Arguments Details Value Author(s) Examples

Description

Compute the linkage phase similary between two populations.

Usage

1
2
3
LP(X1, X2, pos, min_dist, max_dist, method = c("correlation",
  "cosine_similarity", "sign_match"), signif_level = 1, is_phased = TRUE,
  any_na = FALSE, check = TRUE)

Arguments

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 signif_level for any population, this pair of loci will be excluded from the computation of linkage phases.

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?

Details

The computation is faster if signif_level = 1 and all pairs are included.

Value

A data.frame with columns min_dist, max_dist, n (number of pairs), and lps (linkage phase similarity coefficient).

Author(s)

Dominik Mueller (dominikmueller64@yahoo.de)

Examples

 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))
)

DominikMueller64/LDtools documentation built on May 6, 2019, 2:51 p.m.