1 | densityplot_oligo(ds, strt = NULL, nd = NULL, lab, parameters)
|
ds |
|
strt |
|
nd |
|
lab |
|
parameters |
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 34 35 36 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (ds, strt = NULL, nd = NULL, lab, parameters)
{
if (is.null(strt) & is.null(nd)) {
strt <- 1
nd <- length(lab)
}
else if (is.null(strt)) {
strt <- 1
}
else if (is.null(nd)) {
nd <- length(lab)
}
rwData <- log2(exprs(ds))
yvalues <- apply(rwData, 2, function(x) ceiling(max(density(x)$y)))
colors <- rainbow(nd - strt + 1)
plot(density(rwData[, strt]), col = colors[1], main = paste("Samples",
strt, "to", nd), xlab = "log2(y)", ylim = c(0, max(yvalues)),
lty = strt, ylab = "")
for (e in (strt + 1):nd) {
lines(density(rwData[, e]), col = colors[(e - strt) +
1], lty = e)
}
if (length(lab) < 15) {
legend("topright", legend = lab, cex = 0.6, col = colors[1:nd],
lty = strt:nd, lwd = 1.6)
}
else {
legend("topright", legend = lab, cex = parameters$ce,
col = colors[1:nd], lty = strt:nd, lwd = 1.6)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.