Heatmap from the output of GSEA clusterProfiler?
1
0
Entering edit mode
Claudio • 0
@827deabc
Last seen 12 weeks ago
United States

I am running a GSEA analysis of differential expression of a deep sequencing RNA dataset, using the ClusterProfiler package in R.

myGSEA.res <- GSEA(mydata.gsea, TERM2GENE=hs_gsea_c2, verbose=FALSE)

myGSEA.df <- as_tibble(myGSEA.res@result)

I was able to obtain the table. However, I need to re-create a heatmap in R, similar to the one that I can obtain on the GSEA software, as shown on this link:

https://stackoverflow.com/questions/78883529/how-to-create-a-heatmap-from-the-output-of-gsea-clusterprofiler

clusterProfiler heatmaps • 1.1k views
ADD COMMENT
0
Entering edit mode

Would the heatmap be for the leading edge of a particular gene set? You can use the ComplexHeatmap package to make publication-quality heatmaps. Read the ComplexHeatmap Complete Reference to learn more. The general steps are as follows:

1) Assuming you have a matrix, x, of log2 expression data with samples as columns and genes as rows, subset the matrix to only those genes for a particular leading edge. Call this smaller matrix x2, for example.

2) Use Heatmap(x2, cluster_columns = FALSE) to create the basic heatmap. You will need to read through a few of the chapters in that reference book linked above to understand how things work.

3) To save the heatmap to a file, use the desired graphics device function, such as png(), draw the heatmap, and then close the graphics device with dev.off(). See this blog post for how to save a heatmap with specific cell and file dimensions.

ADD REPLY
0
Entering edit mode

In the GSEA software (Java software), there is a heatmap called "Heat Map of the Top 50 Features," which is the one I added to the link in the original post. Do you know how to reproduce that figure?

Also, from the GSEA output, how would you write the code to create the heatmap?

ADD REPLY
0
Entering edit mode

Based on GSEA User Guide and the original GSEA paper, the "top 50 features" are those that have the highest correlation with the phenotype of interest. As James MacDonald said, this has nothing to do with GSEA. Why not just use the GSEA software if you want to recreate the same output?

ADD REPLY
1
Entering edit mode
@james-w-macdonald-5106
Last seen 7 minutes ago
United States

The plot you show has nothing to do with GSEA! It's a heatmap of a set of genes, and GSEA is meant to identify over-represented genes based on some gene sets. The plot you show is literally a heatmap of the top 50 genes (which is how it's described). You can use ComplexHeatmap or pheatmap or whatever to generate that plot, using whatever data you used to generate your mydata.gsea object.

Login before adding your answer.

Traffic: 748 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