genetic_structure: Estimation of , genetic structure statistics.

View source: R/genetic_structure.R

genetic_structureR Documentation

Estimation of , genetic structure statistics.

Description

This function estimates common , genetic statistics.

Usage

genetic_structure(
  x,
  stratum = "Population",
  mode = c("Gst", "Gst_prime", "Dest")[1],
  nperm = 0,
  size.correct = TRUE,
  pairwise = FALSE,
  locus
)

Arguments

x

An object of type data.frame with at least a single column of type locus

stratum

The stratum to use as groupings (default='Population').

mode

Whic statistic to estimate. Current options include:

Gst

Nei's Gst (not Berg and Hamrick)

Gst_prime

Hedrick's correction of Nei's Gst for diverse loci

Dest

Joost's estimate

nperm

The number of permutations used to test the hypothesis that the parameter = 0.

size.correct

A flag indicating that the estimate should be corrected for based upon sample sizes (default=TRUE).

pairwise

A flag indicating that the analysis should be done among all pairs of strata.

locus

An optional parameter specifying the locus or loci to be used in the analysis. If this is not specified, then all loci are used.

Value

An object of type data.frame containing estimates for each locus and a multilocus estimate. If pairwise=TRUE, then it returns the multilocus (if more than one locus) estimate in a matrix format.

Note

The multilocus estimation of these parameters is estimated following the suggestions of Culley et al. (2001) A comparison of two methods of calculating Gst, a genetic measure of population differentiation. American Journal of Botany 89(3): 460-465.

Examples

 AA <- locus( c("A","A") )
 AB <- locus( c("A","B") )
 BB <- locus( c("B","B") )
 locus <- c(AA,AA,AA,AA,BB,BB,BB,AB,AB,AA)
 locus2 <- c(AB,BB,AA,BB,BB,AB,AB,AA,AA,BB)
 Population <- c(rep("Pop-A",5),rep("Pop-B",5))
 df <- data.frame( Population, TPI=locus, PGM=locus2 )
 genetic_structure( df, mode="Gst", nperm=999)
 genetic_structure( df, mode="Gst", pairwise=TRUE)
 genetic_structure( df, mode="Gst", pairwise=TRUE, locus="TPI" )

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.