base.freq: Base frequencies from DNA Sequences

Description Usage Arguments Details Value Author(s) See Also Examples

Description

base.freq computes the frequencies (absolute or relative) of the four DNA bases (adenine, cytosine, guanine, and thymidine) from a sample of sequences.

Ftab computes the contingency table with the absolute frequencies of the DNA bases from a pair of sequences.

Usage

1
2
base.freq(x, freq = FALSE)
Ftab(x, y = NULL)

Arguments

x

a vector, a matrix, or a list which contains the DNA sequences.

y

a vector with a single DNA sequence.

freq

a logical specifying whether to return the proportions (the default) or the absolute frequencies (counts).

Details

The base frequencies are computed over all sequences in the sample. All missing or unknown sites are discarded from the computations.

For Ftab, if the argument y is given then both x and y are coerced as vectors and must be of equal length. If y is not given, x must be a matrix or a list and only the two first sequences are used.

Value

A numeric vector with names c("a", "c", "g", "t"), or a four by four matrix with similar dimnames.

Author(s)

Emmanuel Paradis

See Also

GC.content, seg.sites, nuc.div, DNAbin

Examples

1
2
3
4
5
6
data(woodmouse)
base.freq(woodmouse)
base.freq(woodmouse, TRUE)
Ftab(woodmouse)
Ftab(woodmouse[1, ], woodmouse[2, ]) # same than above
Ftab(woodmouse[14:15, ]) # between the last two

gjuggler/ape documentation built on May 17, 2019, 6:03 a.m.