plotLd: Pairwise linkage disequilibrium

View source: R/quantgen.R

plotLdR Documentation

Pairwise linkage disequilibrium

Description

Plots the linkage disequilibrium between pairs of SNPs, as a blue density or black points, with a red loess. Possibility to add two analytical approximations of E[r^2] at equilibrium (see McVean, Handbook of Stat Gen, 2007): 1 / (1 + 4 Ne c x) by Sved (1971) and (10 + 4 Ne c x) / (22 + 13 * 4 Ne c x + (4 Ne c x)^2) by Ohta and Kimura (1971).

Usage

plotLd(
  x,
  y,
  main = "",
  estim = "r2",
  use.density = TRUE,
  xlab = "Physical distance (bp)",
  ylab = paste0("Linkage disequilibrium (", estim, ")"),
  span = 1/10,
  degree = 1,
  evaluation = 50,
  sample.size = NULL,
  add.ohta.kimura = FALSE,
  add.sved = FALSE,
  Ne = NULL,
  c = NULL,
  xlim
)

Arguments

x

vector of distances between SNPs (see distSnpPairs)

y

vector of LD estimates (see estimLd)

main

main title

estim

estimator of pairwise LD corresponding to the values in y (r2/r)

use.density

if TRUE, uses smoothScatter; otherwise, use scatter.smooth

xlab

label for the x axis

ylab

label for the y axis

span

the parameter alpha which controls the degree of smoothing (see loess)

degree

the degree of the polynomials to be used (see loess)

evaluation

number of points at which to evaluate the smooth curve (see loess.smooth)

sample.size

nb of sampled haplotypes, n, used to estimate the pairwise LD; if not NULL, n is used to plot the horizontal line at the r value above which the null hypothesis "D=0" is rejected, where r = D / sqrt(f_A f_a f_B f_b) and X^2 = n r^2 is the test statistic asymptotically following a Chi2(df=1) (see McVean, Handbook of Statistical Genetics, 2007, and Pritchard and Przewoski, AJHG, 2001)

add.ohta.kimura

add the analytical approximation by Ohta and Kimura (1971); requires Ne and c

add.sved

add the analytical approximation by Sved (1971); requires Ne and c

Ne

effective population size

c

recomb rate in events per base per generation

xlim

numeric vector of length 2 specifying the x-axis limit (optional)

Value

invisible list

Author(s)

Timothee Flutre

See Also

estimLd, distSnpPairs


timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.