calculate_ld {GenomeAdmixR} | R Documentation |
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
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
calculate_ld(pop, sampled_individuals = 10, markers = NA, verbose = FALSE)
Arguments
pop |
focal population |
sampled_individuals |
Number of individuals randomly sampled to calculate the LD matrices |
markers |
vector of markers. If a single number is used, that number of markers is randomly placed along the genome. |
verbose |
display verbose output, default is FALSE. |
Value
An object containing two items:
ld_matrix |
Pairwise ld statistics for all markers |
rsq_matrix |
Pairwise rsq statistics for all markers |
Examples
wildpop = simulate_admixture(
module = ancestry_module(number_of_founders = 10, morgan = 1),
pop_size = 1000,
total_runtime = 10)
ld_results <- calculate_ld(pop = wildpop,
markers = 10)
plot(ld_results$ld_matrix~ld_results$dist_matrix,
pch = 16,
xlab="Distance between markers",
ylab = "Linkage Disequilibrium")
[Package GenomeAdmixR version 2.1.7 Index]