Entering edit mode
6.8 years ago
Björn
▴
110
Using following heatmap.2 command
heatmap.2(highly_variable_lcpm,labRow = y2$genes$genes, Rowv = TRUE, col=rev(morecols(20)),trace="none",tracecol = "black",main="Top 20 most variable genes across samples",cex.main=0.6, ColSideColors=group.col,scale="row",margins=c(10,9))
I got the following graph ![heatmap][1][1]: https://ibb.co/iiN257 The colors in column header indicate similar group which are 5 different colors (groups). How to make the samples in each group together so as to show group-wise variation (which is supervised clustering). Thanks
If your input samples are in the correct order, use dendrogram="row" to turn off the column-wise clustering
or, if your input matrix is ordered try Rowv=False
The row is not in order so adding
did not really help . E.g. my samples are as A A A B B B A A A C C C N N N. I need to find a way to bring all 6 "A" together.
Have you considered then reordering them
That was my question , how ?
Re-order them in your actual data-matrix, i.e., before you even apply the heatmap.2 function, and then use
Colv
anddendrogram
as per BuffoSomething like: