View source: R/calculate.all.pairwise.Fst.R
calculate.all.pairwise.Fst | R Documentation |
This function calculates unbiased F_{ST} (based on Weir and Hill's θ,
2002), between all populations/individuals included in the counts
matrix, and
returns the results in a k
by k
matrix, where k = nrow(counts)
.
Loci for which either of the populations/individuals has missing data (i.e. - the sample
size is zero) are excluded.
calculate.all.pairwise.Fst(allele.counts, sample.sizes)
allele.counts |
A matrix of allelic count data, for which |
sample.sizes |
A matrix of sample sizes, for which |
A matrix of pairwise, unbiased F_{ST}.
Gideon Bradburd
Weir,B.S. and W.G. Hill. 2002. Estimating F-statistics. Ann.Rev.Gen. 36:949-952.
#With the HGDP dataset data(HGDP.bedassle.data) #Calculate pairwise Fst between all population pairs hgdp.pairwise.Fst <- calculate.all.pairwise.Fst( HGDP.bedassle.data$allele.counts, HGDP.bedassle.data$sample.sizes ) #Plot pairwise Fst against geographic distance plot(HGDP.bedassle.data$GeoDistance, hgdp.pairwise.Fst, pch=19, col=HGDP.bedassle.data$EcoDistance+1, ylab="pairwise Fst", xlab="geographic distance", main="isolation by distance") legend(x="bottomright",pch=19,col=c(1,2), legend=c("same side of Himalayas", "opposite sides of Himalayas"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.