ld_decay: Evaluation of Linkage Disequilibrium Decay

View source: R/ld_decay.R

ld_decayR Documentation

Evaluation of Linkage Disequilibrium Decay

Description

ld_decay: R function for calculating the effective number of independent markers

Usage

ld_decay(gen = gen, map = map, max_win_snp = 2000,
  max.chr = max.chr, cores = 1, max_r2 = max_r2)

Arguments

gen

Matrix of genotype data. Individuals in rows, genotypes (0, 1, 2) in columns.

map

Dataframe inculding the name for each marker with a corresponding chromosome number and physical position.

max_win_snp

The maximum number of markers in each window. Sets the maximum number of markers allowed per window within a chromosome before estimating the LD. Default is 2000.

max.chr

Chromosomes above this number will be excluded from the analysis.

cores

Numer of cores for using parallelized calculation, Default is 1 for windows machine.

max_r2

the threshold of r^2 to calculate the effective number of independent markers.

Value

cor: Correlation matrix

ch_eff_nmark: The Number of independent marker per chromosome

eff_nmark: The effective number of independent markers

Examples

## Not run: 
library("parallel")
gen         <- Maize_wqs[[4]]
map         <- Maize_wqs[[3]]
Res_ld <- ld_decay (gen=gen, map=map, max_win_snp=2000,
                    max.chr=10, cores=1, max_r2=0.03)

## End(Not run)                     
                    

Ghat documentation built on Dec. 28, 2022, 1:13 a.m.