This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Make Visual Graphs To Represent Common Transcription Factor Binding Sites In Different Enhancers?

Hi all,

I have a file that has enhancers in 1st column and the name of transcription factor in 2nd column for which it has binding sites. I want to see this data visually so I can know which enhancers share similar transcription factor binding sites. How can I make a heatmap out of it? or any other visual graph that would allow me to do this?Because if i want to make a heatmap out of it, I'll have to make a table with enhancers in rows and transcription factors in columns and I cant do that manually as I have a huge data list. My data looks like this:

Enhancer        TF
Gene1_Enhancer1    Arid3a
Gene1_Enhnacer1    Ascl2
Gene1_Enhancer1 EBP
Gene1_Enhancer2    ETS1
Gene2_Enhancer1    ETS1
Gene2_Enhancer1    Hltf
Gene3_Enhancer1 Hoxa4
Gene3_Enhancer2    Hoxa7
Gene4_Enhancer1    Hoxa4

Thanks a lot!!!

r heatmap graphs transcription

1 answer

If you data are in a two-column data frame called "dat" with column names "Enhancer" and "TF", see how this works for you:

library(ggplot2)
ggplot(as.data.frame(table(dat)),aes(y=Enhancer,x=TF)) + geom_tile(aes(fill=factor(Freq))) + theme(legend.position = "none")

Output

Thanks a lot for your reply. I'm getting this error: Error in initFields(scales = scales) : could not find function "initRefFields"

sessionInfo() R version 2.14.0 (2011-10-31) Platform: i386-pc-mingw32/i386 (32-bit)

locale: [1] LCCOLLATE=EnglishUnited Kingdom.1252 LCCTYPE=EnglishUnited Kingdom.1252 LCMONETARY=EnglishUnited Kingdom.1252 [4] LCNUMERIC=C LCTIME=English_United Kingdom.1252

attached base packages: [1] grid stats graphics grDevices utils datasets methods base

other attached packages: [1] gplots2.11.0 MASS7.3-16 KernSmooth2.23-6 caTools1.14 gdata2.12.0 gtools2.7.0 ggplot2_0.9.3

loaded via a namespace (and not attached): Error in x[["Version"]] : subscript out of bounds In addition: Warning message: In FUN(c("bitops", "colorspace", "dichromat", "digest", "gtable", : DESCRIPTION file of package 'digest' is missing or broken

Yep. You'll need to upgrade R. The stackoverflow post I noted above applies to you.

Thanks a lot!!! it works!

Log in to answer this question.