compute.f4ratio {poolfstat} | R Documentation |
Compute F4ratio (estimation of admixture rate) from an fstats object
Description
Compute F4ratio (estimation of admixture rate) from an fstats object
Usage
compute.f4ratio(x, num.quadruplet, den.quadruplet)
Arguments
x |
A fstats object containing estimates of fstats |
num.quadruplet |
A character vector for the F4 quadruplet used in the F4ratio numerator (should be of the form "A,O;C,X" where A, O, C and X are the names of the population as defined in the countdata or pooldata object used to obtain fstats, see details) |
den.quadruplet |
A character vector for the F4 quadruplet used in the F4ratio denominator (should be of the form "A,O;C,B" where A, O, C and B are the names of the populations as defined in the countdata or pooldata object used to obtain fstats, see details)) |
Details
Assuming a 4 population phylogeny rooted with an outgroup O of the form (((A,B);C);O) and an admixed population X with two source populations related to B and C, the admixture rate alpha of the B-related ancestry is obtained using the ratio F4(A,O;C,X)/F4(A,O;C,B) (see Patterson et al., 2012 for more details).
Value
Either a scalar corresponding to the estimated admixture rate or, if F2 block-jackknife samples are available in the input fstats object (i.e., compute.fstats was run with return.F2.blockjackknife.samples = TRUE) a vector with three elements corresponding to the estimate of the admixture rate, the block-jacknife mean (may be slightly different than the previous since not exactly the same set of markers are used) and the standard error of the estimates.
See Also
To generate pooldata object, see vcf2pooldata
, popsync2pooldata
,genobaypass2pooldata
or genoselestim2pooldata
. To generate coundata object, see genobaypass2countdata
or genotreemix2countdata
.
Examples
make.example.files(writing.dir=tempdir())
pooldata=popsync2pooldata(sync.file=paste0(tempdir(),"/ex.sync.gz"),poolsizes=rep(50,15))
res.fstats=compute.fstats(pooldata)