Description Usage Arguments Author(s) Examples
Plots a split barchart, showing the proportions of two mutually exclusive sets in relation to a set containing them both. E.g., Gene Ontology terms, showing the proportions of differentially down-regulated and up-regulated annotated genes from a perturbation experiment. The color of the central column elements maps to the value provided in x (e.g. GO term enrichment). Associated genes may be provided as a list of vectors of expression values, same as for cell.plot(), or as separate vectors x.up and x.down, providing the numbers of up- and down-regulated genes in the same order as x.
1 2 3 4 5 6 7 8 | sym.plot(x, cells = NULL, x.annotated, x.up = NULL, x.down = NULL,
x.col = NULL, sort = F, main = "", elem.bounds = NULL,
x.mar = c(0.2, 0), y.mar = c(0.2, 0), bar.lwd = 2, bar.scale = NULL,
space = 0.1, mid.gap = 0.1, mid.bounds = NULL, mid.col = c("white",
"darkred"), key.lab = "GO Term Enrichment", key.n = 11,
cols = c("deepskyblue2", "coral"), group.labels = c("Downregulated",
"Annotated", "Upregulated"), group.cex = 0.8, axis.cex = 0.8,
mid.cex = 0.8, lab.cex = 1, ticksize = 10, x.bound = NULL, ...)
|
x |
Strictly positive numeric vector. |
cells |
List of vectors (e.g. gene logfold-changes). Must be the same length and order as x. |
x.annotated |
Cardinality of each functional set (e.g. total number of genes annotated in a given GO term). Must be the same length and order as x. |
x.up |
Vector containing numbers of up-regulated genes in each functional set. Must be the same length and order as x. Overridden by the cells parameter, if provided. |
x.down |
Vector containing numbers of down-regulated genes in each functional set. See x.up. |
x.col |
Vector of color names. Must be the same length as x. Defaults to black. |
sort |
Sort categories by their cardinality. Defaults to FALSE. |
main |
Title. |
elem.bounds |
Vector of length 2 specifying a filter on minimum and maximum number of elements in both categories combined. Defaults to NULL, in which case no filter is applied. |
x.mar |
Left and right margins as fractions of plot width. Defaults to c(0.2,0.05). |
y.mar |
Top and bottom margins as fractions of plot height. Defaults to c(0.1,0). |
bar.lwd |
Line width of bar elements. Defaults to 2. |
bar.scale |
If not NULL (the default), set bar height to a fixed value relative to the numeric factor provided. Use to ensure consistency across plots with varying numbers of elements. |
space |
Free space above and below bars as a fraction of bar height. Defaults to 0.1. |
mid.gap |
Free space left between the extremes of the central column and the bar elements, as a fraction of central column width. Defaults to 0.1. |
mid.bounds |
Lower and upper bound on the color scale mapping of the central column (i.e. mapping of x). Defaults to c(0, max(x)). |
mid.col |
Color scale for mapping of x to the central column elements. Defaults to c("white","darkred"). |
key.lab |
Label for color key. |
key.n |
Number of legend boxes for the color key. Defaults to 11. |
cols |
Colors for left and right bars. Defaults to c("deepskyblue2","coral"). |
group.labels |
Labels for left bars, central column, and right bars. Defaults to c("Downregulated","Annotated","Upregulated"). |
group.cex |
Scaling factor for group labels. Defaults to 0.8. |
axis.cex |
Scaling factor for axis labeling. Defaults to 0.8. |
mid.cex |
Scaling factor for central column labeling. Defaults to 0.8. |
lab.cex |
Scaling factor for functional group labels. Defaults to 1. |
ticksize |
Spacing between x-axis ticks. Defaults to 10. |
x.bound |
x.bound Numeric, must be positive and <= 100. Specifies upper bound of x-axis scale (in percent). If NULL (the default), this value is chosen automatically. |
... |
Other arguments, ignored. |
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 33 | ## 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
cells.annotated <- sapply(cells, length)
# Plot with spacers
sym.plot( x, cells, cells.annotated,
xcolor, spacers = c(4,8), xlab.ticks = 5, cell.limit = 80,
main="Cell Plot Demo", xlab="log(enrichment)" )
### golub.deg data example
data(golubstat)
x <- subset(golubstat, p<=.05 & significant>4 & !duplicated(genes))
x <- head(x, 10)
sym.plot( x = setNames(x$loge, x$term), cells = x$deg.log2fc, x.annotated = x$annotated,
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.