Hello, I have a matrix of the number of significant SNPs for different traits from different genomes. I want to show this information in the heatmap. So, I used the datamatrix and plotted the attached heatmap using the following code:
pheatmap(data_frame,cluster_rows = F, scale = "row",color = (colorRampPalette(c("navy", "white", "firebrick3"))(20),cluster_cols = F, fontsize_number = 8))
However, this does not show the actual information, rather it scales the number of SNPs and somehow over-represent the data. If I use scale="none"
then I get a very bad heatmap with very little differentiation according to the color. The problem is that I have big differences in my data. The number of SNPs is ranged from 1 to 180.
Is there any way to plot a heatmap by keeping the original data and use a log color scale to better visualize the data?
Please let me know.
Do you want to use ggplot2 or not? You say you have " big differences in my data" but the plot without scaling doesn't show them. If you use dendrogram to reorder the samples and genomes perhaps this will be seen. Otherwise perhaps heatmaps is not the right visualization method to show your differences or there might be an error or mistake on the method used to detect those differences.
Yes, I have used the
pheatmap
package in R. So, for some some traits, I have SNP number from 1-10 and for one trait I have the number from 170-180. If I scale it, then it does not show the real differentiation among the number of SNPs, does it?