
% read data in matrix format
A = textread('cho_cell_cycle_ex90_100_data.txt');

% normalize X
X = A - repmat(mean(A,2),1,size(A,2));
X = X ./ (repmat(std(X,[],2),1,size(X,2))+eps);


Y = pdist(X,'euclidean');
%Y = pdist(X,'correlation');

% create hierarchical clustering tree
Z = linkage(Y,'average');

figure;
[H,T] = dendrogram(Z, 200,'colorthreshold','default');
%set(H,'LineWidth',2)


figure;
[H,T,perm] = dendrogram(Z, 0);

figure; 
imagesc(X(perm,:));


