f2: Estimate f2 statistics

Description Usage Arguments Value References Examples

View source: R/qpdstat.R

Description

Computes f2 statistics from f2 blocks of the form f2(A, B)

Usage

1
2
3
4
5
6
7
8
9
f2(
  data,
  pop1 = NULL,
  pop2 = NULL,
  boot = FALSE,
  sure = FALSE,
  unique_only = TRUE,
  verbose = FALSE
)

Arguments

data

Input data in one of three forms:

  1. A 3d array of blocked f2 statistics, output of f2_from_precomp or extract_f2 (fastest option)

  2. A directory which contains pre-computed f2-statistics

  3. The prefix of genotype files (slowest option)

pop1

One of the following four:

  1. NULL: all possible population combinations will be returned

  2. A vector of population labels. All combinations with the other pop arguments will be returned

  3. A matrix with population combinations to be tested, with one population per column and one combination per row. Other pop arguments will be ignored.

  4. the location of a file (poplistname or popfilename) which specifies the populations or population combinations to be tested. Other pop arguments will be ignored.

pop2

A vector of population labels

boot

If FALSE (the default), each block will be left out at a time and the covariance matrix of the f statistics will be computed using block-jackknife. Otherwise bootstrap resampling is performed n times, where n is either equal to boot if it is an integer, or equal to the number of blocks if boot is TRUE. The the covariance matrix of the f statistics will be computed using bootstrapping.

sure

The number of population combinations can get very large. This is a safety option that stops you from accidently computing all combinations if that number is large.

unique_only

If TRUE (the default), redundant combinations will be excluded

verbose

Print progress updates

Value

f2 returns a data frame with f2 statistics

References

Patterson, N. et al. (2012) Ancient admixture in human history Genetics

Peter, B. (2016) Admixture, Population Structure, and F-Statistics Genetics

Examples

1
2
3
4
5
6
7
pop1 = 'Denisova.DG'
pop2 = c('Altai_Neanderthal.DG', 'Vindija.DG')
f2(example_f2_blocks, pop1, pop2)
## Not run: 
f2(f2_dir, pop1, pop2)

## End(Not run)

uqrmaie1/admixtools documentation built on Sept. 16, 2020, 5:55 a.m.