popStructTest: Population Structure Tests

popStructTestR Documentation

Population Structure Tests

Description

Conduct multiple tests of population structure / differentiation. Overall tests can be conducted for the current stratification scheme (overallTest()), or can be conducted for all unique pairs of strata (pairwiseTest()). All statistics appropriate to the ploidy of the data are estimated at once. See Note for a description of each statistic.

Usage

overallTest(
  g,
  nrep = 1000,
  by.locus = FALSE,
  hap.locus = 1,
  quietly = FALSE,
  max.cores = 1,
  ...
)

pairwiseTest(
  g,
  nrep = 1000,
  by.locus = FALSE,
  hap.locus = 1,
  quietly = FALSE,
  max.cores = 1,
  ...
)

pairwiseMatrix(pws, stat, locus = "All")

pairwiseSummary(pws, locus = "All")

Arguments

g

a gtypes object.

nrep

number specifying number of permutation replicates to use for permutation test.

by.locus

return by-locus values of statistics? If TRUE the overall value will be contained in the first row, labelled "All". Only applies if the ploidy of g is > 1 (non-haploid).

hap.locus

which locus to use if g is haploid. Can be specified by number or name.

quietly

logical. print progress to screen?

max.cores

the maximum number of cores to use to distribute replicates for permutation tests over. If set to NULL, the value will be what is reported by detectCores - 1. If detectCores reports NA, max.cores will be set to 1 and parallel processing will not be done.

...

parameters passed to dist.dna for computation of pairwise distance matrix for AMOVA PHIst statistic.

pws

a list returned from a call to pairwiseTest().

stat

the name of a statistic in the $result element for pairwise comparisons returned by pairwiseTest().

locus

the name of a single locus. If "All", the overall result from all loci is returned. See by.locus.

Value

overallTest()

a list containing:

strata.freq

a table of the sample sizes for each stratum

result

an array with the statistic estimate and p-value for each statistic. If by.locus = FALSE or g is a haploid dataset, this is a two-dimensional array, with one row per statistic, statistic estimate in the first column and permutation test p-value in the second column. If by.locus = TRUE and g has ploidy > 1, then this is a three-dimensional array where the first dimension is loci, second dimension is statistics, and third dimension is statistic estimate and p-value.

pairwiseTest()

a list containing a list of results as described above for overallTest() for each pairwise comparison.

pairwiseMatrix()

a matrix summarizing a chosen statistic (stat) for a chosen locus (locus) between pairs of strata with the statistic estimate in the lower left and the p-value in the upper right.

pairwiseSummary()

a data frame summarizing all pairwise statistics and p-values along with strata sample sizes.

Note

The computed statistics are:

CHIsq chi-squared estimate measuring random allele frequency distribution distributed across strata (haploid and diploid)
Ho, Hs, Ht Nei and Kumar 2002 : observed heterozygosity (Ho), within population diversity (Hs), overall diversity (Ht)
Ht_prime description
Dst description
Dst_prime description
Fst For haploid data, equivalent to PHIst with pairwise distances set to 1. For diploid data,
Fst_prime description
Fis description
Gst_prime description
Gst_dbl_prime description
Dest, Dest_Chao population differentiation (Jost 2008)
wcFit, wcFst, wcFit (Weir and Cockerham 1984)
PHIst Haploid AMOVA estimate of differentiation derived from matrix of pairwise distances between sequences. See dist.dna for details on distance computation. (Excoffier et al 1992)

Author(s)

Eric Archer eric.archer@noaa.gov

References

Excoffier, L., Smouse, P.E. and Quattro, J.M. 1992. Analysis of molecular variance inferred from metric distances among DNA haplotypes: application to human mitochondrial DNA restriction data. Genetics 131:479–491. Jost, L. 2008. GST and its relatives do not measure differentiation. Molecular Ecology 17:4015-4026. Nei M. and Chesser R. 1983. Estimation of fixation indexes and gene diversities. Annals of Human Genetics 47:253-259. Nei M. 1987. Molecular Evolutionary Genetics. Columbia University Press Weir, B.S. and Cockerham, C.C. 1984. Estimating F-statistics for the analysis of population structure. Evolution 38:1358–1370. Weir, B.S. and Hill, W.G. 2002. Estimating F-statistics. Annual Review of Genetics 36:721–750.

See Also

basic.stats, Fst, amova

Examples

# An overall test with microsatellite data
data(msats.g)
ovl <- overallTest(msats.g, nrep = 100)
ovl

#' A pairwise test with control region sequences
data(dloop.g)
pws <- pairwiseTest(dloop.g, nrep = 100)
pws


EricArcher/strataG documentation built on Feb. 12, 2023, 4:11 a.m.