Entering edit mode
2.3 years ago
bart
▴
50
Hi,
I'm trying to create a heatmap of a dataset. All previous steps until the heatmap step do not return any errors. However, the following heatmap step:
pheatmap(t(scale(t(de_mat))),show_rownames = F,show_colnames = T,annotation_col =metadata_tpvspp,annotation_colors = ann_colors, fontsize = 5)
Returns this error and it does not result in a heatmap shown:
Error in cut.default(a, breaks = 100) : 'x' must be numeric
However, I'm sure my heatmap object is numeric because
apply(de_mat,2,class)
Only returns numeric class objects in all colums. Does anyone know what my mistake is? If the data object is not numeric it could never have been a deseq object so I'm not sure what the problem is here.
Turns out that I got this error because I did not include any rownames for my metadata object or colnames for my deseq object because I did not think this was necessary. Still, the error itself is not extremely helpful in pointing out my error. Also, the metadata was a tibble instead of a dataframe which did not give any errors upstream (eg in the deseq formulas).
Could you share an example of
de_mat
withdput(head(de_mat))
? Thanksde_mat -->
Could you try
dput(de_mat[1:9,1:7])
instead ? Because I can't load the data with that structureSorry for the late response
Have you tried to run without annotation ?
pheatmap(t(scale(t(de_mat))),show_rownames = F,show_colnames = T, fontsize = 5)
It seems indeed yourde_mat
is okay so maybe the issue comes from your annotationThis doesn't give me a plot but also does not give me an error. So no solution yet unfortunately
The code shared by Basti generates the following plot.