I am using CLUSTERGRAM from the Bioinformatics Toolbox (version 3.7). MATLAB R2011a version.
I would like to get permutation vectors for rows and columns for clustergram, as I can do with dendrogram function:
x = magic(10); >> [~,~,permrows] = dendrogram(linkage(x,'average','euc')) permrows = 9 10 6 7 8 1 2 4 5 3 >> [~,~,permcols] = dendrogram(linkage(x','average','euc')) permcols = 6 7 8 9 2 1 3 4 5 10
I found that clustering is not like a clustergram and a dendrogram, most likely due to the optimal calculation of leaf ordering (I don't want to turn it off).
For example, for clustergram from:
clustergram(x)
( 'average'
and 'eucledian'
are the default methods for clustergram)
vectors (as in the attached figure) should be:
permrows = [1 2 4 5 3 10 9 6 7 8]; permcols = [1 2 8 9 6 7 10 5 4 3];
So how to programmatically get these vectors? Is anyone familiar with this subject?
Can anyone suggest a good alternative? I know that I can create a similar figure combining the functions of imagesc and dendrogram, but the ordering of the leaves is much better (optimal) in clustergram than in dendrogram.
source share