View source: R/calculate_allele_frequencies.R
| calculate_allele_frequencies | R Documentation | 
Calculate for a number of regularly spaced markers the relative frequency of each ancestor in the population.
calculate_allele_frequencies(
  source_pop,
  locations = seq(0, 1, length.out = 100),
  progress_bar = FALSE
)
source_pop | 
 Population for which to estimate allele frequencies  | 
locations | 
 A vector indicating the locations (in Morgan) where to calculate the allele frequencies.  | 
progress_bar | 
 Displays a progress_bar if TRUE. Default value is TRUE  | 
Markers are equidistantly spaced, with a distance of
step_size in between them.
A tibble containing the allele frequencies
number_founders = 20
wildpop =  simulate_admixture(
   module = ancestry_module(number_of_founders = 20, morgan = 1),
   pop_size = 1000,
   total_runtime = 10,
   num_threads = 1)
freq_output <- calculate_allele_frequencies(wildpop,
                                            progress_bar = TRUE)
require(ggplot2)
ggplot(freq_output, aes(x=location, y = frequency,
                        col = as.factor(ancestor))) +
  geom_line()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.