gl.report.ld: Calculates pairwise linkage disequilibrium across all loci,...

View source: R/gl.report.ld.r

gl.report.ldR Documentation

Calculates pairwise linkage disequilibrium across all loci, pooled over all individuals

Description

This function calculates pairwise LD for every pair of loci, with all individuals in the dataset pooled (populations are NOT analysed separately; for within-population LD use gl.report.ld.map).

The computation can be spread over multiple cores and, when save = TRUE, intermediate chunks are written to outpath so a crashed run can be restarted where it stopped by rerunning the same command with the same chunkname. Before running the function, it is advisable to use the function gl.filter.allna to remove loci with all missing data.

Usage

gl.report.ld(
  x,
  name = NULL,
  save = TRUE,
  outpath = tempdir(),
  nchunks = 2,
  ncores = 1,
  chunkname = NULL,
  probar = FALSE,
  verbose = NULL
)

Arguments

x

A genlight object containing the SNP data [required].

name

Character string for the rdata file holding the results. If not given, "LDallp" is used [default NULL].

save

Switch if results and intermediate chunks are saved to files [default TRUE].

outpath

Folder where chunks and results are saved (if save=TRUE) [default tempdir()].

nchunks

How many subchunks will be used (the less the faster, but if the routine crashes more bits are lost) [default 2].

ncores

How many cores should be used [default 1].

chunkname

The name of the chunks for saving [default NULL].

probar

if TRUE, a progress bar is displayed for long loops [default FALSE].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, adopting the global verbosity set by gl.set.verbosity(), or 2 if no global is set].

Value

A data frame with pairwise LD statistics (D, D', r, R2, n, X2, p) for every pair of loci, computed over all individuals pooled. (See ?LD in package genetics for details on the statistics.)

Author(s)

Author(s): Bernd Gruber. Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr

See Also

Other matched report: gl.report.allna(), gl.report.callrate(), gl.report.contamination(), gl.report.excess.het(), gl.report.factorloadings(), gl.report.fstat(), gl.report.hamming(), gl.report.heterozygosity(), gl.report.hwe(), gl.report.ld.map(), gl.report.locmetric(), gl.report.maf(), gl.report.overshoot(), gl.report.pa(), gl.report.rdepth(), gl.report.replicates(), gl.report.replicates.KING(), gl.report.reproducibility(), gl.report.secondaries(), gl.report.taglength()


dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.