barcodeplot(statistics, index = NULL, index2 = NULL, gene.weights = NULL,
            weights.label = "Weight", labels = c("Up","Down"),
            quantiles = c(-1,1)*sqrt(2), col.bars = NULL, alpha = 0.4,
            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.gene.weights are not NULL, values 0 give semitransparent colors for the vertical bars inside the rectangle.  This helps distinguish position bars from the weighted bars and also helps to show the density of the bars when there are many bars.  Ignored if gene.weights=NULL. plot.indexis specified, but notindex2orgene.weights.  Single direction plot.indexandindex2are specified.  Two directional plot.indexandgene.weightsare specified.gene.weightsmust have same length asstatistics[index].  Plot will be two-directional ifgene.weightscontains positive and negative values.gene.weightsis specified by notindexorindex2.gene.weightsmust have same length asstatistics.  Plot will be two-directional ifgene.weightscontains positive and negative values.tricubeMovingAverage, roast, camera, romer, geneSetTest
There is a topic page on 10.GeneSetTests.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