Learn R Programming

poppr (version 1.1.5)

poppr.amova: Perform Analysis of Molecular Variance (AMOVA) on genind or genclone objects.

Description

This function utilizes the ade4 implementation of AMOVA. See amova for details on the specific implementation.

Usage

poppr.amova(x, hier = NULL, clonecorrect = FALSE, within = TRUE,
  dist = NULL, squared = TRUE, correction = "quasieuclid",
  dfname = "population_hierarchy", sep = "_", missing = "loci",
  cutoff = 0.05, quiet = FALSE)

Arguments

x
a genind or genclone object
hier
a hierarchical formula that defines your population hierarchy. (e.g.: ~Population/Subpopulation). See Details below.
clonecorrect
logical if TRUE, the data set will be clone corrected with respect to the lowest level of the hierarchy. The default is set to FALSE. See clonecorrect for det
within
logical. When this is set to TRUE (Default), variance within individuals are calculated as well. If this is set to FALSE, The lowest level of the hierarchy will be the sample level. See Details below.
dist
an optional distance matrix calculated on your data.
squared
if a distance matrix is supplied, this indicates whether or not it represents squared distances.
correction
a character defining the correction method for non-euclidean distances. Options are quasieuclid (Default), lingoes, and
dfname
if the input data set is a genind object, specify the name of the data frame in the other slot defining the population hierarchy. Defaults to "popul
sep
A single character used to separate the hierarchical levels. This defaults to "_".
missing
specify method of correcting for missing data utilizing options given in the function missingno. Default is "loci".
cutoff
specify the level at which missing data should be removed/modified. See missingno for details.
quiet
logical If FALSE (Default), messages regarding any corrections will be printed to the screen. If TRUE, no messages will be printed.

Value

  • a list of class amova from the ade4 package. See amova for details.

Details

The poppr implementation of AMOVA is a very detailed wrapper for the ade4 implementation. The output is an amova class list that contains the results in the first four elements. The inputs are contained in the last three elements. The inputs required for the ade4 implementation are:
  1. a distance matrix on all unique genotypes (haplotypes)
  2. a data frame defining the hierarchy of the distance matrix
  3. a genotype (haplotype) frequency table.
All of this data can be constructed from a genind object, but can be daunting for a novice R user. This function automates the entire process. Since there are many variables regarding genetic data, some points need to be highlighted:

On Hierarchies:{The hierarchy is defined by different hierarchical levels that separate your data. In a genclone object, these levels are inherently defined in the hierarchy slot. For genind objects, these levels must be defined in a data frame located within the other slot. It is best practice to name this data frame "population_hierarchy".}

On Within Individual Variance:{ Heterozygosities within diploid genotypes are sources of variation from within individuals and can be quantified in AMOVA. When within = TRUE, poppr will split diploid genotypes into haplotypes and use those to calculate within-individual variance. No estimation of phase is made. This acts much like the default settings for AMOVA in the Arlequin software package. Within individual variance will not be calculated for haploid individuals or dominant markers.}

On Euclidean Distances:{ AMOVA, as defined by Excoffier et al., utilizes an absolute genetic distance measured in the number of differences between two samples across all loci. With the ade4 implementation of AMOVA (utilized by poppr), distances must be Euclidean (due to the nature of the calculations). Unfortunately, many genetic distance measures are not always euclidean and must be corrected for before being analyzed. Poppr automates this with three methods implemented in ade4, quasieuclid, lingoes, and cailliez. The correction of these distances should not adversely affect the outcome of the analysis.}

References

Excoffier, L., Smouse, P.E. and Quattro, J.M. (1992) Analysis of molecular variance inferred from metric distances among DNA haplotypes: application to human mitochondrial DNA restriction data. Genetics, 131, 479-491.

See Also

amova clonecorrect diss.dist missingno is.euclid sethierarchy

Examples

Run this code
data(Aeut)
agc <- as.genclone(Aeut)
agc
amova.result <- poppr.amova(agc, ~Pop/Subpop)
amova.result
amova.test <- randtest(amova.result) # Test for significance
plot(amova.test)
amova.test
amova.cc.result <- poppr.amova(agc, ~Pop/Subpop, clonecorrect = TRUE)
amova.cc.result
amova.cc.test <- randtest(amova.cc.result)
plot(amova.cc.test)
amova.cc.test

Run the code above in your browser using DataLab