hap.div {pegas}R Documentation

Haplotype Diversity

Description

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

Usage

hap.div(x, ...)
## S3 method for class 'haplotype'
hap.div(x, variance = FALSE, method = "Nei", ...)
## S3 method for class '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.

Details

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

Value

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

Author(s)

Emmanuel Paradis

References

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

See Also

nuc.div

Examples

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)

[Package pegas version 1.3 Index]