Description Usage Arguments Value Note Author(s) Examples
View source: R/genetic_distance.R
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.
1 | genetic_distance(x, stratum = "Population", mode)
|
x |
A |
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. |
A matrix with the genetic distances
This function currently includes the following individual distance measures:
Inter-individual
Proportion of shared alleles
This function also supports genetic distances based upon stratum distances. The currently supported genetic distances are:
Euclidean frequency distance
Conditional Genetic Distance
Nei's corrected genetic distance (1978)
Shared allele distance = 1 - Ps
Jaccard set dissimilarity
Rodney J. Dyer rjdyer@vcu.edu
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.