Heatmap problem in R
2
0
Entering edit mode
2 days ago
ParastooA • 0

Hi, good day.

I am using Matrix_Series file from GEO and I've been working on it for 7 hours straight; no matter what I do the heatmap looks like this and I can't prevent the overlap in genes names. please help:(

enter image description here

R Heatmap • 317 views
ADD COMMENT
3
Entering edit mode

Generally, you need to increase the heatmap/cell height or decrease the size of the row labels to get them readable. However, it's a little more involved, but it may be easier to explore these by grouping the rows into a set number of clusters (e.g. cuttree) and export the genes and clusters to a table.

ADD REPLY
0
Entering edit mode

I get that you are desperate, but in order to get help, we would at least need to know what package you use for plotting the heatmap and ideally also see the relevant code that does the preprocessing and plotting.

Generally speaking, I do not think that there is really a problem with your heatmap. Evidently, there are a lot of features and most heatmaps in publications do not display all, but only the most relevant. Hence, you rather need to think conceptually about what you want to show rather than trying to find a visualization that can accommodate ten thousand features.

ADD REPLY
0
Entering edit mode

Thanks everyone. yesturday I was a little overwhelmed and now I see your point about sharing the code.

ADD REPLY
0
Entering edit mode

Just another question If I want to perferm a data cleaning on Matrix_ series what elements should I consider for doing so?

ADD REPLY
3
Entering edit mode
2 days ago
S.Ghazala ▴ 60

Gene expression matrix are usually large, which causes overlapping gene names in heatmap and other plots. Following are few ways to improve clarity of your figure and make it readable:

  1. Reduce the number of genes to be displayed (if visualizing all genes, consider filtering to show only the highly variable genes)

    library(genefilter)
    # Select top 200-500 most variable genes
    filtered_matrix <- your_matrix[order(rowVars(your_matrix), decreasing = TRUE)[1:200], ]
    
  2. Adjust figure size (here in your plot, increasing height may help)

    #use base R heatmaps, increase pdf() or png() output size
    png("heatmap.png", width = 2000, height = 3000, res = 300)    # modify values as required 
    heatmap(your_matrix)
    dev.off()
    
ADD COMMENT
1
Entering edit mode
1 day ago

You can't show gene names, that's all. There's probably some setting like "show_row_names = FALSE". No one can help you without the code you are using.

If you want to see gene names, you have to pick a set of, say, 20 genes, and just show those.

At the top there, is that a whole bunch of genes with the exact same expression across all the samples? Does that make sense?

For what it's worth, I'm not sure what your heatmap is supposed to be showing. Different samples look different. But the samples don't necessarily have any pattern of shared DE genes that looks informative or interesting. Just because you can make a visualization doesn't mean it is worth looking at.

ADD COMMENT

Login before adding your answer.

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