alleleFreqs: Allele Frequencies

Description Usage Arguments Value Note Author(s) Examples

View source: R/alleleFreqs.R

Description

Calculate allele frequencies or proportions for each locus.

Usage

1
alleleFreqs(g, by.strata = FALSE, type = c("freq", "prop"))

Arguments

g

a gtypes object.

by.strata

logical determining if results should be returned by strata?

type

return counts ("freq") or proportions ("prop")

Value

A list of allele frequencies for each locus. Each element is a vector (by.strata = FALSE) or matrix (by.strata = TRUE) with the frequency or proportion of each allele.

Note

If g is a haploid object with sequences, the function will run labelHaplotypes if sequences aren't already grouped by haplotype. The gtypes object used with haplotype assignments and unassigned individuals will be stored in attr(*, "gtypes").

Author(s)

Eric Archer eric.archer@noaa.gov

Examples

1
2
3
4
5
6
7
data(msats.g)

f <- alleleFreqs(msats.g)
f$D11t # Frequencies for Locus D11t

f.pop <- alleleFreqs(msats.g, TRUE, "prop")
f.pop$EV94[, "Coastal"] # Proportions of EV94 alleles in the Coastal population

strataG documentation built on Feb. 28, 2020, 9:07 a.m.