Skip to contents

These functions are modified from the function dist.genpop to be applicable for distances between individuals.

Usage

nei.dist(x, warning = TRUE)

edwards.dist(x)

rogers.dist(x)

reynolds.dist(x)

provesti.dist(x)

prevosti.dist

Format

An object of class function of length 1.

Arguments

x

a genind, genclone, or matrix object.

warning

If TRUE, a warning will be printed if any infinite values are detected and replaced. If FALSE, these values will be replaced without warning. See Details below.

Value

an object of class dist with the same number of observations as the number of individuals in your data.

Details

It is important to be careful with the interpretation of these distances as they were originally intended for calculation of between-population distance. As Nei's distance is the negative log of 0:1, this means that it is very possible to obtain distances of infinity. When this happens, infinite values are corrected to be 10 * max(D) where D is the distance matrix without infinite values.

Note

Prevosti's distance is identical to diss.dist, except that diss.dist is optimized for a larger number of individuals (n > 125) at the cost of required memory. Both prevosti.dist and provesti.dist are the same function, provesti.dist is a spelling error and exists for backwards compatibility.

These distances were adapted from the adegenet function dist.genpop to work with genind objects.

References

Nei, M. (1972) Genetic distances between populations. American Naturalist, 106, 283-292.

Nei M. (1978) Estimation of average heterozygosity and genetic distance from a small number of individuals. Genetics, 23, 341-369.

Avise, J. C. (1994) Molecular markers, natural history and evolution. Chapman & Hall, London.

Edwards, A.W.F. (1971) Distance between populations on the basis of gene frequencies. Biometrics, 27, 873-881.

Cavalli-Sforza L.L. and Edwards A.W.F. (1967) Phylogenetic analysis: models and estimation procedures. Evolution, 32, 550-570.

Hartl, D.L. and Clark, A.G. (1989) Principles of population genetics. Sinauer Associates, Sunderland, Massachussetts (p. 303).

Reynolds, J. B., B. S. Weir, and C. C. Cockerham. (1983) Estimation of the coancestry coefficient: basis for a short-term genetic distance. Genetics, 105, 767-779.

Rogers, J.S. (1972) Measures of genetic similarity and genetic distances. Studies in Genetics, Univ. Texas Publ., 7213, 145-153.

Avise, J. C. (1994) Molecular markers, natural history and evolution. Chapman & Hall, London.

Prevosti A. (1974) La distancia genetica entre poblaciones. Miscellanea Alcobe, 68, 109-118.

Prevosti A., Ocana J. and Alonso G. (1975) Distances between populations of Drosophila subobscura, based on chromosome arrangements frequencies. Theoretical and Applied Genetics, 45, 231-241.

For more information on dissimilarity indexes:

Gower J. and Legendre P. (1986) Metric and Euclidean properties of dissimilarity coefficients. Journal of Classification, 3, 5-48

Legendre P. and Legendre L. (1998) Numerical Ecology, Elsevier Science B.V. 20, pp274-288.

Author

Zhian N. Kamvar (poppr adaptation) Thibaut Jombart (adegenet adaptation) Daniel Chessel (ade4)

Examples


