3 \title{Plot of DNA Sequence Alignement}
5 This function plots an image of an alignment of nucleotide sequences.
8 \method{image}{DNAbin}(x, what, col, bg = "white", xlab = "", ylab = "",
9 show.labels = TRUE, cex.lab = 1, legend = TRUE, ...)
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
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}).}
34 The idea of this function is to allow flexible 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
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
44 \author{Emmanuel Paradis}
46 \code{\link{DNAbin}}, \code{\link{del.gaps}}, \code{\link{alex}},
47 \code{\link{clustal}}, \code{\link[graphics]{grid}}
52 image(woodmouse, "n", "blue") # show missing data
53 image(woodmouse, c("g", "c"), "green") # G+C
56 for (x in c("a", "g", "c", "t"))
57 image(woodmouse, x, "black", cex.lab = 0.5, cex.axis = 0.7)
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")