[BioC] Clustering in R....

Marcus marcusb at biotech.kth.se
Mon Nov 10 13:41:20 MET 2003



>Hello again. Back from some weeks of laborative work I still have some 
>questions on clustering in R.
>
>I got a lot of help from Sean Davis (thanks a lot :o)  ) so if he or 
>someone else have the time....
>
>My problem is that I have some spots flagges as NA in a matrix of M-values 
>organised slidewise. I want to cluster those but I get error messages when 
>using heatmap due to the NA:s in the matrix. I mailed Andy Liaw (who wrote 
>the heatmap function) and he gave med the tip to look into the daisy 
>function. And the daisy function is supposed to handle NA:s.
>
>But what do you get out of the function?
>
>test <- daisy(mymatrix)
>This creates an object of type dissimilarity right? And you can convert it 
>into a matrix with the help of
>testII <- as.matrix(test)
>Is this what I should use hclust on? or should I do
>testIII <- as.dist(testII) before. Neither works so I do not know really 
>what is true.
>
>And I tried to use daisy directly with heatmap but that didnt work but 
>produced the same error as with dist.
>
>heatmap(mymatrix[1:22,], distfun = dist)
>Error in hclustfun(distfun(x)) : NA/NaN/Inf in foreign function call (arg 11)
>This is due to the fact that I only have 2 M-values in the twentisecond 
>row and 16 NA:s.
>
>So basically my question is, how do you do to get heatmap to work with a 
>matrix of M-values that has got spots flagged NA in them ? What distance 
>function works and how do you use it?
>
>Could someone please help me and perhaps write an example of how to do. I 
>think the help files are not so good in this perspective.
>
>Best regards
>
>/ Marcus

*******************************************************************************************
Marcus Gry Björklund

Royal Institute of Technology
AlbaNova University Center
Stockholm Center for Physics, Astronomy and Biotechnology
Department of Molecular Biotechnology
106 91 Stockholm, Sweden

Phone (office): +46 8 553 783 45
Fax: + 46 8 553 784 81
Visiting adress: Roslagstullsbacken 21, Floor 3
Delivery adress: Roslagsvägen 30B



More information about the Bioconductor mailing list