I have been struggling with the heatmap function for which I continuously receive the error: 'x' must be a numeric matrix. I have been trying to perform section 4 ("Identifying temporally expressed genes") of the following slingshot vignette: http://www.bioconductor.org/packages/devel/bioc/vignettes/slingshot/inst/doc/vignette.html
I have executed the following lines of code, where "thymus_sce" is my SCE object:
library(tradeSeq) # fit negative binomial GAM sim <- fitGAM(thymus_sce) # test for dynamic expression ATres <- associationTest(thymus_sce) topgenes <- rownames(ATres[order(ATres$pvalue), ])[1:250] pst.ord <- order(thymus_sce$slingPseudotime_1, na.last = NA) heatdata <- assays(thymus_sce)$counts[topgenes, pst.ord] heatclus <- thymus_sce$GMM[pst.ord]
All of the above I got to work, until I get to:
heatmap(log1p(heatdata), Colv = NA, ColSideColors = brewer.pal(9,"Set1")[heatclus])
Here, I get:
Error in heatmap(log1p(heatdata), Colv = NA, ColSideColors = brewer.pal(9, : 'x' must be a numeric matrix
I checked the class of
which gives me
 "dgCMatrix" attr(,"package")  "Matrix"
So I suppose it is a matrix, right? At least, a sparse one... Is that the problem? What am I doing wrong and how could I get this to work?
Your help would be much appreciated, if any more information is needed, please let me know!
Kind regards, Florencia