nucleotideDiversity: Nucleotide Diversity
Description
Calculate nucleotide diversity for set of haplotypes.
Usage
nucleotideDiversity(x, bases = c("a", "c", "g", "t"), simplify = TRUE)
Arguments
x
a set of sequences or a '>gtypes object with sequences.
bases
nucleotides to consider when calculating diversity.
simplify
if TRUE
and only one loci exists, return a vector,
otherwise, a list of vectors with one element per locus will be returned.
Value
Vector of nucleotide diversity by site.
Examples
Run this code# NOT RUN {
data(dloop.g)
nd <- nucleotideDiversity(dloop.g)
quantile(nd)
# }
Run the code above in your browser using DataLab