R语言绘制MAplot

图片alt

图片alt

res <- data.frame(
   baseMean = apply(normlized_counts, 1, function(t){(log2(mean(t[4:5])) +log2(mean(t[1:3])))/2}),
   log2FoldChange = apply(normlized_counts, 1, function(t){ log2(mean(t[4:5])) -log2(mean(t[1:3]))})
)
head(res)
plot(res$baseMean,res$log2FoldChange,ylim=c(-2,2),type="p")
abline(h = 0, col = "red") 

参考:
https://www.jianshu.com/p/cdfac0bfb733?clicktime=1578727786
https://b23.tv/Zl3Xxi