Learn R Programming

adegenet (version 1.4-2)

F statistics: F statistics for genind objects

Description

pairwise.fst computes Nei's pairwise Fst between all pairs of populations using a genind object. Heretozygosities are weighted by group sizes (see details).

The function fstat is a wrapper for varcomp.glob of the package hierfstat. For Fst, Fis and Fit, an alternative is offered by Fst from the pagas package (see example).

Usage

fstat(x, pop=NULL, fstonly=FALSE)
pairwise.fst(x, pop=NULL, res.type=c("dist","matrix"), truenames=TRUE)

Arguments

x
an object of class genind.
pop
a factor giving the 'population' of each individual. If NULL, pop is seeked from pop(x). Note that the term population refers in fact to any grouping of individuals'.
res.type
the type of result to be returned: a dist object, or a symmetric matrix
truenames
a logical indicating whether true labels (as opposed to generic labels) should be used to name the output.
fstonly
a logical stating whether only the Fst should be returned.

Value

  • A vector, a matrix, or a dist object containing F statistics.

encoding

UTF-8

Details

Let $A$ and $B$ be two populations of population sizes $n_A$ and $n_B$, with expected heterozygosity (averaged over loci) $Hs(A)$ and $Hs(B)$, respectively. We denote $Ht$ the expected heterozygosity of a population pooling $A$ and $B$. Then, the pairwise $Fst$ between $A$ and $B$ is computed as: $Fst(A,B) = \frac{(Ht - (n_A Hs(A) + n_B Hs(B))/(n_A + n_B) )}{Ht}$

References

Nei, M. (1973) Analysis of gene diversity in subdivided populations. Proc Natl Acad Sci USA, 70: 3321-3323

See Also

Hs

Examples

Run this code
data(nancycats)

## pairwise Fst
mat.fst <- pairwise.fst(nancycats, res.type="matrix")
mat.fst

## Fst, Fis, Fit
## using hierfstat
if(require(hierfstat)){
fstat(nancycats)
}

## using pegas
if(require(pegas)){
data(nancycats)

## conversion to pegas's format
as.loci(nancycats)

## use Fst from pegas
fsttab <- Fst(as.loci(nancycats))

## average over loci
apply(fsttab, 2, mean)
}

Run the code above in your browser using DataLab