codomToPropShared {memgene} | R Documentation |
Find proportion of shared alleles genetic distances from a codominant alleles matrix
Description
Given a matrix with two adjacent columns for each locus (e.g. LOCUS1a, LOCUS1b, LOCUS2a, LOCUS2b, ...)
containing codominant alelles, where individual genotypes are in rows, find the proportion of shared alleles
(Bowcock et al., 1994) among individuals using functions in the adegenet package.
This is a convenience function that wraps adegenet routines.
Note that any type of genetic distance matrix can be used in MEMGENE, and the proportion of shared alleles metric is not a requirement.
Usage
codomToPropShared(alleles, missingData = c(-98,-99), genind=FALSE)
Arguments
alleles |
A matrix with two adjacent columns for each locus containing codominant alleles |
missingData |
A vector of any length giving the values in the alleles matrix representing missing data ( |
genind |
Return a genind object rather than the proportion of shared alleles genetic distance matrix. A genind object can be used by various functions in the adegenet package. |
Details
First prepares the alleles matrix into a format that can be converted using functions in the adegenet package to the genind
format. propShared
is then run on this object.
Value
Returns a genetic distance matrix using the proportion of shared alleles metric (Bowcock et al., 1994)
Author(s)
Pedro Peres-Neto (peres-neto.pedro@uqam.ca)
Paul Galpern (pgalpern@ucalgary.ca)
References
Bowcock AM, Ruizlinares A, Tomfohrde J, et al. 1994 High resolution of human evolutionary trees with polymorphic microsatellites. Nature, 368, 455-457.
Examples
radialData <- read.csv(system.file("extdata/radial.csv", package="memgene"))
radialGen <- radialData[, -c(1,2)]
radialDM <- codomToPropShared(radialGen)