[BioC] problem with cuttree

Sean Davis sdavis2 at mail.nih.gov
Wed Nov 9 13:11:02 CET 2005


On 11/9/05 2:42 AM, "madhurima bhattacharjee" <madhurima_b at persistent.co.in>
wrote:

> Hello All,
> 
> I am using the hclust  function .
> As the data size is huge(2000 genes) I tried to use cuttree to cut the
> original tree into subtrees and then analyze the data.
> I cant figure out how to view a subtree with the labels.
> Can anyone help me ASAP?

As another poster mentioned, it is REALLY worthwhile to try exporting to
Cluster/Treeview for jobs like this.  However, cutree gives you the cluster
memberships for your genes, so you can then pull out only the genes of
interest by subsetting.

> m <- matrix(rnorm(500),nc=10)
> hclust(m)
Error in if (n < 2) stop("must have n >= 2 objects to cluster") :
        argument is of length zero
> hc <- hclust(dist(m))
> plot(hc)
> v <- cutree(hc,k=3)
> v
 [1] 1 2 3 1 3 3 3 1 3 1 3 1 1 2 3 2 1 3 3 2 1 3 1 3 2 2 3 1 3 3 3 3 2 1 1 2
3 1
[39] 1 3 2 3 2 2 1 3 2 3 2 3
> plot(hclust(dist(m[v==1,])))



More information about the Bioconductor mailing list