calculate_tajima_d: Calculate Tajima's d

Description Usage Arguments Value Examples

View source: R/calculate_tajima_d.R

Description

Tajima's d is calculated, given a number of markers.

Usage

1
2
calculate_tajima_d(pop, markers = seq(1e-06, 1 - 1e-06, length.out =
  100), number_of_sampled_individuals = 10)

Arguments

pop

Population object

markers

Vector from 0 to 1 (excluding 0 and 1) indicating the locations of the markers used for the analysis

number_of_sampled_individuals

Number of individuals to base Tajima's d upon. Individuals are randomly drawn from the population.

Value

A list with the following entries: D Tajima's D, pi pi, the average pairwise differences across the number of selected markers. S the number of segregating sites and theta_hat, the expected value of pi, calculated from S, such that theta = S/a1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
pop <- simulate_admixture(pop_size = 100,
                          number_of_founders = 2,
                          total_runtime = 100,
                          seed = 42)$population

calculate_tajima_d(pop,
                   markers = seq(1e-6,1-1e-6,100),
                   number_of_sampled_individuals = 10)


## End(Not run)

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