Hi i have a query regarding clustering,I have clustered my genes using amap package of top 50 genes but how can i find out the distances between these genes depending upon their expression values.I have used this R script:
library(amap)
clust.genes<-hcluster(x=dat.s,method="euclidean",link="average")
clust.arrays<-hcluster(x=t(dat.s),method="euclidean",link="average")
n<-1:nrow(dat.s)
n.s<-sample(n, nrow(dat.s)*0.1)
dat.sample<-dat.s[n.s,]
library(amap)
clust.genes<-hcluster(x=dat.sample, method="euclidean",link="average")
clust.arrays<-hcluster(x=t(dat.sample), method="euclidean",link="average")
plot(clust.genes)
2 answers
What do you mean by the distance between genes? The distance between them is the same before or after clustering, unless you use a measure of distance between clusters!
If you want the distance between genes, simply compute it with the desired measure... their distance is not going to change after clustering...
Can you be a bit clearer about your question?
The R dist() function returns the distance matrix computed by using a specified distance measure. Type ?dist at the R prompt for details. For your dat.sample matrix:
dist.genes <- dist(dat.sample, method="euclidean")
dist.arrays <- dist(t(dat.sample), method="euclidean")
Log in to answer this question.