genetic_distance: Estimate genetic distances among strata in a ,

Description Usage Arguments Value Note Author(s) Examples

View source: R/genetic_distance.R

Description

This function is the main one used for estimating genetic distances among either individuals or stratum. Given the large number of genetic distance metrics, some are recreated here, de novo, and some are estimated through other existing R packages.

Usage

1
genetic_distance(x, stratum = "Population", mode)

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').

mode

The particular genetic distance metric that you are going to use.

Value

A matrix with the genetic distances

Note

This function currently includes the following individual distance measures:

AMOVA

Inter-individual

Bray

Proportion of shared alleles

This function also supports genetic distances based upon stratum distances. The currently supported genetic distances are:

Euclidean

Euclidean frequency distance

cGD

Conditional Genetic Distance

Nei

Nei's corrected genetic distance (1978)

Dps

Shared allele distance = 1 - Ps

Jaccard

Jaccard set dissimilarity

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
AA <- locus( c("A","A") )
AB <- locus( c("A","B") )
BB <- locus( c("B","B") )
AC <- locus( c("A","C") )
AD <- locus( c("A","D") )
BC <- locus( c("B","C") )
BD <- locus( c("B","D") )
CC <- locus( c("C","C") )
CD <- locus( c("C","D") )
DD <- locus( c("D","D") )
loci <- c(AA,AB,AC,AD,BB,BC,BD,CC,CD,DD) 
pops <- c(rep("A",5), rep("B",5))
df <- data.frame( Population=pops, TPI=loci)
genetic_distance(df, mode="AMOVA")
genetic_distance(df, mode="Dps")

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