how to draw multiple heatmap from GeneOverlap
1
0
Entering edit mode
C T ▴ 140
@c-t-5858
Last seen 13 months ago
United States

Hi,

Does anyone knows how to put two heatmaps (generated from GeneOverlap package) side-by-side?

These are the code to produce one heatmap:

library(GeneOverlap)
data(GeneOverlap)
gom.obj <- newGOM(hESC.ChIPSeq.list, genome.size=gs.RNASeq)
drawHeatmap(gom.obj, adj.p=TRUE, cutoff=1,  # show all.
    ncolused=5, grid.col="Blues", note.col="black")
drawHeatmap(gom.obj, log.scale=TRUE, ncolused=5)
drawHeatmap(gom.obj, what="Jaccard", ncolused=5)

Thank you in advance for your help.

GeneOverlap multiple figures heatmap • 180 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 hours ago
United States

The heatmaps in GeneOverlap are generated using heatmap.2 from the gplots package, which uses base graphics. The canonical way to make side-by-side plots in base graphics is to use layout, or you could use split.screen or par(mfrow = 2). You can play around with settings to make things look less squished (which they almost certainly will, until you do so).

ADD COMMENT
0
Entering edit mode

Hi James,

Thanks for your comment. I'm not familiar with layout but I tried par(mfrow=c(1,2)) it doesn't work. This still plot the heatmaps on different pages.

ADD REPLY
0
Entering edit mode

Ah, you know what? I forgot that heatmap.2 already calls layout, so you won't be able to do what you want, at least within R, using drawHeatmap.

An alternative would be to use ComplexHeatmap or pheatmap instead. You will probably have to figure out what drawHeatmap does, exactly, in order to generate something comparable on your own. But that's the promise and the peril of Open Source software. All the code is there and available, so you can do what you want. But only if you are willing and able to figure out how to do what you want, given what you have.

ADD REPLY

Login before adding your answer.

Traffic: 345 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6