Not without hacking the code. If you look at the bottom of plotDEXSeq(), you will see
if (legend) {
mtext(paste(geneID, unique(sub$strand)), side = 3, adj = 0.25,
padj = 1.5, line = 0, outer = TRUE, cex = 1.5)
posforlegend <- seq(0.7, 0.9, length.out = numcond)
for (i in seq(along = color)) {
mtext(names(color[i]), side = 3, adj = posforlegend[i],
padj = 1.5, line = 0, outer = TRUE, col = color[i],
...)
}
}
else {
mtext(paste(geneID, unique(sub$strand)), side = 3, adj = 0.5,
padj = 1.5, line = 0, outer = TRUE, cex = 1.5)
}
And those calls to mtext() are hard-coding the gene ID as title. If you really care enough about having a different title, all you need to do is download the source tarball, modify that function to allow you to pass in an arbitrary title, build and install.
Something really simple and ad hoc would be to add an extra argument:
plotDEXSeq
function (object, geneID, FDR = 0.1, fitExpToVar = "condition",
norCounts = FALSE, expression = TRUE, splicing = FALSE, displayTranscripts = FALSE,
names = FALSE, legend = FALSE, color = NULL, color.samples = NULL,
main = NULL, ...)
And then right before the last bit of code, you could add
if(!is.null(main)){
mtext(main, side = 3, adj = 0.25, padj = 1.5, line = 0, outer = TRUE,
cex = 1.5)
} else {
if (legend) {
mtext(paste(geneID, unique(sub$strand)), side = 3, adj = 0.25,
padj = 1.5, line = 0, outer = TRUE, cex = 1.5)
posforlegend <- seq(0.7, 0.9, length.out = numcond)
for (i in seq(along = color)) {
mtext(names(color[i]), side = 3, adj = posforlegend[i],
padj = 1.5, line = 0, outer = TRUE, col = color[i],
...)
}
}
else {
mtext(paste(geneID, unique(sub$strand)), side = 3, adj = 0.5,
padj = 1.5, line = 0, outer = TRUE, cex = 1.5)
}
}
Thanks for the answer!
I will try your solution. I find it a bit weird that a custom title is not allowed for this plotting function.
Tim
This gives you a prime opportunity to (attempt to) contribute! Bioconductor packages are Open Source, after all, and Alejandro Reyes may be happy to incorporate a patched function (which is why I say 'attempt to' contribute - he might not be interested in a patch, but you can't know without trying).
You can check out the package from subversion using
Make your changes (you should copy the DEXSeq directory somewhere else to build and install, so you don't pollute the svn directory with extra files that are generated by the build process), and once you like how it works, you can go back to the svn DEXSeq directory and then do
And then send to Alejandro, with an explanation of why you think it is weird that you cannot change the plot title, and why you think your sweet patch should be incorporated. Et voila! Social coding, without github!