calc.fst: This calculates Fst.

Description Usage Arguments Value Examples

Description

This calculates Fst. The caluclation is done as (Ht-Hs)/Ht, where Ht is the expected heterozygosity for all populations and Hs is the expected heterozygosity for each population. This calculation is used in bootstrapping functions.

Usage

1

Arguments

df

A dataframe containing the genepop information, where the first column is the population ID.

i

Column number containing genotype information.

Value

ht

The expected heterozygosity under Hardy-Weinberg expectations. This is a single numerical value.

fst

The calculated Fst value for this locus.

Examples

1
2
3
4
5
6
7
8
9
  gpop<-data.frame(popinfo=c(rep("POP 1", 20),rep("POP 2", 20)),ind.names=c(1:20,1:20),
    loc0=sample(c("0101","0102","0202"),40,replace=TRUE))
  fst1<-calc.fst(gpop,3)
  ## Not run: 
    gfile<-system.file("extdata", "example.genepop.txt",package = 'fsthet')
    gpop<-my.read.gpop(gfile)
    fst1<-calc.fst(gpop,3) #calculate fst for the first SNP
  
## End(Not run)

fsthet documentation built on May 2, 2019, 7:55 a.m.