2021-01-07 火山图R代码

2021-01-07  本文已影响0人  陶子不淘气

deg.data<-read.table("DEGdata.txt",header=T,sep="\t")
head(deg.data)
deg.datalogP <- -log10(deg.dataadj.P.Val)
ggscatter(deg.data,x="logFC",y="logP")+theme_base()
deg.datachange=ifelse(deg.dataadj.P.Val>0.01,'NoDiff', ifelse(deg.datalogFC>=2,'Up',ifelse(deg.datalogFC<= -2,'Down','NoDiff')))
ggscatter(deg.data,x="logFC",y="logP",color ="change" ,palette = c("#2f5688","#BBBBBB","#CC0000"),size = 1,repel = T,xlab = "logFC" ,
ylab = "-log10(adj.P.Val)")+theme_base()+geom_hline(yintercept = 1.30,linetype="dashed")+geom_vline(xintercept = c(-2,2),linetype="dashed")

代码参考自:https://cloud.tencent.com/developer/article/1512442

上一篇 下一篇

猜你喜欢

热点阅读