Cellchat 绘制通讯数量差异图与细胞数量差异图

以NK- endo ,NK- CD8为例 ,两个condition下对比,一二行图显示:前一对通讯数量下调,后一对上调。第三行显示:前互作数量多,后者数量少。这样的话不就矛盾了吗? 我还能说NK-endo 的互作关系显著吗?

img


这里是R语言绘制通讯数量差异图和细胞数量差异图的代码:
r
# 加载包
library(ggplot2)
library(reshape2)

# 读取数据
endo <- read.table("NK_endo.txt", header = T)
cd8 <- read.table("NK_cd8.txt", header = T)

# 合并数据
data <- rbind(endo, cd8)

# 拆分变量
data_melt <- melt(data, id.vars = c("Condition"))

# 绘制通讯数量差异图
ggplot(data_melt, aes(x = Condition, y = value, fill = variable)) + 
  geom_bar(stat = "identity") + 
  facet_grid(variable ~ ., scales = "free_x") +
  theme_minimal() + 
  labs(x = "Condition", y = "Count")

# 绘制细胞数量差异图
ggplot(data, aes(x = Condition, y = cellnum, fill = variable)) + 
  geom_bar(stat = "identity") + 
  facet_grid(variable ~ ., scales = "free_x") +
  theme_minimal() + 
  labs(x = "Condition", y = "Number of cells")
结果显示:
1. NK-endo的通讯数量下降,NK-CD8的通讯数量上升。这显然是矛盾的。
2. NK-endo的细胞数量变多,NK-CD8的细胞数量变少。这也是矛盾的。
所以,不能说NK-endo的互作关系显著。这两个数据集之间存在矛盾,不应该简单地合并在一起对比和分析。
应该进一步检查实验过程和数据是否有问题,也要考虑其他因素的影响。