image.DNAbin | R Documentation |
This function plots an image of an alignment of nucleotide sequences.
## S3 method for class 'DNAbin'
image(x, what, col, bg = "white", xlab = "", ylab = "",
show.labels = TRUE, cex.lab = 1, legend = TRUE,
grid = FALSE, show.bases = FALSE, base.cex = 1,
base.font = 1, base.col = "black", scheme = "Ape_NT", ...)
x |
a matrix of DNA sequences (class |
what |
a vector of characters specifying the bases to visualize. If missing, this is set to “a”, “g”, “c”, “t”, “n”, and “-” (in this order). |
col |
a vector of colours. If missing, this is set to “red”,
“yellow”, “green”, “blue”, “grey”, and “black”. If it is
shorter (or longer) than |
bg |
the colour used for nucleotides whose base is not among
|
xlab |
the label for the x-axis; none by default. |
ylab |
Idem for the y-axis. Note that by default, the labels of the sequences are printed on the y-axis (see next option). |
show.labels |
a logical controlling whether the sequence labels
are printed ( |
cex.lab |
a single numeric controlling the size of the sequence labels.
Use |
legend |
a logical controlling whether the legend is plotted
( |
grid |
a logical controlling whether to draw a grid ( |
show.bases |
a logical controlling whether to show the base symbols
( |
base.cex , base.font , base.col |
control the aspect of the base
symbols (ignored if the previous is |
scheme |
a predefined color scheme. For amino acid options are "Ape_AA", "Zappo_AA", "Clustal", "Polarity" and "Transmembrane_tendency", for nucleotides "Ape_NT" and"RY_NT". |
... |
further arguments passed to
|
The idea of this function is to allow flexible plotting and colouring of a nucleotide alignment. By default, the most common bases (a, g, c, t, and n) and alignment gap are plotted using a standard colour scheme.
It is possible to plot only one base specified as what
with a
chosen colour: this might be useful to check, for instance, the
distribution of alignment gaps (image(x, "-")
) or missing data
(see examples).
Emmanuel Paradis, Klaus Schliep
DNAbin
, del.gaps
, alex
,
alview
, all.equal.DNAbin
,
clustal
, grid
,
image.AAbin
data(woodmouse)
image(woodmouse)
rug(seg.sites(woodmouse), -0.02, 3, 1)
image(woodmouse, "n", "blue") # show missing data
image(woodmouse, c("g", "c"), "green") # G+C
par(mfcol = c(2, 2))
### barcoding style:
for (x in c("a", "g", "c", "t"))
image(woodmouse, x, "black", cex.lab = 0.5, cex.axis = 0.7)
par(mfcol = c(1, 1))
### zoom on a portion of the data:
image(woodmouse[11:15, 1:50], c("a", "n"), c("blue", "grey"))
grid(50, 5, col = "black")
### see the guanines on a black background:
image(woodmouse, "g", "yellow", "black")
### Amino acid
X <- trans(woodmouse, 2)
image(X) # default ape colors
image(X, scheme="Clustal") # Clustal coloring
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.