How To Find The Distance Between Genes After Performing A Clustering
2
0
Entering edit mode
7.7 years ago

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)

n<-1:nrow(dat.s)
n.s<-sample(n, nrow(dat.s)*0.1)
dat.sample<-dat.s[n.s,]
library(amap)

plot(clust.genes)

clustering • 2.0k views
1
Entering edit mode
7.5 years ago
NetunoPoncã ▴ 160

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?

0
Entering edit mode
7.5 years ago
Ahill ★ 1.9k

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")