alleleFreqs: Allele Frequencies

View source: R/alleleFreqs.R

alleleFreqsR Documentation

Allele Frequencies

Description

Calculate allele frequencies or proportions for each locus.

Usage

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

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


EricArcher/strataG documentation built on Feb. 12, 2023, 4:11 a.m.