This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GSEA /enrichment plot with heat map

Hi guys,

I am wondering if its possible to build GSEA enrichment plots and heat maps of the same scale, exactly as it's done on the paper (Fig 1. Gene set enrichment analysis: a knowledge-based approach for interpreting genome-wide expression profiles./Subramanian A http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1239896/figure/fig1/)

I produced enrichment plots with javaGSEA Desktop Application, but I would like to have a heatmap scaled to gene set. (Fig2 at http://www.jbc.org/content/285/18/13742.full)

Thank you

rna-seq

Thank you,

may be I am asking a nonsense question.... ;)

but I would like to show visually a correlation of gene sets (I have three of them) to a heat map. So I would have a heat map and then three gene sets beside. I thought may be there is a R function which will help me to make it correctly and at the right scale.However, more I search for this, more I think that it is just an image editing work without any functions ;). Probably guys from mentioned above publications, just took a heat map, than transposed enrichment plot (may be made it bigger or smaller) and presented together. ;)

and I am breaking my head how I can do it in R ;))))))

Correct me if I am wrong... You want to make a heatmap and present next to it three bars, where you indicate if a gene is in a certain gene set or not?

Like I said before, you can use heatmap.2 in R. You'll have to label all the genes for each gene set (present or not), so 3 separate labels (vectors) and use them for RowSideColors.

yeah, you understood me correctly.

So you are suggesting the following (just a dummy small example):

heat_map_matrix=replicate(10,rnorm(10))    # basically its my Gen.Expr values

# According to heatmap.2 documentation:
# Create a character vector of length nrow(x) containing the color names for a vertical side bar
# Let's say I color present genes from my gene set in "Green" color, and absent genes in "Red" color

labeled_gene_set=c('red','green','red','red','red','green','red','green','red','red')

heatmap.2(heat_map_matrix, RowSideCol=labeled_gene_set, Rowv=F, Colv=T)

SO I will get a heat map and beside a colored line whether a green color indicates a presence of the gene (from gene list) and red - absence.

Its not exactly what I was looking for, but its a good solution as well.It was a perfect solution in case the RowSideCol would be just a vector of values.

However I am wondering how would you plot three gene sets beside each other, I managed only one (labeled_gene_set).

1 answer

You can use heatmap.2 in R from library(gplots), it has a RowSideColors option for sidebars.

Log in to answer this question.