[BioC] How to do clustering
Sean Davis
sdavis2 at mail.nih.gov
Wed Jun 13 12:02:55 CEST 2007
ssls sddd wrote:
> Dear Dr.Thomas Girke,
>
> I have one more question for you. I tried pvclust in the session of
> 'Obtain significant clusters by pvclust bootstrap analysis' for my data, x.
>
> But I have a problem with:
>
> heatmap(x, Rowv=dend_colored, Colv=as.dendrogram(hc), col=my.colorFct(),
> scale="row", RowSideColors=mycolhc)
>
> the error was:
>
> error in heatmap(x, Rowv = dend_colored, Colv = as.dendrogram(hc), col =
> my.colorFct(), :
> 'x' must be a numeric matrix
>
> I ran 'x[1:3,1:3]' and it produced the following:
>
> AIRNS_A09 AIRNS_A11 AIRNS_A12
> SNP_A-1780271 1.85642 1.50956 1.73154
> SNP_A-1780274 1.72140 1.83712 1.85948
> SNP_A-1780277 2.04241 1.53458 1.65270
>
> I think the x is a numeric matrix. Do you think where I may get wrong?
Try coercing the x into a matrix directly:
heatmap(as.matrix(x), Rowv=dend_colored, Colv=as.dendrogram(hc),
col=my.colorFct(), scale="row", RowSideColors=mycolhc)
Does this fix the problem? You can always check the class of an object
by doing something like:
class(x)
which should report:
[1] "matrix"
Hope that helps.
Sean
More information about the Bioconductor
mailing list