heatmap does not look like good
1
0
Entering edit mode
4 months ago

Hi, I tried make heatmap in R for data has 14637 obs. But my map is not look okay.

pheatmap(df1,
  display_numbers = F,
  color = colorRampPalette(c('black','red'))(100),
  cluster_rows = F,
  cluster_cols = F,
  fontsize_number = 6,
  border_color = NA,
  use_raster = TRUE)

That is my code I used.

enter image description here

That is the how heatmap look like, anyone can help me with this problem.

Thank you so much.

heatmap RNA-seq ngs • 905 views
ADD COMMENT
0
Entering edit mode

What do you want to do with this data? Any specific directions or thought process for analysis?

ADD REPLY
1
Entering edit mode

This is large data contain tau score. I converted data into matrix only contain 0 and 1 (value > 0.8 its equal to 1 if it's smaller than 0.8 it's equal to 0) and now I want to cluster data into two group and make heatmap for them.

ADD REPLY
1
Entering edit mode

When you performed clustering you can use cutree function to obtain any number of clusters you want. see here : Basically you save pheatmap output to new variable and use cutree to obtain clusters by value of k

ADD REPLY
0
Entering edit mode
4 months ago
Michael 54k

It is clear why your heatmap doesn't look good. You have too many rows. Heatmaps of over 100-200 rows are generally not useful for visualization because they are impossible to read. Reduce your data to the <100 genes most relevant to your scientific question in the geneset or choose a different visualization option.

Another issue is that you definitely need to turn on row clustering with cluster_rows = T on a smaller sample because an unordered heatmap completely defies its purpose.

ADD COMMENT
1
Entering edit mode

Thank you for answer, into data there's two type data. 0 and 1 I wanna make heatmap for value 1 but I'm still stuck on it. How can I reduce? I used rowsum() in r for remove the column contain only 0. But it's still too large. I was thinking about cluster data then make heatmap but I don't know how to cluster data.

ADD REPLY
1
Entering edit mode

I used cluster_rows = T, it does not work.

ADD REPLY
2
Entering edit mode

Possibly you have too many rows? Try to visualize a subset, like with df1[1:100, ] and see how that looks.

ADD REPLY
0
Entering edit mode

When I used as.data.frame(df1[1:100, ]) this code its look like that image

ADD REPLY
0
Entering edit mode

looks like what? Can you show an example, please? Also, could you please explain what your data come from?

ADD REPLY
0
Entering edit mode

Sorry I added picture but it does not showing. It looks like that, it's a matrix of 0 and 1. I wanna group them and then make heatmap. It's tau score of rna-seq data (value > 0.8 its equal to 1 if its smaller than 0.8 its equal to 0)

 data1_tau data2_tau data4_tau data3_tau data5_tau data6_tau data7_tau data8_tau data9_tau data10_tau
(gene)A1BG-AS1            0            0          0            0          0           1           0           0           0            0
ADD REPLY
1
Entering edit mode

The picture above is not the heatmap but your data seemingly. To group the rows you need to turn on row clustering in pheatmap, or try heatmap2 for testing. Your data looks binary (0,1), so I wouldn't expect shades between black and red. Please read the documentation of pheatmap carefully and try out some examples first.

Try this code: pheatmap(as.data.frame(df1[1:100, ]), display_numbers = F, color = c('black','red'), cluster_rows = TRUE, clustering_distance_rows = 'binary', cluster_cols = F, fontsize_number = 6, border_color = NA, use_raster = TRUE)

Edit: If your data is binary, there is no need for a color ramp palette, and distance method should be binary.

ADD REPLY

Login before adding your answer.

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