calculate_LD: Calculate linkage disequilibrium statistics This function...

Description Usage Arguments Value Examples

Description

Calculate linkage disequilibrium statistics This function calculates two matrices, once containing all pairwise linkage disequilibrium (ld) values, and one matrix containing all pairwise r statistics

Usage

1
2
calculate_ld(pop, sampled_individuals = 10, number_of_markers = 100,
  random_markers = TRUE)

Arguments

pop

focal population

sampled_individuals

Number of individuals randomly sampled to calculate the LD matrices

number_of_markers

Number of markers used to calculate the ld matrices

random_markers

If TRUE, markers are randomly spaced along the chromosome, if FALSE, markers are equidistantly spaced along the chromosome.

Value

An object containing two items:

ld_matrix

Pairwise ld statistics for all markers

rsq_matrix

Pairwise rsq statistics for all markers

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
wildpop =  simulate_admixture(pop_size = 100,
number_of_founders = 10,
total_runtime = 100,
morgan = 1,
seed = 42)

ld_results <- calculate_ld(wildpop,
                           number_of_markers = 10,
                           random_markers = TRUE)

plot(ld_results$ld_matrix~ld_results$dist_matrix,
     pch = 16,
     xlab="Distance between markers",
     ylab = "Linkage Disequilibrium")

thijsjanzen/GenomeAdmixR documentation built on Oct. 20, 2019, 6:06 a.m.