X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=man%2Fbase.freq.Rd;h=56a5e2e7f39774a22eff64aea8cba6e84de2b399;hb=40eeb40e48bccc220826860ce0ada4521cbc0148;hp=3847d9cf20c522fc1893048815fd00a76dfe7059;hpb=c827059eeafc8cbe41c812b26979543ab287803e;p=ape.git diff --git a/man/base.freq.Rd b/man/base.freq.Rd index 3847d9c..56a5e2e 100644 --- a/man/base.freq.Rd +++ b/man/base.freq.Rd @@ -1,30 +1,55 @@ \name{base.freq} \alias{base.freq} +\alias{Ftab} \title{Base frequencies from DNA Sequences} +\description{ + \code{base.freq} computes the frequencies (absolute or relative) of + the four DNA bases (adenine, cytosine, guanine, and thymidine) from a + sample of sequences. + + \code{Ftab} computes the contingency table with the absolute + frequencies of the DNA bases from a pair of sequences. +} \usage{ -base.freq(x) +base.freq(x, freq = FALSE, all = FALSE) +Ftab(x, y = NULL) } \arguments{ \item{x}{a vector, a matrix, or a list which contains the DNA sequences.} -} -\description{ - This function computes the relative frequencies (i.e. percentages) of - the four DNA bases (adenine, cytosine, guanine, and thymidine) from a - sample of sequences. + \item{y}{a vector with a single DNA sequence.} + \item{freq}{a logical specifying whether to return the proportions + (the default) or the absolute frequencies (counts).} + \item{all}{a logical; by default only the counts of A, C, G, and T are + returned. If \code{all = TRUE}, all counts of bases, ambiguous codes, + missing data, and alignment gaps are returned.} } \details{ The base frequencies are computed over all sequences in the sample. All missing or unknown sites are discarded from the computations. + + For \code{Ftab}, if the argument \code{y} is given then both \code{x} + and \code{y} are coerced as vectors and must be of equal length. If + \code{y} is not given, \code{x} must be a matrix or a list and only + the two first sequences are used. } \value{ - A numeric vector stoting the relative frequencies with names - \code{c("a", "c", "g", "t")}. + A numeric vector with names \code{c("a", "c", "g", "t")}, or a four by + four matrix with similar dimnames. } -\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}} +\author{Emmanuel Paradis} \seealso{ \code{\link{GC.content}}, \code{\link{seg.sites}}, \code{\link{nuc.div}}, \code{\link{DNAbin}} } +\examples{ +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 +} \keyword{univar} +\keyword{manip}