f4ratio: Calculate the D, f4, f4-ratio, or f3 statistic.

Description Usage Arguments Value Examples

View source: R/wrappers.R

Description

Calculate the D, f4, f4-ratio, or f3 statistic.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
f4ratio(data, X, A, B, C, O, outdir = NULL, params = NULL)

d(
  data,
  W,
  X,
  Y,
  Z,
  quartets = NULL,
  outdir = NULL,
  f4mode = FALSE,
  params = NULL
)

f4(data, W, X, Y, Z, quartets = NULL, outdir = NULL, params = NULL)

f3(data, A, B, C, outdir = NULL, inbreed = FALSE, params = NULL)

Arguments

data

EIGENSTRAT data object.

outdir

Where to put all generated files (temporary directory by default).

params

Named list of parameters and their values.

W, X, Y, Z, A, B, C, O

Population names according to the nomenclature used in Patterson et al., 2012.

quartets

List of character vectors (quartets of population/sample labels)

f4mode

Calculate the f4 statistic instead of the D statistic.

inbreed

See README.3PopTest in ADMIXTOOLS for an explanation.

Value

Data frame object with calculated statistics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: # download an example genomic data set and prepare it for analysis
snps <- eigenstrat(download_data(dirname = tempdir()))

# define a set of populations to analyze
pops <- c("French", "Sardinian", "Han", "Papuan", "Dinka")

result_f4ratio <- f4ratio(
    X = pops, A = "Altai", B = "Vindija", C = "Yoruba", O = "Chimp",
    data = snps
)

result_d <- d(
    W = pops, X = "Yoruba", Y = "Vindija", Z = "Chimp",
    data = snps
)

result_f4 <- f4(
    W = pops, X = "Yoruba", Y = "Vindija", Z = "Chimp",
    data = snps
)

result_f3 <- f3(
    A = pops, B = "Mbuti", C = "Khomani_San",
    data = snps
)

## End(Not run)

admixr documentation built on July 8, 2020, 6:19 p.m.