change the number of genes shown in the Heat map

38 views
Skip to first unread message

Maria Villa

unread,
Jul 31, 2024, 9:51:32 AM7/31/24
to gsea-help
Hello, from the ranked gene list after a comparison, the number of genes that are shown  by default in the heat map is the top-50 associated to each phenotype. Is is possible to change this number, so that the heat map shows, say,  55+55 genes?
I thought it was at "Number of markers" in "Advanced fields", but I have tried and it gave the same heat map.
Thanks a lot in advance.
María.

Anthony Castanza

unread,
Jul 31, 2024, 2:50:01 PM7/31/24
to gsea-help
Hi Maria,

Unfortunately there isn't a parameter to adjust the genes plotted in the global top feature heatmap.
The "Number of Markers" parameter only affects the "Butterfly plot of significant genes" graphic. Perhaps we can consider a feature request to expand the functionality of this parameter in the future, but I don't know if or when we'd be able to do so.
That said, the GSEA heatmap here is reasonably straightforward to reproduce, if you're reasonably familiar with a programming environment like python or R, or even in Excel. 

If you used a chip file to perform a dataset collapse in your run, reload the data and provide it to the "Collapse Dataset" tool, this will produce a gct file in the same gene symbols namespace as your results.

If you're using R or Python you can then get the "[datasetname]_collapsed_to_symbols.rnk" file from the edb folder of your results.
Use the ranking data from this file to order the expression data from the gct file.

If you're using Excel, instead it's easier to recompute the ranking metric using the formula for a given metric on the GSEA user guide page: https://www.gsea-msigdb.org/gsea/doc/GSEAUserGuideTEXT.htm#_Metrics_for_Ranking
then sort the genes by the ranking metric.

Now you have a matrix where your genes are sorted by their GSEA ranking metric.
Next, the heatmap display for GSEA is row-normalized, so you need to compute a value that is 1-0 scaled where 1 is the max value for that row and 0 is the minimum value.

This sorted, row-normalized, matrix is the underlying data for the heatmap. Assign a red-blue colorscale (or colorscale of your choice) and you're done

Let me know if you have any questions!

-Anthony

Anthony S. Castanza, PhD
Curator, Molecular Signatures Database
Mesirov Lab, Department of Medicine
University of California, San Diego


Reply all
Reply to author
Forward
0 new messages