Open HouyuZhang opened 1 year ago
I do have the same error when running that function and netVisual_heatmap
too even though I'm using a vector with the same names as my Idents...
At the end I changed the color manually with Illustrator when creating the final version of the plot as I don't know if this error is a bug coming from ComplexHeatmap
Yes, I finally found this arose from ComplexHeatmap
, where the col
parameter needs a named color vector.
The format should look like this:
CellType1 CellType2 CellType3
"red" "blue" "black"
How did you defined that named color vector?? Because i tried to do mine in the usual way:
asa_palette <- c('B cells' = '#426600', 'DC' = '#FF0010', 'Endothelial cells' = '#4C005C', 'Epithelial cells' = '#FFCC99', 'Fibroblasts' = '#8F7C00', 'ILC' = '#808080', 'Macrophages' = '#9DCC00', 'Mixed group' = '#F0A0FF', 'Monocytes' = '#005C31', 'Neutrophils' = '#191919', 'NK cells' = '#C20088', 'NKT' = '#FFA405', 'Stem cells' = '#003380', 'T cells CD4' = '#FFA8BB', 'T cells CD8' = '#993F00', 'T cells immature-early' = '#65c8db', 'Tgd' = '#2BCE48', 'Tregs' = '#0075DC' )
And I believe it's done correctly but I still have the same issue:
I don't know what did I do wrong but I would have save me a lot of time of post-editing...
Literally I've just noticed that this error arises when you select the remove.isolate = T
!
With that option set to FALSE the colors are matched accordingly, and I recommend using it because in the past I saw that it was removing some rows that it shouldn't...
Cell types in the color vector should be exactly the same as the cell types input for cellchat
analysis.
They are the same! In other functions the named vector worked perfectly but in netVisual_heatmap
it only worked when remove.isolate = TRUE
; maybe it's because of what you say, as removing the isolates is removing cell types that it cannot find in the named color vector
@ManuelMoradiellos It should be fixed now.
Dear developer, Thank you for this powerful software to study cell-cell communication. I recently have an error when running the
netAnalysis_signalingRole_heatmap
function, it raised "Error: elements in col should be named vectors." I have checked theAnno
column and found these cell annotations are factors. Does someone have a similar issue when running this function? Thank you in advance.