Skip to contents

Calculates an AMOVA based on the genetic distance matrix from stamppNeisD() using the amova() function from the package PEGAS for exploring within and between population variation

Usage

stamppAmova(dist.mat, geno, perm = 100)

Arguments

dist.mat

the matrix of genetic distances between individuals generated from stamppNeisD()

geno

a data frame containing allele frequency data generated from stamppConvert, or a genlight object containing genotype data, individual IDs, population IDs and ploidy levels

perm

the number of permutations for the tests of hypotheses

Value

An object of class "amova" which is a list containing a table of sum of square deviations (SSD), mean square deviations (MSD) and the number of degrees of freedom as well as the variance components

Details

Uses the formula distance ~ populations, to calculate an AMOVA for population differentiation and within & between population variation. This function uses the amova function from the PEGAS package.

References

Paradis E (2010) pegas: an R package for population genetics with an integrated-modular approach. Bioinformatics 26, 419-420. <doi:10.1093/bioinformatics/btp696>

Author

Luke Pembleton <lpembleton at barenbrug.com>

Examples

# import genotype data and convert to allele frequecies
data(potato.mini, package="StAMPP")
potato.freq <- stamppConvert(potato.mini, "r")
# Calculate genetic distance between individuals
potato.D.ind <- stamppNeisD(potato.freq, FALSE, "standard")
# Calculate AMOVA
stamppAmova(potato.D.ind, potato.freq, 100)
#> 
#> 	Analysis of Molecular Variance
#> 
#> Call: amova(formula = dist.mat ~ pop.names, nperm = perm)
#> 
#>                  SSD         MSD df
#> pop.names 0.10567200 0.052835998  2
#> Error     0.01207841 0.004026136  3
#> Total     0.11775040 0.023550081  5
#> 
#> Variance components:
#>              sigma2 P.value
#> pop.names 0.0244049  0.1089
#> Error     0.0040261        
#> 
#> Phi-statistics:
#> pop.names.in.GLOBAL 
#>           0.8583896 
#> 
#> Variance coefficients:
#> a 
#> 2 
#>