]> git.donarmstrong.com Git - ape.git/blob - man/base.freq.Rd
some big fixes for ape 2.7-1
[ape.git] / man / base.freq.Rd
1 \name{base.freq}
2 \alias{base.freq}
3 \alias{Ftab}
4 \title{Base frequencies from DNA Sequences}
5 \description{
6   \code{base.freq} computes the frequencies (absolute or relative) of
7   the four DNA bases (adenine, cytosine, guanine, and thymidine) from a
8   sample of sequences.
9
10   \code{Ftab} computes the contingency table with the absolute
11   frequencies of the DNA bases from a pair of sequences.
12 }
13 \usage{
14 base.freq(x, freq = FALSE, all = FALSE)
15 Ftab(x, y = NULL)
16 }
17 \arguments{
18   \item{x}{a vector, a matrix, or a list which contains the DNA
19     sequences.}
20   \item{y}{a vector with a single DNA sequence.}
21   \item{freq}{a logical specifying whether to return the proportions
22     (the default) or the absolute frequencies (counts).}
23   \item{all}{a logical; by default only the counts of A, C, G, and T are
24     returned. If \code{all = TRUE}, all counts of bases, ambiguous codes,
25     missing data, and alignment gaps are returned.}
26 }
27 \details{
28   The base frequencies are computed over all sequences in the
29   sample. All missing or unknown sites are discarded from the
30   computations.
31
32   For \code{Ftab}, if the argument \code{y} is given then both \code{x}
33   and \code{y} are coerced as vectors and must be of equal length. If
34   \code{y} is not given, \code{x} must be a matrix or a list and only
35   the two first sequences are used.
36 }
37 \value{
38   A numeric vector with names \code{c("a", "c", "g", "t")}, or a four by
39   four matrix with similar dimnames.
40 }
41 \author{Emmanuel Paradis}
42 \seealso{
43   \code{\link{GC.content}}, \code{\link{seg.sites}},
44   \code{\link{nuc.div}}, \code{\link{DNAbin}}
45 }
46 \examples{
47 data(woodmouse)
48 base.freq(woodmouse)
49 base.freq(woodmouse, TRUE)
50 Ftab(woodmouse)
51 Ftab(woodmouse[1, ], woodmouse[2, ]) # same than above
52 Ftab(woodmouse[14:15, ]) # between the last two
53 }
54 \keyword{univar}
55 \keyword{manip}