dist.codom: Calculate distance between individual for co-dominant locus

Description Usage Arguments Value References Examples

Description

This function calculates the distance between individuals in a genind object based on their genotypes. Specifically, the simple metric of Kosman and Leonard (2005) in which distance is calculated as a propotion of shared alleles at each locus.

Usage

1
dist.codom(x, matrix = TRUE, global = TRUE, na.rm = TRUE)

Arguments

x

genind object (from package adegenet)

matrix

boolean: if TRUE return matrix (dist object if FALSE)

global

boolean: if TRUE, return a single global estimate based on all loci. If FALSE return a list of matrices for each locus. if FALSE

na.rm

boolean: if TRUE remove individuals with NAs

Value

either a list of distance matrices, one for each locus or a single matrix containing the mean distance between individuals across all loci

Dropped for each distance matrix and object of class "na.action" containing indices to those indivudals in the genind object which where omitted due to having NAs

References

Kosman E., Leonard, K.J. Similarity coefficients for molecular markers in studies of genetic relationships between individuals for haploid diploid, and polyploid species. Molecular Ecology. 14: 415-424

Examples

1
2
3
data(nancycats)
dm <- dist.codom(nancycats[40:45], matrix=FALSE)
head(dm)

Example output

Loading required package: adegenet
Loading required package: ade4
Registered S3 method overwritten by 'spdep':
  method   from
  plot.mst ape 

   /// adegenet 2.1.3 is loaded ////////////

   > overview: '?adegenet'
   > tutorials/doc/questions: 'adegenetWeb()' 
   > bug reports/feature requests: adegenetIssues()


Registered S3 method overwritten by 'pegas':
  method      from
  print.amova ade4
$distances
          N31       N32       N33       N34       N70
N32 0.6666667                                        
N33 0.3888889 0.7222222                              
N34 0.6111111 0.6666667 0.5000000                    
N70 0.7777778 0.6666667 0.7777778 0.7777778          
N35 0.7777778 0.7222222 0.7222222 0.5555556 0.8333333

$dropped
NULL

mmod documentation built on May 1, 2019, 10:55 p.m.