Learn R Programming

poolfstat (version 2.1.1)

compute.fstats: Estimate the F-statistics (F2, F3, F3star, F4, Dstat)

Description

Estimate the F-statistics (F2, F3, F3star, F4, Dstat)

Usage

compute.fstats(
  x,
  nsnp.per.bjack.block = 0,
  computeDstat = FALSE,
  return.F4.blockjackknife.samples = FALSE,
  verbose = TRUE
)

Value

An object of class fstats (see help(fstats) for details)

Arguments

x

A pooldata object containing Pool-Seq information or a countdata object containing allele count information

nsnp.per.bjack.block

Number of consecutive SNPs within a block for block-jackknife (default=0, i.e., no block-jackknife sampling)

computeDstat

If TRUE compute Dstatistics (i.e. scaled F4). This may add some non negligible computation time if the number of population is large (n>15)

return.F4.blockjackknife.samples

If TRUE (and nsnp.per.bjack.block>0) return F4 estimates for each block-jackknife sample (useful to compute F4 ratios standard errors)

verbose

If TRUE extra information is printed on the terminal

Details

The function estimates for the n populations (or pools) represented in the input object x:

  1. The F2 statistics for all the \(n(n-1)/2\) pairs of populations (or pools) and their scaled version (equivalent to Fst as compute with compute.pairwiseFST with method="Identity")

  2. If n>2, The F3 statistics for all the \(npools(npools-1)(npools-2)/2\) possible triplets of populations (or pools) and their scaled version (named F3star after Patterson et al., 2012)

  3. If n>3, The F4 statistics and the D-statistics (a scaled version of the F4) for all the \(npools(npools-1)(npools-2)*(npools-3)/8\) possible quadruplets of populations

  4. The estimated within population heterozygosities (=1-Q1)

See Also

To generate pooldata object, see vcf2pooldata, popsync2pooldata,genobaypass2pooldata or genoselestim2pooldata. To generate coundata object, see genobaypass2countdata or genotreemix2countdata.

Examples

Run this code
 make.example.files(writing.dir=tempdir())
 pooldata=popsync2pooldata(sync.file=paste0(tempdir(),"/ex.sync.gz"),poolsizes=rep(50,15))
 res.fstats=compute.fstats(pooldata)

Run the code above in your browser using DataLab