I'm trying to generate a heatmap for almost 15,000 genes expression data across different samples. But they are grouped into clusters based on their similar expression across samples and I wanna represent the clusters vs samples rather than the genes vs samples (since they're like 15,000 genes) in the heatmap. Is there a way to do it? I know the melt function in R would help me plot the heat map in the way I want but I'm not sure how to implement it. I expect the heatmap to look something like this [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4489295/figure/F2/]. Thanks in advance.
I'm sorry if I was not clear, I already have my data grouped into clusters in an another column in the text file. So my input data would be Genes, Clusters, Sample1, Sample2, Sample3,...so I want clusters vs samples on the heatmap. The paper doesn't mentioned about the data which has already been clustered.
Can you provide me details of how you grouped them into clusters, because I wish to group my genes into cluster and also extract the gene set for each differentially bound clusters.
Hi. You can achieve this by calculating the cluster core/ medoid and using those as input into heatmap2 or whatever your preferred heatmap function would be.
I had this function from Michael Dunrop bookmarked to calculate the cores:
In the above, cutree generates clusters by cutting the gene dendrogram at 1.5. Replace clusters with whatever vector contains your cluster assignments.
Why not use the tool that produced that plot? I mean the figure itself is from the paper describing that tool.
I'm sorry if I was not clear, I already have my data grouped into clusters in an another column in the text file. So my input data would be Genes, Clusters, Sample1, Sample2, Sample3,...so I want clusters vs samples on the heatmap. The paper doesn't mentioned about the data which has already been clustered.
Can you provide me details of how you grouped them into clusters, because I wish to group my genes into cluster and also extract the gene set for each differentially bound clusters.
Provide your link. It's not there
Sorry about that, here is the link: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4489295/figure/F2/