Closed danhtruong closed 4 years ago
The colors you are getting are the pheatmap defaults. When there is any sort of formatting or linkage issue with the annotation_colors
provided to pheatmap()
, pheatmap fills in with its original defaults. When plotScoreHeatmap
sees that you provided your own annotation_colors
, it doesn't create its own.
So this points us to there being an issue with your annotation_colors
. I think the issue is a capitalization one: you need to capitalize labels
in annotation_colors=list(labels = lps_anno_colors[labs])
to match that it is capitalized in the plot.
Does plotScoreHeatmap(pred.LPS_data.cell.list[[x]], annotation_colors=list(Labels = lps_anno_colors[labs]) )
give what you want?
Got it! It worked out. I was still thinking it was 'labels' from the predicted score object. I didn't realize the plostScoreHeatmap function renamed it to 'Labels'.
I tried adjusting plotScoreHeatmap annotation colors using pheatmap parameter. It doesn't seem to adjust the colors at all and instead seems to just change the colors to a palette similar to ggplot for some reason.
When I add annotation_colors:
plotScoreHeatmap(pred.LPS_data.cell.list[[x]], annotation_colors=list(labels = lps_anno_colors[labs]) )
My expected color palette:
lps_anno_colors[labs]
Fibroblasts NK cells Endothelial cells Monocytes CD8+ T-cells "#81C847" "#E74C3C" "#30B59E" "#E67625" "#5186D0" In fact, if I run this code:plotScoreHeatmap(pred.LPS_data.cell.list[[x]], annotation_colors=list() )
I still get this: