calculate_marker_frequency: Calculate allele frequencies at a specific marker location

Description Usage Arguments Value Examples

View source: R/calculate_marker_frequency.R

Description

Calculate the relative frequency of each ancestor in the population at a specific marker location

Usage

1

Arguments

pop

Population for which to estimate allele frequencies at the given marker

location

A vector or scalar of location(s) along the chromosome for which allele frequencies are to be calculated. Locations are in Morgan.

Value

A tibble containing the frequency of each present ancestor at the provided location. Ancestors with frequency = 0 are dropped out of the table. The tibble contains three columns: location, ancestor and frequency.

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)

calculate_marker_frequency(wildpop, 0.5)

frequencies <- calculate_marker_frequency(wildpop, seq(0.4, 0.5, by = 0.001))

ggplot(frequencies, aes(x = location, y = frequency, col = ancestor)) +
  geom_step()


## End(Not run)

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