Learn R Programming

pcadapt (version 2.2)

fstCalc: Fst

Description

fstCalc returns the list of Fst associated with each SNP using Weir and Cockerham's formula.

Usage

fstCalc(data, POPs, nPOP, PopSizes, ploidy = 2)

Arguments

data
a data matrix or a data frame.
POPs
a list of integers specifying which subpopulation the individuals belong to.
nPOP
an integer specifying the number of populations in the dataset.
PopSizes
a list of length nPOP specifying the number of individuals for each subpopulation.
ploidy
an integer specifying the ploidy of the individuals.

References

Weir, B. S., & Cockerham, C. C. (1984). Estimating F-statistics for the analysis of population structure. Evolution, 1358-1370.

Examples

Run this code
x <- read4pcadapt("geno3pops",option="example")
popsizes <- c(50,50,50) 
pops <- c(rep(1,times=50),rep(2,times=50),rep(3,times=50))
nPOP <- 3
fst <- fstCalc(x,pops,nPOP,popsizes)

Run the code above in your browser using DataLab