For the log2 of normalized Tumor/Distant ratios:
df13<- df11b[,c(1,2,11)]Ok. So now I am in business for the heat maps. There are several packages to use. heatmaps is built-in. gplot has heatmap.2 and there are some made for expression data. But I have tried to use these packages and my input data may look too different to use these packages.
df13b<-reshape(df13,idvar="GeneID",timevar="pt.num",direction='wide')
rownames(df13b.m) <- df13b.m[ ,1]
df13b.m <- as.matrix(df13b.m[c(2:9)])
heatmap(df13b.m)
heatmap.2(df13b.m)
We can scale the data to mean=0 and sd=1 with the following:
df13.scale<-as.matrix(scale(df13b.m))The clustering looks different using the scaled data. It is difficult to compare the cluseting in detail due to the large matrix. We can look at smaller clueters and specify the number of cluseter using hclust as done here http://www.r-bloggers.com/drawing-heatmaps-in-r/
heatmap(df13.scale)
Separate the clusters. First, cluster by row:
df13.hc<-hclust(dist(df13.scale))But I could not get the clustering selection to work with my set in a meaningful way. Need to play with this option. At least we have a dataset to work with.
plot(df13.hc)