参考https://mp.weixin.qq.com/s/76hSRtF7m3V9AXonrCNc8w
2021发表在 Cell Reports 杂志的文章:《TREM2-independent oligodendrocyte, astrocyte, and T cell responses to tau and amyloid pathology in mouse models of Alzheimer disease》
作者是把在两次差异分析至少有一次是统计学显著的基因拿过去绘图,英文的描述是Only genes called as DEGs (FDR < 0.05, fold change >2 or < 2) for either comparison are shown.
两次单细胞差异分析后的结果进行相关性散点图绘制
#total=c(rownames(deg_eCRSvsPB[abs(deg_eCRSvsPB$avg_log2FC)>1,]),
# rownames(deg_nCRSvsPB[abs(deg_nCRSvsPB$avg_log2FC)>1,]))
#markers_nCRSvsPB <- subset(deg_nCRSvsPB,p_val_adj<0.05&abs(avg_log2FC)>1)
#markers_eCRSvsPB <- subset(deg_eCRSvsPB,p_val_adj<0.05&abs(avg_log2FC)>1)
#markers_inter <-intersect(rownames(markers_nCRSvsPB),rownames(markers_eCRSvsPB))
ids <- total #变量
df= data.frame(
deg_eCRSvsPB = deg_eCRSvsPB[ids,'avg_log2FC'],
deg_nCRSvsPB = deg_nCRSvsPB[ids,'avg_log2FC']
)
library(ggpubr)
ggscatter(df, x = "deg_nCRSvsPB", y = "deg_eCRSvsPB",
color = "magenta", shape = 16, size =1.5, # Points color, shape and size
add = "reg.line", # Add regressin line
ylim = c(-4, 6), xlim = c(-4, 6),
add.params = list(color = "gray25", fill = "lightgray", linetype="dashed"), # Customize reg. line
conf.int = TRUE, # Add confidence interval
cor.coef = TRUE, # Add correlation coefficient. see ?stat_cor
cor.coeff.args = list(method = "pearson", label.sep = "\n")
)
ggsave("eCRSvsPB_nCRSvsPB_total_ggscatter.pdf")