calculate_fst: Calculate FST

Description Usage Arguments Details Value Author(s) Examples

Description

The FST value between two populations is calculated, given a number of markers. Markers are superimposed upon the (known) ancestry along the chromosome for all sampled individuals. Markers can be chosen to be regularly spaced, or randomly distributed.

Usage

1
2
calculate_fst(pop1, pop2,
        sampled_individuals, number_of_markers = 100, random_markers = FALSE)

Arguments

pop1

Population object

pop2

Population object

sampled_individuals

Number of individuals to base the FST upon. Individuals are randomly drawn from each population, a lower number speeds up calculations.

number_of_markers

Number of markers along the chromosome used to calculate FST metrics.

random_markers

If TRUE, markers are randomly spaced along the chromosome, if FALSE, markers are equidistantly spaced along the chromosome.

Details

Uses the function wc from the package hierfstat to calculate the FST. The function wc computes the Weir and Cockerham F statistic.

Value

FST value

Author(s)

Thijs Janzen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
two_populations <- create_two_populations(pop_size = 1000,
                                          number_of_founders = 20,
                                          total_runtime = 100,
                                          morgan = 1,
                                          seed = 42,
                                          overlap = 0.25,
                                          write_to_file = FALSE)

  FST <- calculate_fst(two_populations$Population_1,
                 two_populations$Population_2,
                 sampled_individuals = 10,
                 number_of_markers = 100,
                 random_markers = TRUE)
  
## End(Not run)

thijsjanzen/isoSIM documentation built on May 29, 2019, 10:39 a.m.