estimLdPerChr: Pairwise linkage disequilibrium

View source: R/quantgen.R

estimLdPerChrR Documentation

Pairwise linkage disequilibrium

Description

Estimates linkage disequilibrium between pairs of SNPs belonging to the same chromosome when the observations are the genotypes of genotypes, not their gametes (i.e. the gametic phases are unknown). When ignoring kinship and population structure, the estimator of Rogers and Huff (Genetics, 2009) can be used. When kinship and/or population structure are controlled for, the estimator of Mangin et al (Heredity, 2012) is used via their LDcorSV package.

Usage

estimLdPerChr(
  X,
  snp.coords,
  K = NULL,
  pops = NULL,
  only.pop = NULL,
  use.ldcorsv = FALSE,
  use.snpStats = FALSE,
  as.cor = FALSE,
  as.symmat = FALSE,
  nb.cores = 1,
  verbose = 1
)

Arguments

X

matrix of bi-allelic SNP genotypes encoded in allele doses in 0,1,2, with genotypes in rows and SNPs in columns; missing values should be encoded as NA

snp.coords

data.frame with SNP identifiers as row names, and two columns, "chr" and "pos"

K

matrix of "kinship" (additive genetic relationships)

pops

vector of characters indicating the population of each genotype

only.pop

identifier of a given population

use.ldcorsv

required if K and/or pops are not NULL; otherwise use the square of cor

use.snpStats

if TRUE, the ld function of the snpStats package is used (see Clayton and Leung, 2007)

as.cor

if TRUE, the square root of the LD estimates is returned

as.symmat

if TRUE, LD values are returned as a symmetric matrix (not with use.ldcorsv set to TRUE)

nb.cores

number of cores to estimate LD for each chromosome in parallel

verbose

verbosity level (0/1)

Value

data frame with at least three columns, "loc1", "loc2" and the LD values

Author(s)

Timothee Flutre

See Also

estimLd, plotLd


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