]> git.donarmstrong.com Git - ape.git/blob - man/base.freq.Rd
bef852991d3c322fce28f83d32895196edfd1361
[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)
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 }
24 \details{
25   The base frequencies are computed over all sequences in the
26   sample. All missing or unknown sites are discarded from the
27   computations.
28
29   For \code{Ftab}, if the argument \code{y} is given then both \code{x}
30   and \code{y} are coerced as vectors and must be of equal length. If
31   \code{y} is not given, \code{x} must be a matrix or a list and only
32   the two first sequences are used.
33 }
34 \value{
35   A numeric vector with names \code{c("a", "c", "g", "t")}, or a four by
36   four matrix with similar dimnames.
37 }
38 \author{Emmanuel Paradis}
39 \seealso{
40   \code{\link{GC.content}}, \code{\link{seg.sites}},
41   \code{\link{nuc.div}}, \code{\link{DNAbin}}
42 }
43 \examples{
44 data(woodmouse)
45 base.freq(woodmouse)
46 base.freq(woodmouse, TRUE)
47 Ftab(woodmouse)
48 Ftab(woodmouse[1, ], woodmouse[2, ]) # same than above
49 Ftab(woodmouse[14:15, ]) # between the last two
50 }
51 \keyword{univar}
52 \keyword{manip}