Hi Dataminer
I recently created a similar figure (not quite the same but the code should be adaptable I think) after using clover for TFBS enrichment analysis for a group of regulated genes. My code uses ggplot2 in R and plots each interaction (TF (y axis) - gene (x axis)) as a square with the number of hits for that TF in the promoter of the gene shown by the colour of the square.
You should be able to adapt the code to show distance from TSS for each gene pretty easily (just put different numbers in the relevant column which was Hits in my data)
The plot:
p3 <- ggplot() + geom_point(data = tfHits, aes(symbol, TF, colour = Hits), shape=15, size = 4)
p3 <- p3 + scale_colour_gradient(low = "cornflowerblue", high = "firebrick") + opts(panel.background = theme_blank(), legend.position = "right", axis.title.x = theme_blank(), axis.title.y = theme_blank(), axis.text.x = theme_text(angle = 90, hjust=1, size=6), axis.text.y = theme_text(colour = "black"), axis.ticks = theme_blank())
The data - a dataframe with 3 columns: TF in first, gene (symbol) in second and distance to TSS in third. I would show an excerpt of my data but I can't work out how to get a 'table' into the text here - hey ho.
You can do a similar plot in ggplot2 with the 'tiles' geom:
p2 <- ggplot(tfHits, aes(TF, symbol)) + geom_tile(aes(fill=Hits))
p2 <- p2 + scale_fill_gradient2(name='Hits', low="#0571B0", mid="#F7F7F7", high="#CA0020", midpoint=20, trans="identity")
p2 <- p2 + labs(x = "TF", y = "Gene") + opts(axis.ticks = theme_blank(), axis.text.x = theme_text(size = 10, angle = 90, hjust = 1, colour = "grey25"), axis.text.y = theme_text(size=5, colour = 'gray25'))
Personally I prefer the squares. Of course this won't do any kind of clustering - I don't know if that's important to you but you could reorder the dataframe passed in by some dendrogram order etc etc.
HTH
duff
How do you plan to get the extra dimension for heatmap? Wouldn't it just be a histogram chunked by distance?
Hi brent, I was expecting your comment. Actually I saw a heatmap in few articles depicting the same "Examination of transcriptional network reveals an important role for TCFAP2C, SMARCA4, and EOMES in trophoblast stem cell maintenance"-Benjamin L. Kidder. I am very curious to know how these people do it? But anyway, you tell me what is the best way to do this and how it can be done? You can also look at this link http://genome.cshlp.org/content/21/2/245/F2.expansion.html Thank you
which figure exactly? and what are the axes?
please have a look at this figure http://genome.cshlp.org/content/21/2/245/F2.expansion.html here they have used multiple TFs