nucleotideDiversity: Nucleotide Diversity

View source: R/nucleotideDiversity.R

nucleotideDiversityR Documentation

Nucleotide Diversity

Description

Calculate nucleotide diversity for set of sequences. Note that this is NOT Nei's nucleotide diversity (usually referred to as \pi). Nei's \pi is the mean number of nucleotide differences between sequences. See nucleotideDivergence for this value.

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 diversity of nucleotides by site.

Author(s)

Eric Archer eric.archer@noaa.gov

Examples

data(dloop.g)

nd <- nucleotideDiversity(dloop.g)
quantile(nd)


EricArcher/strataG documentation built on May 17, 2024, 12:41 p.m.