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