pegas (version 0.12)

hap.div: Haplotype Diversity

Description

This function computes haplotype diversity from DNA sequences. This is a generic function.

Usage

hap.div(x, ...)
# S3 method for haplotype
hap.div(x, variance = FALSE, method = "Nei", ...)
# S3 method for DNAbin
hap.div(x, variance = FALSE, method = "Nei", ...)

Arguments

x

an object with DNA data.

variance

a logical value specifying whether to calculate the variance of the estimated haplotype diversity.

method

(unused, see details).

further arguments passed to and from methods.

Value

a numeric vector with one or two values (if variance = TRUE).

Details

Currently, only Nei and Tajima's (1981) method is available.

References

Nei, M. and Tajima, F. (1981) DNA polymorphism detectable by restriction endonuclease. Genetics, 97, 145--163.

See Also

nuc.div

Examples

Run this code
# NOT RUN {
data(woodmouse)
hap.div(woodmouse) # all haplotypes are unique

## neuraminidase sequences from the 2009 H1N1 data (delivered with adegenet):
fl <- system.file("files/pdH1N1-NA.fasta", package = "adegenet")
H1N1.NA <- read.dna(fl, "fasta")
hap.div(H1N1.NA, TRUE)
# }

Run the code above in your browser using DataLab