data(nancycats)
(nan9   <- popsub(nancycats, 9))
#> /// GENIND OBJECT /////////
#> 
#>  // 9 individuals; 9 loci; 43 alleles; size: 16.8 Kb
#> 
#>  // Basic content
#>    @tab:  9 x 43 matrix of allele counts
#>    @loc.n.all: number of alleles per locus (range: 3-8)
#>    @loc.fac: locus factor for the 43 columns of @tab
#>    @all.names: list of allele names for each locus
#>    @ploidy: ploidy of each individual  (range: 2-2)
#>    @type:  codom
#>    @call: popsub(gid = nancycats, sublist = 9)
#> 
#>  // Optional content
#>    @pop: population of each individual (group size range: 9-9)
#>    @other: a list containing: xy 
#> 
(neinan <- nei.dist(nan9))
#>           N104      N105      N106      N107      N108      N109      N111
#> N105 1.0579046                                                            
#> N106 0.5219437 0.5990190                                                  
#> N107 0.2009995 0.6263815 0.2350018                                        
#> N108 0.3013348 0.9090384 0.2707986 0.2181184                              
#> N109 0.6019864 0.2195294 0.5978370 0.5451567 0.7408023                    
#> N111 0.8201799 2.6020033 0.7290191 0.8770096 0.5355122 1.5174765          
#> N112 0.9373236 0.3784101 0.7408023 0.4257577 0.6061358 0.5584807 2.0759572
#> N113 0.8754687 1.0579046 1.0074515 1.0883026 0.8319630 0.8896685 0.6531258
#>           N112
#> N105          
#> N106          
#> N107          
#> N108          
#> N109          
#> N111          
#> N112          
#> N113 1.5251102
(ednan  <- edwards.dist(nan9))
#>           N104      N105      N106      N107      N108      N109      N111
#> N105 0.7517229                                                            
#> N106 0.6127062 0.6387116                                                  
#> N107 0.3913906 0.6808143 0.4463299                                        
#> N108 0.5140990 0.7362578 0.5047434 0.4197600                              
#> N109 0.6312058 0.4309644 0.6236096 0.6236096 0.6906433                    
#> N111 0.7730660 0.9599128 0.7517229 0.7730660 0.6808143 0.8873047          
#> N112 0.7517229 0.5739208 0.6906433 0.5855469 0.6312058 0.6564788 0.9305251
#> N113 0.7878089 0.8022810 0.7878089 0.8223129 0.7580364 0.7730660 0.7297559
#>           N112
#> N105          
#> N106          
#> N107          
#> N108          
#> N109          
#> N111          
#> N112          
#> N113 0.8687726
(rodnan <- rogers.dist(nan9))
#>           N104      N105      N106      N107      N108      N109      N111
#> N105 0.5813390                                                            
#> N106 0.4295584 0.5000000                                                  
#> N107 0.2222222 0.5081258 0.2222222                                        
#> N108 0.3333333 0.5785674 0.2777778 0.2222222                              
#> N109 0.4146723 0.2777778 0.3563452 0.3414591 0.4674563                    
#> N111 0.5718072 0.8170412 0.5311377 0.5866932 0.4904682 0.6882725          
#> N112 0.5664529 0.4119008 0.4702279 0.3888889 0.4146723 0.4674563 0.7465996
#> N113 0.5718072 0.6192369 0.6043508 0.6097051 0.5866932 0.5866932 0.4606960
#>           N112
#> N105          
#> N106          
#> N107          
#> N108          
#> N109          
#> N111          
#> N112          
#> N113 0.6829183
(reynan <- reynolds.dist(nan9))
#>           N104      N105      N106      N107      N108      N109      N111
#> N105 0.7934920                                                            
#> N106 0.6255432 0.6915641                                                  
#> N107 0.4588315 0.6770032 0.4364358                                        
#> N108 0.5619515 0.7595545 0.5000000 0.4472136                              
#> N109 0.6454972 0.5423261 0.6000000 0.5656854 0.6504436                    
#> N111 0.7483315 0.8574929 0.6928203 0.6938887 0.6741999 0.7620008          
#> N112 0.7200823 0.6488857 0.6504436 0.5516773 0.6454972 0.6123724 0.7977240
#> N113 0.7337994 0.7934920 0.7071068 0.6948083 0.7071068 0.6938887 0.7223151
#>           N112
#> N105          
#> N106          
#> N107          
#> N108          
#> N109          
#> N111          
#> N112          
#> N113 0.7620008
(pronan <- prevosti.dist(nan9))
#>           N104      N105      N106      N107      N108      N109      N111
#> N105 0.6111111                                                            
#> N106 0.4444444 0.5000000                                                  
#> N107 0.2222222 0.5555556 0.2222222                                        
#> N108 0.3333333 0.6111111 0.2777778 0.2222222                              
#> N109 0.4444444 0.2777778 0.3888889 0.3888889 0.5000000                    
#> N111 0.6666667 0.9444444 0.6111111 0.6666667 0.5555556 0.8333333          
#> N112 0.6111111 0.4444444 0.5000000 0.3888889 0.4444444 0.5000000 0.8888889
#> N113 0.6666667 0.6666667 0.6666667 0.7222222 0.6666667 0.6666667 0.5555556
#>           N112
#> N105          
#> N106          
#> N107          
#> N108          
#> N109          
#> N111          
#> N112          
#> N113 0.7777778