Description Usage Arguments Details Value Examples
A function for plotting out the pdfs of a set of pathways.
1 2 3 4 5 6 7 8 9 10 11 12 |
QSarray |
QSarray object |
path.index |
vector describing which pathways to plot. Can either be numeric or a character vector containing the names of the pathways to plot. |
zeroLine |
a logical indicating whether to include a vertical line at 0. |
addVIF |
a logical indicating whether the VIF should be used to calculate the variance of the pathway. |
col |
the color of the curves. Can be a vector of the same length as path.index specifying the color of each individual curve. |
plot |
Logical indicating whether to create the plot. If |
add, xlim, ylim, xlab, ylab, type, ... |
parameters to be passed on to |
This function uses the data produced by aggregateGeneSet to plot the PDFs of the pathways in QSarray. By default, plotDensityCurves
will plot a curve for each pathway in the QSarray pathway, but this behavior can be controlled by the path.index
parameter. For the best plots, it is suggested that you limit the number of curves plotted to below ten.
Invisibly returns a list of the same length as path.index, where each entry is a matrix of x- and y-coordinates for that pathway.
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 | ##create example data
eset = matrix(rnorm(500*20),500,20, dimnames=list(1:500,1:20))
labels = c(rep("A",10),rep("B",10))
##genes 1:30 are differentially expressed
eset[1:30, labels=="B"] = eset[1:30, labels=="B"] + 1
geneSets = list(diff.set=1:30, base.set=31:60)
##Run qusage
set.results = qusage(eset, labels, "B-A", geneSets)
##Plot results
plotDensityCurves(set.results)
##plot just the first curve with a different color
plotDensityCurves(set.results, path.index=1, col=2, lwd=2)
##plot the CDFs of the curves
coords = plotDensityCurves(set.results, plot=FALSE)
plot(0, type="n", xlim=c(-1,2),ylim=c(0,1),xlab="x",ylab="CDF")
for(i in 1:length(coords)){
points = coords[[i]]
x = points$x
y = cumsum(points$y)/sum(points$y)
lines(x,y,col=i)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.