LD_computation: LD_computation

View source: R/fct_LD_computation.R

LD_computationR Documentation

LD_computation

Description

Calculate linkage disequilibrium (LD) between a set of markers

Usage

LD_computation(
  geno,
  map,
  pop_ind = NULL,
  max_g_dist = 30,
  chr_sel = 1,
  prop_mk_comb = 1
)

Arguments

geno

Numeric genotype marker matrix coded in 0, 1, 2 representing the number of allele copies of one allele (e.g. second parent, minor allele). Genotypes in row and markers in column. The column (marker) name should be identical to the first column of the map (marker indicators). Can be obtrained with sim_mpp_cross

map

data.frame representing the marker map information with the following columns: 1) character marker identifier; 2) numeric chromosomes (1, 2, 3, ...); 3) numeric genetic distance in cM; 4) numeric Optional physical distance in bp.

pop_ind

Optional population indicator Character vector indicating to which (sup)population each genotype belongs. Default = NULL

max_g_dist

Numeric value between 0 and 1 indicating the proportion of marker pairs selected to calculate the LD. Default = 1

Value

data.frame with marker i and j position, genetic distance (physical distance) beteen markers and LD

Examples


data("geno_par")
rownames(geno_par) <- paste0('P', 1:nrow(geno_par))

data("EUNAM_map")
rownames(map) <- map[, 1]

# NAM crossing scheme with 3 parents
cross_scheme <- cross_scheme_NAM(3)

geno <- sim_mpp_cross(geno_par = geno_par, map = map,
                     cross_scheme = cross_scheme,
                     n_ind_cr = c(100, 100),
                     geno_score_format = "numeric_IBD")

cr_ind <- substr(x = rownames(geno), start = 1, stop = 3)

LD_chr1 <- LD_computation(geno = geno, map = map, pop_ind = cr_ind,
                         max_g_dist = 40, chr_sel = 1, prop_mk_comb = 1)



vincentgarin/mppSim documentation built on Oct. 11, 2024, 3:18 p.m.