CellChat
CellChat copied to clipboard
Error in netVIsualHeatmap on merged object
When I run netVisual_heatmap on a merged object, it throws the following error:
Do heatmap based on a merged object
Error in grDevices::col2rgb(colors): invalid color name 'Reds'
Traceback:
1. netVisual_heatmap(cellchat)
2. colorRamp3(c(min(mat), 0, max(mat)), c(color.heatmap[1], "#f7f7f7",
. color.heatmap[2]))
3. t(grDevices::col2rgb(colors)/255)
4. grDevices::col2rgb(colors)
This error does not happen when I do it on an individual object from the merged object. For example, if I run:
netVisual_heatmap(cond[[1]])
Where the items in cond are cellchat objects for each condition, the heatmap is generated normally.
@LinearParadox Add color.heatmap <- c('#2166ac','#b2182b'). Will fix this bug in next update.