calculate_allele_frequencies: Calculate allele frequencies

Description Usage Arguments Details Value Examples

View source: R/calculate_allele_frequencies.R

Description

Calculate for a number of regularly spaced markers the relative frequency of each ancestor in the population.

Usage

1
2
calculate_allele_frequencies(source_pop, locations = seq(0, 1, length.out
  = 100), progress_bar = TRUE)

Arguments

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

Details

Markers are equidistantly spaced, with a distance of step_size in between them.

Value

A tibble containing the allele frequencies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
number_founders = 20
wildpop =  simulate_admixture(pop_size = 1000,
                              number_of_founders = number_founders,
                              total_runtime = 10,
                              morgan = 1,
                              seed = 666)

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()

## End(Not run)

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