刚刚测试了一下,可能是cellchat的bug,可以换成细胞类型序号绘制这个图,下面的代码获得细胞序号:
print("设置感兴趣的细胞类型对应的细胞序号")
print(paste(1:length(levels( cellchat@idents )),levels( cellchat@idents ),sep=":")) #单独的 print(paste(1:length(levels( cellchat2@idents$joint )),levels( cellchat2@idents$joint ),sep=":")) #合并的
之后绘图用序号代替细胞类型,就正常了;
netVisual_bubble(cellchat, sources.use = c( 1 ), targets.use = c(4, 5, 6 ))