]> git.donarmstrong.com Git - ape.git/blob - man/image.DNAbin.Rd
26059de63ef713214a4e3ec7f97746460b20d021
[ape.git] / man / image.DNAbin.Rd
1 \name{image.DNAbin}
2 \alias{image.DNAbin}
3 \title{Plot of DNA Sequence Alignement}
4 \description{
5   This function plots an image of an alignment of nucleotide sequences.
6 }
7 \usage{
8 \method{image}{DNAbin}(x, what, col, bg = "white", xlab = "", ylab = "",
9        show.labels = TRUE, cex.lab = 1, legend = TRUE, ...)
10 }
11 \arguments{
12   \item{x}{a matrix of DNA sequences (class \code{"DNAbin"}).}
13   \item{what}{a vector of characters specifying the bases to
14     visualize. If missing, this is set to ``a'', ``g'', ``c'', ``t'',
15     ``n'', and ``-'' (in this order).}
16   \item{col}{a vector of colours. If missing, this is set to ``red'',
17     ``yellow'', ``green'', ``blue'', ``grey'', and ``black''. If it is
18     shorter (or longer) than \code{what}, it is recycled (or shortened).}
19   \item{bg}{the colour used for nucleotides whose base is not among
20     \code{what}.}
21   \item{xlab}{the label for the \emph{x}-axis; none by default.}
22   \item{ylab}{Idem for the \emph{y}-axis. Note that by default, the
23     labels of the sequences are printed on the \emph{y}-axis (see next option).}
24   \item{show.labels}{a logical controlling whether the sequence labels
25     are printed (\code{TRUE} by default).}
26   \item{cex.lab}{a single numeric controlling the size of the sequence labels.
27     Use \code{cex.axis} to control the size of the annotations on the \emph{x}-axis.}
28   \item{legend}{a logical controlling whether the legend is plotted
29     (\code{TRUE} by default).}
30   \item{\dots}{further arguments passed to
31     \code{\link[graphics]{image.default}} (e.g., \code{cex.axis}).}
32 }
33 \details{
34   The idea of this function is to allow fleixble plotting and colouring
35   of a nucleotide alignment. By default, the most common bases (a, g, c,
36   t, and n) and alignment gap are plotted using a standard colour
37   scheme.
38
39   It is possible to plot only one base specified as \code{what} with a
40   chosen colour: this might be useful to check, for instance, the
41   distribution of alignment gaps (\code{image(x, "-")}) or missing data
42   (see examples).
43 }
44 \author{Emmanuel Paradis}
45 \seealso{
46   \code{\link{DNAbin}}, \code{\link{del.gaps}}, \code{\link{clustal}},
47   \code{\link[graphics]{grid}}
48 }
49 \examples{
50 data(woodmouse)
51 image(woodmouse)
52 image(woodmouse, "n", "blue") # show missing data
53 image(woodmouse, c("g", "c"), "green") # G+C
54 par(mfcol = c(2, 2))
55 ### barcoding style:
56 for (x in c("a", "g", "c", "t"))
57     image(woodmouse, x, "black", cex.lab = 0.5, cex.axis = 0.7)
58 par(mfcol = c(1, 1))
59 ### zoom on a portion of the data:
60 image(woodmouse[11:15, 1:50], c("a", "n"), c("blue", "grey"))
61 grid(50, 5, col = "black")
62 ### see the guanines on a black background:
63 image(woodmouse, "g", "yellow", "black")
64 }
65 \keyword{hplot}
66