This is a test version of Biostars. For the public version, visit https://www.biostars.org.
cluster based on full dataset but only show heatmap for 4 genes

Hi,

I want to make a heat map with 4 genes across the samples but the dendrogram should be according to all 20k genes expression values.

The code for heat map is:

heatmap.2(data1, col=redgreen(75), Rowv = FALSE, Colv = FALSE, scale="row",dendrogram="none", trace="none", margin=c(20, 10))

And the code for making a separate complete dendrogram is:

dend contains log of the expression values of all genes across the samples.

d <- hclust(as.dist(1-cor(dend,method="pearson")), method="average")
plot(d)

I think the heat map.2 function can be used for this purpose? Creating the heat map based on 4 genes,but clustering based on all genes?

Thanks,
Ron

rna-seq cluster heatmap

1 answer

I used this command:

heatmap.2(data1, col=my_palette, Rowv = FALSE, Colv = as.dendrogram(d), scale="row",dendrogram="col", trace="none", margin=c(20, 10))

Log in to answer this question.