calculate_ld | 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
calculate_ld(pop, sampled_individuals = 10, markers = NA, verbose = FALSE)
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. |
An object containing two items:
ld_matrix |
Pairwise ld statistics for all markers |
rsq_matrix |
Pairwise rsq statistics for all markers |
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.