Hi Rory, I am unable to control the text size for colAttributes in the annotation bar for dbaplot() or dba.plotHeatmap(). Can you or anyone please guide how should I do the same. Ill really appreciate your help. Thanks
Hi Rory, I am unable to control the text size for colAttributes in the annotation bar for dbaplot() or dba.plotHeatmap(). Can you or anyone please guide how should I do the same. Ill really appreciate your help. Thanks
The short answer is that you can't. The annotation bar is added using this block of code, from heatmap.3
:
if (!missing(ColSideColors)) {
if (!is.null(ColSideColors)) {
if (ncol(ColSideColors) == 1) {
par(mar = c(0.5, 0, 0, margins[2]))
image(cbind(1:nc), col = ColSideColors[, 1][colInd],
axes = FALSE)
axis(2, 0, colnames(ColSideColors)[1], las = 2,
tick = F)
}
else {
par(mar = c(0.5, 0, 0, margins[2]))
csc = ColSideColors[colInd, ]
csc.colors = matrix()
csc.names = names(table(csc))
csc.i = 1
for csc.name in csc.names) {
csc.colors[csc.i] = csc.name
csc[csc == csc.name] = csc.i
csc.i = csc.i + 1
}
csc = matrix(as.numeric(csc), nrow = dim(csc)[1])
image(csc, col = as.vector(csc.colors), axes = FALSE)
if (length(colnames(ColSideColors)) > 0) {
axis(2, 0:(dim(csc)[2] - 1)/(dim(csc)[2] -
1), colnames(ColSideColors), las = 2, tick = FALSE)
}
}
}
}
In particular the call to axis
(there's two axis
calls, depending on the number of annotations), which you will note doesn't have an ellipsis (...) argument, so you can't pass any variables in. And there is no cex.axis argument there to control the text size.
The long answer is 'well, fix it yourself if you really want it'. The beauty and the peril of Open Source software is that the code is available to everybody to do with as they see fit. It wouldn't take that much to download the sources to DiffBind and then add an ellipsis argument to that call to axis
and then add a cex.axis argument to your call to dba.plotHeatmap
.
The peril being that there may be other functions within dba.plotHeatmap
or pv.plotHeatmap
or any number of other helper functions that might also be able to do something with a cex.axis argument, which may have unintended consequences (the ellipsis argument allows you to pass arbitrary arguments to underlying functions - the problem being that any function that recognizes cex.axis as an argument will pick it up and use it). An alternative would be to add a specific argument to the function chain (say, 'omgfixthattextalready'), from dba.plotHeatmap
to pv.plotHeatmap
to heatmap.3
and finally that axis
call that is used to adjust the cex.axis
. The axis
call would then look like (using the first one as an example - you have to fix both).
axis(2, 0, colnames(ColSideColors)[1], las = 2, tick = FALSE, cex.axis = omgfixthattextalready)
Then just build and install, and voila!
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Kindly someone help, I am really stuck with this.