Learn R Programming

strataG (version 2.4.905)

baseFreqs: Base Frequencies

Description

Calculate nucleotide base frequencies along a sequence.

Usage

baseFreqs(x, bases = NULL, ignore = c("n", "x", "-", "."), simplify = TRUE)

Arguments

x

a '>gtypes object with aligned sequences or a list of aligned DNA sequences.

bases

character vector of bases. Must contain valid IUPAC codes. If NULL, will return summary of frequencies of observed bases.

ignore

a character vector of bases to ignore when calculating site frequencies.

simplify

if there is a single locus, return result in a simplified form? If FALSE a list will be returned wth one element per locus.

Value

For each gene, a list containing:

site.freqs a matrix of base frequencies at each site.
base.freqs a vector of overall base proportion composition.

Examples

Run this code
# NOT RUN {
data(dloop.g)
bf <- baseFreqs(dloop.g)

# Frequencies of first 10 sites
bf$site.freqs[, 1:10]

# Base composition
bf$base.freqs

# }

Run the code above in your browser using DataLab