Description Usage Arguments Author(s) Examples
Plots a horizontal barchart of strictly positive values in x. For each entry, a vector of additional values needs to be provided in a list. The additional values are plotted as cells subdividing the length of the corresponding bar. A typical usage scenario is plotting the enrichment of Gene Ontology terms, with individual cells reflecting the differential regulation of the constituent genes.
1 2 3 4 5 6 7 8 | cell.plot(x, cells, x.col = NULL, cell.col = c("deepskyblue2", "white",
"coral"), inf.shading = 30/cell.lwd, space = 0.1, x.mar = c(0.2, 0),
y.mar = c(0.1, 0), x.bound = NULL, lab.cex = 1, xdes.cex = 1,
xlab.cex = 1, xlab.ticks = 5, sym = FALSE, cell.lwd = 2,
cell.outer = 2, cell.sort = T, cell.limit = 30, cell.bounds = NULL,
elem.bounds = NULL, xlab = "GO Term Enrichment", key = T,
key.lab = "Differential Expression", key.n = 11, spacers = NULL,
bar.scale = 1, gridlines = T, ...)
|
x |
Strictly positive numeric vector. |
cells |
List of vectors. Must be the same length as x. |
x.col |
Vector of color names. Must be the same length as x. Defaults to black. |
cell.col |
Character vector of length 3, specifying colors for the low end, zero, and high end of cell values. Defaults to c("blue","white","red"). |
inf.shading |
Numeric. Density of shading lines for infinite values. Defaults to 30/cell.lwd. |
space |
Scaling factor for spacing between bars. |
x.mar |
Numeric vector defining the inside margin to the left and right of the main plot. Defaults to c(0.2,0.1). |
y.mar |
Numeric vector defining the inside margin to the top and bottom of the main plot. Defaults to c(0.08,0). |
x.bound |
Numeric, must be positive. Specifies upper bound of x-axis scale. If NULL (the default), this value is chosen automatically. |
lab.cex |
Scaling factor for label text size. |
xdes.cex |
Scaling factor for key legend text size. |
xlab.cex |
Scaling factor for x-label text size. |
xlab.ticks |
Number of ticks for the x-axis.. |
sym |
Logical, if |
cell.lwd |
Size of the border of individual cells. Defaults to 1. |
cell.outer |
Size of outer border around bars. Defaults to 2. |
cell.sort |
Should cell values be sorted? Defaults to TRUE. |
cell.limit |
Number of cells above which separators between cells are omitted. Defaults to 50. |
cell.bounds |
Numeric vector of length 2, specifying lower and upper bound for cell value visualization. If set to NULL (the default), these values are chosen automatically. |
elem.bounds |
Vector of length 2 specifying a filter on minimum and maximum number of elements in a category. Defaults to NULL, in which case no filter is applied. |
xlab |
Label for x-axis. |
key |
Logical value. Show the key/legend for the cell colors. |
key.lab |
Label for color key. |
key.n |
Number of legend boxes for the color key. Minimum is 3 (5 when infinite values are present). |
spacers |
Numeric vector. Inserts empty space after the specified positions to visually group bars. |
bar.scale |
Numeric. Set bar height to a fixed value multiplied by this parameter. If the plotting area is too small clipping may occur. |
gridlines |
Logical value, if to show vertical grid lines. |
... |
Arguments passed through to the title() function. E.g. main = "Plot title". |
Robert Sehlke [aut]
Sven E. Templer [ctb]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## Not run:
### Random data example
# Generate random positive vector and name it
x = sort( runif(16, min = 1, max = 3), decreasing = T )
names(x) = paste("GO Term",1:16)
# Label colors
xcolor = c(rep("darkslategrey",4), rep("chartreuse4",4), rep("coral4",8))
# Generate list with random vectors, one for each entry in x
cells = list()
xc = round( runif(16, min=21, max=100) )
for (i in 1:length(xc)) { cells = c(cells, list(runif(xc[i],-5,5))) }
cells[[9]][1:2] = Inf
cells[[9]][3] = -Inf
# Plot with spacers
cell.plot( x, cells,
xcolor, spacers = c(4,8), xlab.ticks = 5, cell.limit = 80,
main="Cell Plot Demo", xlab="log(enrichment)" )
### golubstat data example
data(golubstat)
x <- subset(golubstat, p<=.05 & significant>4 & !duplicated(genes))
x <- head(x, 10)
cell.plot( x = setNames(x$loge, x$term), cells = x$deg.log2fc,
main = "Golub et al. (1999) - Gene Ontology Enrichment" )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.