genetic_diversity: Estimate genetic diversity among strata in a Population,

Description Usage Arguments Value Author(s) Examples

View source: R/genetic_diversity.R

Description

This function is the main one used for estimating genetic diversity among strata. Given the large number of genetic diversity metrics, not all potential types are included.

Usage

1
2
3
4
5
6
7
8
genetic_diversity(
  x,
  stratum = NULL,
  loci = NULL,
  mode = c("A", "Ae", "A95", "He", "Ho", "Hos", "Hes", "Fis", "Pe")[2],
  small.N = FALSE,
  ...
)

Arguments

x

A data.frame object with locus columns.

stratum

The strata by which the genetic distances are estimated. This can be an optional parameter when estimating distance measures calculated among individuals (default='Population').

loci

The set of loci to use (default NULL will use all)

mode

The particular genetic diversity metric that you are going to use. The gstudio package currently includes the following individual distance measures:

A

Number of alleles

Ae

Effective number of alleles (default)

A95

Number of alleles with frequency at least five percent

He

Expected heterozygosity

Ho

Observed heterozygosity

Hes

Expected subpopulation heterozygosity (Nei's Corrected)

Hos

Expected subpopulation heterozygosity (Nei's Corrected)

Fis

Wright's Inbreeding coefficient (size corrected).

Pe

Locus polymorphic index.

small.N

Apply small N correction

...

Other parameters

Value

A data.frame with columns for strata, diversity (mode), and potentially P(mode=0).

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

1
2
3
4
5
6
7
8
 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_diversity( df, mode="Ae")

MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.