Hi
I have clustered my normalised gene expression data using two methods. 1. NMF aheatmap 2. Using R's hclust function. I am trying to work out why these two methods give different clustering patterns despite me specifying the aheatmap function to use the same methods as the default R's function. Observe.
tdata <- t(data)
Raw2 <- tdata
dissimilarity <- 1 - cor(Raw2, method = 'pearson') # abs has been removed
distance <- as.dist(dissimilarity)
hc <- hclust(distance, method = 'complete')
plot(hc, main="Dissimilarity = 1 - (Correlation)", xlab="")
aheatmap(data, distfun = 'pearson', hclustfun = 'complete', scale = 'row')
This has been annoying me all morning, I have checked the aheatmap source code and it seems to use as.dist and hclust just as I am doing here, but the order of genes/probes is different - hence the clustering pattern is different.
Best,
Chris