barcodeplot(statistics, index = NULL, index2 = NULL, gene.weights = NULL, weights.label = "Weight", labels = c("Up","Down"), quantiles = c(-1,1), col.bars = NULL, worm = TRUE, span.worm=0.45, ...)
statistics
or, in general, any vector such that statistic[index]
gives a subset of the statistic values.
Can be omitted if gene.weights
has same length as statistics
, in which case positive values of gene.weights
indicate to members of the positive set and negative weights correspond to members of the negative set.index
and index2
specify positive and negative genes respectively.
Usually used to distinguish down-regulated genes from up-regulated genes.index2
is non-null.gene.weights
.statistics
considered small or large respectively. Used to color the rectangle of the barcodeplot."black"
for one set or c("red","blue")
for two sets.
Defaults to semitransparent color for the bars inside the rectangle when variable gene weights are given which is intended to distinguish the positional bars from the weighted bars and also to show the density of the genes.plot
.The statistics are ranked left to right from largest to smallest. The ranked statistics are represented by a shaded bar or bed, and the positions of the specified subsets are marked by vertical bars, forming a pattern like a barcode. An enrichment worm optionally shows the relative enrichment of the vertical bars in each part of the plot.
Barcode plots are often used in conjunction with gene set tests, and show the enrichment of gene sets amongst high or low ranked genes. They were inspired by the set location plot of Subramanian et al (2005), with a number of enhancements, especially the ability to plot positive and negative sets simultaneously. Barcode plots first appeared in the literature in Lim et al (2009). More recent examples can be seen in Liu et al (2014).
The function can be used with any of four different calling sequences:
index
is specified, but not index2
or gene.weights
. Single direction plot.
index
and index2
are specified. Two directional plot.
index
and gene.weights
are specified. gene.weights
must have same length as statistics[index]
. Plot will be two-directional if gene.weights
contains positive and negative values.
gene.weights
is specified by not index
or index2
. gene.weights
must have same length as statistics
. Plot will be two-directional if gene.weights
contains positive and negative values.
Liu, GJ, Cimmino, L, Jude, JG, Hu, Y, Witkowski, MT, McKenzie, MD, Kartal-Kaess, M, Best, SA, Tuohey, L, Liao, Y, Shi, W, Mullighan, CG, Farrar, MA, Nutt, SL, Smyth, GK, Zuber, J, and Dickins, RA (2014). Pax5 loss imposes a reversible differentiation block in B progenitor acute lymphoblastic leukemia. Genes & Development 28, 1337-1350. http://www.ncbi.nlm.nih.gov/pubmed/24939936
Subramanian A, Tamayo P, Mootha VK, Mukherjee S, Ebert BL, Gillette MA, Paulovich A, Pomeroy SL, Golub TR, Lander ES, Mesirov JP (2005). Gene set enrichment analysis: a knowledge-based approach for interpreting genome-wide expression profiles. Proc Natl Acad Sci USA, 102, 15545-15550.
tricubeMovingAverage
, roast
, camera
, wilcox.test
stat <- rnorm(100)
sel <- 1:10
sel2 <- 11:20
stat[sel] <- stat[sel]+1
stat[sel2] <- stat[sel2]-1
# One directional
barcodeplot(stat, index = sel)
# Two directional
barcodeplot(stat, index = sel, index2 = sel2)
# Second set can be indicated by negative weights
barcodeplot(stat, index = c(sel,sel2), gene.weights = c(rep(1,10), rep(-1,10)))
# Two directional with unequal weights
w <- rep(0,100)
w[sel] <- runif(10)
w[sel2] <- -runif(10)
barcodeplot(stat, gene.weights = w, weights.label = "logFC")
# One directional with unequal weights
w <- rep(0,100)
w[sel2] <- -runif(10)
barcodeplot(stat, gene.weights = w, weights.label = "logFC", col.bars = "dodgerblue")
Run the code above in your browser using DataLab